@@ -1262,6 +1262,9 @@ object SymDenotations {
1262
1262
memberNamesCache = MemberNames .None
1263
1263
}
1264
1264
1265
+ def invalidateBaseTypeRefCache () =
1266
+ baseTypeRefCache = new java.util.HashMap [CachedType , Type ]
1267
+
1265
1268
override def copyCaches (from : SymDenotation , phase : Phase )(implicit ctx : Context ): this .type = {
1266
1269
from match {
1267
1270
case from : ClassDenotation =>
@@ -1348,45 +1351,6 @@ object SymDenotations {
1348
1351
isCompleted && testFullyCompleted && { setFlag(FullyCompleted ); true }
1349
1352
}
1350
1353
1351
- // ------ syncing inheritance-related info -----------------------------
1352
-
1353
- private var firstRunId : RunId = initRunId
1354
-
1355
- /** invalidate caches influenced by parent classes if one of the parents
1356
- * is younger than the denotation itself.
1357
- */
1358
- override def syncWithParents (implicit ctx : Context ): SingleDenotation = {
1359
- def isYounger (tref : TypeRef ) = tref.symbol.denot match {
1360
- case denot : ClassDenotation =>
1361
- if (denot.validFor.runId < ctx.runId) denot.current // syncs with its parents in turn
1362
- val result = denot.firstRunId > this .firstRunId
1363
- if (result) incremental.println(s " $denot is younger than $this" )
1364
- result
1365
- case _ => false
1366
- }
1367
- val parentIsYounger = (firstRunId < ctx.runId) && {
1368
- infoOrCompleter match {
1369
- case cinfo : ClassInfo => cinfo.classParents exists isYounger
1370
- case _ => false
1371
- }
1372
- }
1373
- if (parentIsYounger) {
1374
- incremental.println(s " parents of $this are invalid; symbol id = ${symbol.id}, copying ... \n " )
1375
- invalidateInheritedInfo()
1376
- }
1377
- firstRunId = ctx.runId
1378
- this
1379
- }
1380
-
1381
- /** Invalidate all caches and fields that depend on base classes and their contents */
1382
- override def invalidateInheritedInfo (): Unit = {
1383
- myMemberFingerPrint = FingerPrint .unknown
1384
- myMemberCache = null
1385
- myMemberCachePeriod = Nowhere
1386
- invalidateBaseDataCache()
1387
- invalidateMemberNamesCache()
1388
- }
1389
-
1390
1354
// ------ class-specific operations -----------------------------------
1391
1355
1392
1356
private [this ] var myThisType : Type = null
@@ -1441,9 +1405,6 @@ object SymDenotations {
1441
1405
baseTypeRefValid = ctx.runId
1442
1406
}
1443
1407
1444
- def invalidateBaseTypeRefCache () =
1445
- baseTypeRefCache = new java.util.HashMap [CachedType , Type ]
1446
-
1447
1408
def computeBaseData (implicit onBehalf : BaseData , ctx : Context ): (List [ClassSymbol ], BaseClassSet ) = {
1448
1409
val seen = mutable.SortedSet [Int ]()
1449
1410
def addBaseClasses (bcs : List [ClassSymbol ], to : List [ClassSymbol ])
@@ -1571,8 +1532,7 @@ object SymDenotations {
1571
1532
1572
1533
if (myMemberFingerPrint != FingerPrint .unknown)
1573
1534
myMemberFingerPrint.include(sym.name)
1574
- if (myMemberCache != null )
1575
- myMemberCache invalidate sym.name
1535
+ if (myMemberCache != null ) myMemberCache.invalidate(sym.name)
1576
1536
if (! sym.flagsUNSAFE.is(Private )) invalidateMemberNamesCache()
1577
1537
}
1578
1538
@@ -1583,8 +1543,7 @@ object SymDenotations {
1583
1543
def replace (prev : Symbol , replacement : Symbol )(implicit ctx : Context ): Unit = {
1584
1544
require(! (this is Frozen ))
1585
1545
unforcedDecls.openForMutations.replace(prev, replacement)
1586
- if (myMemberCache != null )
1587
- myMemberCache invalidate replacement.name
1546
+ if (myMemberCache != null ) myMemberCache.invalidate(replacement.name)
1588
1547
}
1589
1548
1590
1549
/** Delete symbol from current scope.
@@ -1595,8 +1554,8 @@ object SymDenotations {
1595
1554
require(! (this is Frozen ))
1596
1555
info.decls.openForMutations.unlink(sym)
1597
1556
myMemberFingerPrint = FingerPrint .unknown
1598
- if (myMemberCache != null ) myMemberCache invalidate sym.name
1599
- invalidateMemberNamesCache()
1557
+ if (myMemberCache != null ) myMemberCache. invalidate( sym.name)
1558
+ if ( ! sym.flagsUNSAFE.is( Private )) invalidateMemberNamesCache()
1600
1559
}
1601
1560
1602
1561
/** Make sure the type parameters of this class appear in the order given
0 commit comments