Skip to content

Commit 110dd20

Browse files
committed
Streamlining
1 parent 129b6da commit 110dd20

File tree

3 files changed

+122
-162
lines changed

3 files changed

+122
-162
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,19 @@ object SymDenotations {
18181818

18191819
override def hashCode = common.id // for debugging
18201820

1821+
/** The current denotation of this symbol */
1822+
def currentDenot(using Context): SymDenotation =
1823+
util.Stats.record("Symbol.denot")
1824+
val valid = validFor.code
1825+
// Next condition is inlined from Periods.containsSinglePhasePeriod
1826+
if ((valid - ctx.period.code) >>> PhaseWidth) <= (valid & PhaseMask)
1827+
then this
1828+
else recomputeDenot()
1829+
1830+
private def recomputeDenot()(using Context): SymDenotation =
1831+
util.Stats.record("Symbol.recomputeDenot")
1832+
symbol.setLastDenot(currentSymDenot)
1833+
18211834
// ---- ParamInfo bindings -------------------------------------
18221835

18231836
type ThisName <: Name

0 commit comments

Comments
 (0)