Skip to content

Commit ed2dcc2

Browse files
committed
Stats recording for computing denotations
1 parent 2e7385a commit ed2dcc2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,25 +477,29 @@ object Symbols {
477477

478478
/** Set the denotation of this symbol */
479479
private[core] def denot_=(d: SymDenotation): Unit = {
480+
util.Stats.record("Symbol.denot_=")
480481
lastDenot = d
481482
checkedPeriod = Nowhere
482483
}
483484

484485
/** The current denotation of this symbol */
485486
final def denot(using Context): SymDenotation = {
487+
util.Stats.record("Symbol.denot")
486488
val lastd = lastDenot
487489
if (checkedPeriod == ctx.period) lastd
488490
else computeDenot(lastd)
489491
}
490492

491493
private def computeDenot(lastd: SymDenotation)(using Context): SymDenotation = {
494+
util.Stats.record("Symbol.computeDenot")
492495
val now = ctx.period
493496
checkedPeriod = now
494497
if (lastd.validFor contains now) lastd else recomputeDenot(lastd)
495498
}
496499

497500
/** Overridden in NoSymbol */
498501
protected def recomputeDenot(lastd: SymDenotation)(using Context): SymDenotation = {
502+
util.Stats.record("Symbol.recomputeDenot")
499503
val newd = lastd.current.asInstanceOf[SymDenotation]
500504
lastDenot = newd
501505
newd

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,7 @@ object Types {
19761976

19771977
/** The denotation currently denoted by this type */
19781978
final def denot(using Context): Denotation = {
1979+
util.Stats.record("NamedType.denot")
19791980
val now = ctx.period
19801981
// Even if checkedPeriod == now we still need to recheck lastDenotation.validFor
19811982
// as it may have been mutated by SymDenotation#installAfter
@@ -1987,6 +1988,7 @@ object Types {
19871988
}
19881989

19891990
private def computeDenot(using Context): Denotation = {
1991+
util.Stats.record("NamedType.computeDenot")
19901992

19911993
def finish(d: Denotation) = {
19921994
if (d.exists)

0 commit comments

Comments
 (0)