@@ -474,7 +474,8 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
474
474
val nonExistent : Boolean )
475
475
extends Analysis .ClassInfo with ClassLoadingState with LoadingResult with ModuleUnit {
476
476
477
- var linkedFrom : List [From ] = Nil
477
+ private [this ] val _linkedFrom = new GrowingList [From ]
478
+ def linkedFrom : List [From ] = _linkedFrom.get()
478
479
479
480
val className = data.className
480
481
val kind = data.kind
@@ -511,7 +512,7 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
511
512
if (nonExistent)
512
513
_errors ::= MissingClass (this , from)
513
514
514
- linkedFrom ::= from
515
+ _linkedFrom ::= from
515
516
}
516
517
517
518
private [this ] def validateSuperClass (superClass : Option [ClassInfo ]): Option [ClassInfo ] = {
@@ -639,7 +640,8 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
639
640
if (className != ObjectClass )
640
641
addStaticDependency(ObjectClass )
641
642
642
- var instantiatedFrom : List [From ] = Nil
643
+ private [this ] val _instantiatedFrom = new GrowingList [From ]
644
+ def instantiatedFrom : List [From ] = _instantiatedFrom.get()
643
645
644
646
val dispatchCalledFrom : mutable.Map [MethodName , List [From ]] = mutable.Map .empty
645
647
@@ -1038,7 +1040,7 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
1038
1040
}
1039
1041
1040
1042
def instantiated ()(implicit from : From ): Unit = {
1041
- instantiatedFrom ::= from
1043
+ _instantiatedFrom ::= from
1042
1044
1043
1045
/* TODO? When the second line is false, shouldn't this be a linking error
1044
1046
* instead?
@@ -1097,7 +1099,8 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
1097
1099
}
1098
1100
1099
1101
private def subclassInstantiated ()(implicit from : From ): Unit = {
1100
- instantiatedFrom ::= from
1102
+ _instantiatedFrom ::= from
1103
+
1101
1104
if (! isAnySubclassInstantiated && (isScalaClass || isJSType)) {
1102
1105
isAnySubclassInstantiated = true
1103
1106
@@ -1264,8 +1267,11 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
1264
1267
var isAbstractReachable : Boolean = false
1265
1268
var isReachable : Boolean = false
1266
1269
1267
- var calledFrom : List [From ] = Nil
1268
- var instantiatedSubclasses : List [ClassInfo ] = Nil
1270
+ private [this ] val _calledFrom = new GrowingList [From ]
1271
+ def calledFrom : List [From ] = _calledFrom.get()
1272
+
1273
+ private [this ] val _instantiatedSubclasses = new GrowingList [ClassInfo ]
1274
+ def instantiatedSubclasses : List [ClassInfo ] = _instantiatedSubclasses.get()
1269
1275
1270
1276
def isReflectiveProxy : Boolean =
1271
1277
methodName.isReflectiveProxy
@@ -1284,7 +1290,7 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
1284
1290
def reachStatic ()(implicit from : From ): Unit = {
1285
1291
checkConcrete()
1286
1292
1287
- calledFrom ::= from
1293
+ _calledFrom ::= from
1288
1294
if (! isReachable) {
1289
1295
isAbstractReachable = true
1290
1296
isReachable = true
@@ -1297,7 +1303,7 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
1297
1303
1298
1304
if (! isAbstractReachable) {
1299
1305
checkExistent()
1300
- calledFrom ::= from
1306
+ _calledFrom ::= from
1301
1307
isAbstractReachable = true
1302
1308
}
1303
1309
}
@@ -1312,8 +1318,8 @@ final class Analyzer(config: CommonPhaseConfig, initial: Boolean,
1312
1318
1313
1319
checkConcrete()
1314
1320
1315
- calledFrom ::= from
1316
- instantiatedSubclasses ::= inClass
1321
+ _calledFrom ::= from
1322
+ _instantiatedSubclasses ::= inClass
1317
1323
1318
1324
if (! isReachable) {
1319
1325
isAbstractReachable = true
0 commit comments