File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,10 @@ object Contexts {
433433 }
434434
435435 /** A fresh clone of this context. */
436- def fresh : FreshContext = clone.asInstanceOf [FreshContext ].init(this )
436+ def fresh : FreshContext = {
437+ util.Stats .record(" Context.fresh" )
438+ clone.asInstanceOf [FreshContext ].init(this )
439+ }
437440
438441 final def withOwner (owner : Symbol ): Context =
439442 if (owner ne this .owner) fresh.setOwner(owner) else this
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import reporting._
99import config .Config
1010import collection .mutable
1111import java .lang .ref .WeakReference
12+ import util .Stats
1213
1314import scala .annotation .internal .sharable
1415
@@ -18,6 +19,8 @@ object TyperState {
1819
1920class TyperState (previous : TyperState /* | Null */ ) {
2021
22+ Stats .record(" typerState" )
23+
2124 val id : Int = TyperState .nextId
2225 TyperState .nextId += 1
2326
@@ -138,6 +141,7 @@ class TyperState(previous: TyperState /* | Null */) {
138141 * many parts of dotty itself.
139142 */
140143 def commit ()(implicit ctx : Context ): Unit = {
144+ Stats .record(" typerState.commit" )
141145 val targetState = ctx.typerState
142146 assert(isCommittable)
143147 targetState.constraint =
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ package typer
55import core ._
66import ast .{Trees , tpd , untpd }
77import util .Spans ._
8- import util .Stats .track
8+ import util .Stats .{ track , record }
99import util .{SourcePosition , NoSourcePosition , SourceFile }
1010import Trees .Untyped
1111import Contexts ._
@@ -782,6 +782,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
782782
783783 def realApply (implicit ctx : Context ): Tree = track(" realApply" ) {
784784 val originalProto = new FunProto (tree.args, IgnoredProto (pt))(this , tree.isContextual)(argCtx(tree))
785+ record(" typedApply" )
785786 val fun1 = typedExpr(tree.fun, originalProto)
786787
787788 // Warning: The following lines are dirty and fragile. We record that auto-tupling was demanded as
@@ -916,6 +917,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
916917 def typedTypeApply (tree : untpd.TypeApply , pt : Type )(implicit ctx : Context ): Tree = track(" typedTypeApply" ) {
917918 val isNamed = hasNamedArg(tree.args)
918919 val typedArgs = if (isNamed) typedNamedArgs(tree.args) else tree.args.mapconserve(typedType(_))
920+ record(" typedTypeApply" )
919921 handleMeta(typedExpr(tree.fun, PolyProto (typedArgs, pt)) match {
920922 case ExtMethodApply (app) =>
921923 app
Original file line number Diff line number Diff line change @@ -2190,9 +2190,12 @@ class Typer extends Namer
21902190 def tryEither [T ](op : Context => T )(fallBack : (T , TyperState ) => T )(implicit ctx : Context ): T = {
21912191 val nestedCtx = ctx.fresh.setNewTyperState()
21922192 val result = op(nestedCtx)
2193- if (nestedCtx.reporter.hasErrors)
2193+ if (nestedCtx.reporter.hasErrors) {
2194+ record(" tryEither.fallBack" )
21942195 fallBack(result, nestedCtx.typerState)
2196+ }
21952197 else {
2198+ record(" tryEither.commit" )
21962199 nestedCtx.typerState.commit()
21972200 result
21982201 }
You can’t perform that action at this time.
0 commit comments