@@ -255,6 +255,7 @@ class Objects(using Context @constructorOnly):
255
255
case vdef : ValDef =>
256
256
val sym = vdef.symbol
257
257
if sym.isLocal then defs += sym
258
+ traverseChildren(vdef.rhs)
258
259
259
260
case _ =>
260
261
traverseChildren(tree)
@@ -680,8 +681,10 @@ class Objects(using Context @constructorOnly):
680
681
val changeSetBefore = Heap .getChangeSet()
681
682
// Only perform footprint optimization for method context
682
683
val footprint =
683
- if ctx == EvalContext .Method then Heap .footprint(Heap .getHeapData(), thisV, env, State .currentObjectRef)
684
- else heapBefore
684
+ if ctx == EvalContext .Method then
685
+ Heap .footprint(Heap .getHeapData(), thisV, env, State .currentObjectRef)
686
+ else
687
+ heapBefore
685
688
val config = Config (thisV, env, footprint)
686
689
687
690
Heap .update(footprint, changeSet = Set .empty)
@@ -1267,7 +1270,7 @@ class Objects(using Context @constructorOnly):
1267
1270
* @param klass The enclosing class where the expression is located.
1268
1271
* @param ctx The context where `eval` is called.
1269
1272
*/
1270
- def eval (expr : Tree , thisV : ThisValue , klass : ClassSymbol , ctx : EvalContext = EvalContext .Other ): Contextual [Value ] = log(" evaluating " + expr.show + " , this = " + thisV.show + " , regions = " + Regions .show + " in " + klass.show, printer, (_ : Value ).show) {
1273
+ def eval (expr : Tree , thisV : ThisValue , klass : ClassSymbol , ctx : EvalContext = EvalContext .Other ): Contextual [Value ] = log(" evaluating " + expr.show + " , this = " + thisV.show + " , heap size = " + Heap .getHeapData().size + " in " + klass.show, printer, (_ : Value ).show) {
1271
1274
cache.cachedEval(thisV, expr, ctx) { expr => cases(expr, thisV, klass) }
1272
1275
}
1273
1276
0 commit comments