Commits

Armin Rigo committed f4c0e08

Test fixes

Comments (0)

Files changed (2)

pypy/jit/backend/x86/test/test_regalloc.py

         '''
         S = lltype.GcStruct('S')
         ptr = lltype.malloc(S)
-        self.cpu.clear_latest_values(2)
         self.interpret(ops, [0, ptr])
         assert self.getptr(0, lltype.Ptr(S)) == ptr
 
         ops = '''
         [i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i9b]
         i10 = call(ConstClass(f1ptr), i0, descr=f1_calldescr)
-        finish(i10, i1, i2, i3, i4, i5, i6, i7, i8, i9, i9b)
+        guard_false(i10) [i10, i1, i2, i3, i4, i5, i6, i7, i8, i9, i9b]
         '''
         loop = self.interpret(ops, [4, 7, 9, 9 ,9, 9, 9, 9, 9, 9, 8])
         assert self.getints(11) == [5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 8]
         ops = '''
         [i1, i2, i3, i4, i5, i6, i7, i8, i9, i9b, i0]
         i10 = call(ConstClass(f1ptr), i0, descr=f1_calldescr)
-        finish(i10, i1, i2, i3, i4, i5, i6, i7, i8, i9, i9b)
+        guard_false(i10) [i10, i1, i2, i3, i4, i5, i6, i7, i8, i9, i9b]
         '''
         loop = self.interpret(ops, [7, 9, 9 ,9, 9, 9, 9, 9, 9, 8, 4])
         assert self.getints(11) == [5, 7, 9, 9, 9, 9, 9, 9, 9, 9, 8]
         [i0, i1,  i2, i3, i4, i5, i6, i7, i8, i9]
         i10 = call(ConstClass(f1ptr), i0, descr=f1_calldescr)
         i11 = call(ConstClass(f2ptr), i10, i1, descr=f2_calldescr)        
-        finish(i11, i1,  i2, i3, i4, i5, i6, i7, i8, i9)
+        guard_false(i5) [i11, i1,  i2, i3, i4, i5, i6, i7, i8, i9]
         '''
         loop = self.interpret(ops, [4, 7, 9, 9 ,9, 9, 9, 9, 9, 9])
         assert self.getints(10) == [5*7, 7, 9, 9, 9, 9, 9, 9, 9, 9]
         [i0, i1]
         i2 = call(ConstClass(f1ptr), i0, descr=f1_calldescr)
         guard_value(i2, 0, descr=fdescr1) [i2, i0, i1]
-        finish(i1)
+        guard_false(i1) [i1]
         '''
         loop = self.interpret(ops, [4, 7])
         assert self.getint(0) == 5
         ops = '''
         [i2, i0, i1]
         i3 = call(ConstClass(f2ptr), i2, i1, descr=f2_calldescr)        
-        finish(i3, i0, descr=fdescr2)
+        guard_false(i0, descr=fdescr2) [i3, i0]
         '''
         bridge = self.attach_bridge(ops, loop, -2)
 
         [i0, i1]
         i2 = call(ConstClass(f2ptr), i0, i1, descr=f2_calldescr)
         guard_value(i2, 0, descr=fdescr1) [i2]
-        finish(i2)
+        guard_false(i2) [i2]
         '''
         loop = self.interpret(ops, [4, 7])
         assert self.getint(0) == 4*7
         ops = '''
         [i2]
         i3 = call(ConstClass(f1ptr), i2, descr=f1_calldescr)        
-        finish(i3, descr=fdescr2)        
+        guard_false(i3, descr=fdescr2) [i3]
         '''
         bridge = self.attach_bridge(ops, loop, -2)
 

pypy/jit/backend/x86/test/test_regalloc2.py

     cpu.setup_once()
     looptoken = JitCellToken()
     cpu.compile_loop(inputargs, operations, looptoken)
-    cpu.execute_token(looptoken, 9)
-    assert cpu.get_latest_value_int(0) == (9 >> 3)
-    assert cpu.get_latest_value_int(1) == (~18)
+    deadframe = cpu.execute_token(looptoken, 9)
+    assert cpu.get_latest_value_int(deadframe, 0) == (9 >> 3)
+    assert cpu.get_latest_value_int(deadframe, 1) == (~18)
 
 def test_bug_int_is_true_1():
     v1 = BoxInt()
     cpu.setup_once()
     looptoken = JitCellToken()
     cpu.compile_loop(inputargs, operations, looptoken)
-    cpu.execute_token(looptoken, -10)
-    assert cpu.get_latest_value_int(0) == 0
-    assert cpu.get_latest_value_int(1) == -1000
-    assert cpu.get_latest_value_int(2) == 1
+    deadframe = cpu.execute_token(looptoken, -10)
+    assert cpu.get_latest_value_int(deadframe, 0) == 0
+    assert cpu.get_latest_value_int(deadframe, 1) == -1000
+    assert cpu.get_latest_value_int(deadframe, 2) == 1
 
 def test_bug_0():
     v1 = BoxInt()
     cpu.setup_once()
     looptoken = JitCellToken()
     cpu.compile_loop(inputargs, operations, looptoken)
-    cpu.execute_token(looptoken, -13, 10, 10, 8, -8, -16, -18, 46, -12, 26)
-    assert cpu.get_latest_value_int(0) == 0
-    assert cpu.get_latest_value_int(1) == 0
-    assert cpu.get_latest_value_int(2) == 0
-    assert cpu.get_latest_value_int(3) == 0
-    assert cpu.get_latest_value_int(4) == 1
-    assert cpu.get_latest_value_int(5) == -7
-    assert cpu.get_latest_value_int(6) == 1
-    assert cpu.get_latest_value_int(7) == 0
-    assert cpu.get_latest_value_int(8) == -2
-    assert cpu.get_latest_value_int(9) == 18
-    assert cpu.get_latest_value_int(10) == 1
-    assert cpu.get_latest_value_int(11) == 18
-    assert cpu.get_latest_value_int(12) == -1
-    assert cpu.get_latest_value_int(13) == 0
+    deadframe = cpu.execute_token(looptoken, -13, 10, 10, 8, -8,
+                                  -16, -18, 46, -12, 26)
+    assert cpu.get_latest_value_int(deadframe, 0) == 0
+    assert cpu.get_latest_value_int(deadframe, 1) == 0
+    assert cpu.get_latest_value_int(deadframe, 2) == 0
+    assert cpu.get_latest_value_int(deadframe, 3) == 0
+    assert cpu.get_latest_value_int(deadframe, 4) == 1
+    assert cpu.get_latest_value_int(deadframe, 5) == -7
+    assert cpu.get_latest_value_int(deadframe, 6) == 1
+    assert cpu.get_latest_value_int(deadframe, 7) == 0
+    assert cpu.get_latest_value_int(deadframe, 8) == -2
+    assert cpu.get_latest_value_int(deadframe, 9) == 18
+    assert cpu.get_latest_value_int(deadframe, 10) == 1
+    assert cpu.get_latest_value_int(deadframe, 11) == 18
+    assert cpu.get_latest_value_int(deadframe, 12) == -1
+    assert cpu.get_latest_value_int(deadframe, 13) == 0
 
 def test_bug_1():
     v1 = BoxInt()
     cpu.setup_once()
     looptoken = JitCellToken()
     cpu.compile_loop(inputargs, operations, looptoken)
-    cpu.execute_token(looptoken, 17, -20, -6, 6, 1, 13, 13, 9, 49, 8)
-    assert cpu.get_latest_value_int(0) == 0
-    assert cpu.get_latest_value_int(1) == 8
-    assert cpu.get_latest_value_int(2) == 1
-    assert cpu.get_latest_value_int(3) == 131072
-    assert cpu.get_latest_value_int(4) == 20
-    assert cpu.get_latest_value_int(5) == -1
-    assert cpu.get_latest_value_int(6) == 0
-    assert cpu.get_latest_value_int(7) == -19
-    assert cpu.get_latest_value_int(8) == 6
-    assert cpu.get_latest_value_int(9) == 26
-    assert cpu.get_latest_value_int(10) == 12
-    assert cpu.get_latest_value_int(11) == 0
-    assert cpu.get_latest_value_int(12) == 0
-    assert cpu.get_latest_value_int(13) == 2
-    assert cpu.get_latest_value_int(14) == 2
-    assert cpu.get_latest_value_int(15) == 1
-    assert cpu.get_latest_value_int(16) == -57344
-    assert cpu.get_latest_value_int(17) == 1
-    assert cpu.get_latest_value_int(18) == -1
+    deadframe = cpu.execute_token(looptoken, 17, -20, -6, 6, 1,
+                                  13, 13, 9, 49, 8)
+    assert cpu.get_latest_value_int(deadframe, 0) == 0
+    assert cpu.get_latest_value_int(deadframe, 1) == 8
+    assert cpu.get_latest_value_int(deadframe, 2) == 1
+    assert cpu.get_latest_value_int(deadframe, 3) == 131072
+    assert cpu.get_latest_value_int(deadframe, 4) == 20
+    assert cpu.get_latest_value_int(deadframe, 5) == -1
+    assert cpu.get_latest_value_int(deadframe, 6) == 0
+    assert cpu.get_latest_value_int(deadframe, 7) == -19
+    assert cpu.get_latest_value_int(deadframe, 8) == 6
+    assert cpu.get_latest_value_int(deadframe, 9) == 26
+    assert cpu.get_latest_value_int(deadframe, 10) == 12
+    assert cpu.get_latest_value_int(deadframe, 11) == 0
+    assert cpu.get_latest_value_int(deadframe, 12) == 0
+    assert cpu.get_latest_value_int(deadframe, 13) == 2
+    assert cpu.get_latest_value_int(deadframe, 14) == 2
+    assert cpu.get_latest_value_int(deadframe, 15) == 1
+    assert cpu.get_latest_value_int(deadframe, 16) == -57344
+    assert cpu.get_latest_value_int(deadframe, 17) == 1
+    assert cpu.get_latest_value_int(deadframe, 18) == -1
     if WORD == 4:
-        assert cpu.get_latest_value_int(19) == -2147483648
+        assert cpu.get_latest_value_int(deadframe, 19) == -2147483648
     elif WORD == 8:
-        assert cpu.get_latest_value_int(19) == 19327352832
-    assert cpu.get_latest_value_int(20) == -49
+        assert cpu.get_latest_value_int(deadframe, 19) == 19327352832
+    assert cpu.get_latest_value_int(deadframe, 20) == -49