@@ -92,6 +92,19 @@ object Semantic {
92
92
/** Ensure that outers and class parameters are initialized.
93
93
*
94
94
* Fields in class body are not initialized.
95
+ *
96
+ * We need to populate class parameters and outers for warm values for the
97
+ * following cases:
98
+ *
99
+ * - Widen an already checked warm value to another warm value without
100
+ * corresponding object
101
+ *
102
+ * - Using a warm value from the cache, whose corresponding object from
103
+ * the last iteration have been remove due to heap reversion
104
+ * {@see Cache.prepareForNextIteration}
105
+ *
106
+ * After populating class parameters and outers, it is possible to lazily
107
+ * compute the field values in class bodies when they are accessed.
95
108
*/
96
109
private def populateParams (): Contextual [this .type ] = log(" populating parameters" , printer, (_ : Warm ).objekt.toString) {
97
110
assert(! populatingParams, " the object is already populating parameters" )
@@ -255,11 +268,13 @@ object Semantic {
255
268
*
256
269
* The fact that objects of `ThisRef` are stored in heap is just an engineering convenience.
257
270
* Technically, we can also store the object directly in `ThisRef`.
258
- *
259
- * The heap contains objects of two conceptually distinct kinds.
260
- * - Objects that are also in `heapStable`
261
- * are flow-insensitive views of already initialized objects that are cached for reuse in analysis of later
262
- * classes. These objects and their fields should never change; this is enforced using assertions.
271
+ *
272
+ * The heap contains objects of two conceptually distinct kinds.
273
+ *
274
+ * - Objects that are also in `heapStable` are flow-insensitive views of already initialized objects that are
275
+ * cached for reuse in analysis of later classes. These objects and their fields should never change; this is
276
+ * enforced using assertions.
277
+ *
263
278
* - Objects that are not (yet) in `heapStable` are the flow-sensitive abstract state of objects being analyzed
264
279
* in the current iteration of the analysis of the current class. Their fields do change flow-sensitively: more
265
280
* fields are added as fields become initialized. These objects are valid only within the current iteration and
@@ -272,7 +287,6 @@ object Semantic {
272
287
273
288
/** Used to revert heap to last stable heap. */
274
289
private var heapStable : Heap = Map .empty
275
- def stableHeapContains (ref : Ref ) = heapStable.contains(ref)
276
290
277
291
def hasChanged = changed
278
292
0 commit comments