From a4994371c0b0fbea9d2802acc22d9cc3977a0de0 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 4 Oct 2026 13:30:41 -0700 Subject: Slides for 2026 REBASE --- chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'chapter11/src/test') diff --git a/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java b/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java index 8bf1debe..9a5e4677 100644 --- a/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java +++ b/chapter11/src/test/java/com/seaofnodes/simple/Chapter10Test.java @@ -290,7 +290,8 @@ while( i.x < i.len ) { return sum; """); StopNode stop = parser.parse().iterate(); - assertEquals("return Phi(Loop16,0,(Phi(Loop,0,(Phi_x+1))+Phi_sum));", stop.toString()); + assertEquals("return Phi(Loop16,0,(Phi(Loop,0,(Phi_$2+1))+Phi_sum));", stop.toString()); + assertEquals(10L,Evaluator.evaluate(stop,5)); } @@ -549,8 +550,8 @@ return 0; if (arg) s.x=arg+1; else s.x=arg+2; return s; """).parse().iterate(); - // The initializing slice also remains live as the aggregate default. - assertEquals(2,countMemoryNodes(stop,StoreNode.class,new BitSet())); + // Releasing the old aggregate exposes the overwritten initializing Store. + assertEquals(1,countMemoryNodes(stop,StoreNode.class,new BitSet())); assertEquals(2L,((Evaluator.Obj)Evaluator.evaluate(stop,0)).fields()[0]); assertEquals(4L,((Evaluator.Obj)Evaluator.evaluate(stop,3)).fields()[0]); } -- cgit v1.2.3