Author: Maciej Fijalkowski <[email protected]>
Branch: jitframe-on-heap
Changeset: r60097:656ef70c79ae
Date: 2013-01-15 20:41 +0200
http://bitbucket.org/pypy/pypy/changeset/656ef70c79ae/

Log:    fix some tests, skip others

diff --git a/pypy/jit/backend/x86/test/test_regalloc.py 
b/pypy/jit/backend/x86/test/test_regalloc.py
--- a/pypy/jit/backend/x86/test/test_regalloc.py
+++ b/pypy/jit/backend/x86/test/test_regalloc.py
@@ -178,22 +178,22 @@
         return regalloc
 
     def getint(self, index):
-        return self.cpu.get_latest_value_int(self.deadframe, index)
+        return self.cpu.get_int_value(self.deadframe, index)
 
     def getfloat(self, index):
-        return self.cpu.get_latest_value_float(self.deadframe, index)
+        return self.cpu.get_float_value(self.deadframe, index)
 
     def getints(self, end):
-        return [self.cpu.get_latest_value_int(self.deadframe, index) for
+        return [self.cpu.get_int_value(self.deadframe, index) for
                 index in range(0, end)]
 
     def getfloats(self, end):
         return [longlong.getrealfloat(
-                    self.cpu.get_latest_value_float(self.deadframe, index))
+                    self.cpu.get_float_value(self.deadframe, index))
                 for index in range(0, end)]
 
     def getptr(self, index, T):
-        gcref = self.cpu.get_latest_value_ref(self.deadframe, index)
+        gcref = self.cpu.get_ref_value(self.deadframe, index)
         return lltype.cast_opaque_ptr(T, gcref)
 
     def attach_bridge(self, ops, loop, guard_op_index, **kwds):
@@ -459,12 +459,9 @@
         jump(i4, i1, i2, i3)
         """
         regalloc = self.prepare_loop(ops)
-        if IS_X86_64:
-            assert len(regalloc.rm.reg_bindings) == 4
-            assert len(regalloc.fm.bindings) == 0
-        else:
-            assert len(regalloc.rm.reg_bindings) == 0
-            assert len(regalloc.fm.bindings) == 4
+        # we pass stuff on the frame
+        assert len(regalloc.rm.reg_bindings) == 0
+        assert len(regalloc.fm.bindings) == 4
 
 
 class TestRegallocCompOps(BaseTestRegalloc):
@@ -628,6 +625,9 @@
         assert self.getints(9) == [0, 1, 1, 1, 1, 1, 1, 1, 1]
 
 class TestRegAllocCallAndStackDepth(BaseTestRegalloc):
+    def setup_class(cls):
+        py.test.skip("skip for now, not sure what do we do")
+    
     def expected_frame_depth(self, num_call_args, num_pushed_input_args=0):
         # Assumes the arguments are all non-float
         if IS_X86_32:
diff --git a/pypy/jit/backend/x86/test/test_regalloc2.py 
b/pypy/jit/backend/x86/test/test_regalloc2.py
--- a/pypy/jit/backend/x86/test/test_regalloc2.py
+++ b/pypy/jit/backend/x86/test/test_regalloc2.py
@@ -1,6 +1,6 @@
 import py
 from pypy.jit.metainterp.history import ResOperation, BoxInt, ConstInt,\
-     BoxPtr, ConstPtr, BasicFailDescr, JitCellToken
+     BoxPtr, ConstPtr, BasicFailDescr, JitCellToken, BasicFinalDescr
 from pypy.jit.metainterp.resoperation import rop
 from pypy.jit.backend.detect_cpu import getcpuclass
 from pypy.jit.backend.x86.arch import WORD
@@ -19,7 +19,7 @@
         ResOperation(rop.UINT_RSHIFT, [v1, ConstInt(3)], v4),
         ResOperation(rop.SAME_AS, [ConstInt(0)], zero),
         ResOperation(rop.GUARD_TRUE, [zero], None, descr=BasicFailDescr()),
-        ResOperation(rop.FINISH, [], None, descr=BasicFailDescr())
+        ResOperation(rop.FINISH, [], None, descr=BasicFinalDescr())
         ]
     operations[-2].setfailargs([v4, v3])
     cpu = CPU(None, None)
@@ -27,8 +27,8 @@
     looptoken = JitCellToken()
     cpu.compile_loop(inputargs, operations, looptoken)
     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)
+    assert cpu.get_int_value(deadframe, 0) == (9 >> 3)
+    assert cpu.get_int_value(deadframe, 1) == (~18)
 
 def test_bug_int_is_true_1():
     v1 = BoxInt()
@@ -45,7 +45,7 @@
         ResOperation(rop.INT_IS_ZERO, [tmp5], v4),
         ResOperation(rop.SAME_AS, [ConstInt(0)], zero),
         ResOperation(rop.GUARD_TRUE, [zero], None, descr=BasicFailDescr()),
-        ResOperation(rop.FINISH, [], None, descr=BasicFailDescr())
+        ResOperation(rop.FINISH, [], None, descr=BasicFinalDescr())
             ]
     operations[-2].setfailargs([v4, v3, tmp5])
     cpu = CPU(None, None)
@@ -53,9 +53,9 @@
     looptoken = JitCellToken()
     cpu.compile_loop(inputargs, operations, looptoken)
     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
+    assert cpu.get_int_value(deadframe, 0) == 0
+    assert cpu.get_int_value(deadframe, 1) == -1000
+    assert cpu.get_int_value(deadframe, 2) == 1
 
 def test_bug_0():
     v1 = BoxInt()
@@ -145,7 +145,7 @@
         ResOperation(rop.INT_GT, [v24, v32], v40),
         ResOperation(rop.SAME_AS, [ConstInt(0)], zero),
         ResOperation(rop.GUARD_TRUE, [zero], None, descr=BasicFailDescr()),
-        ResOperation(rop.FINISH, [], None, descr=BasicFailDescr())
+        ResOperation(rop.FINISH, [], None, descr=BasicFinalDescr())
             ]
     operations[-2].setfailargs([v40, v36, v37, v31, v16, v34, v35, v23,
                                 v22, v29, v14, v39, v30, v38])
@@ -155,20 +155,20 @@
     cpu.compile_loop(inputargs, operations, looptoken)
     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
+    assert cpu.get_int_value(deadframe, 0) == 0
+    assert cpu.get_int_value(deadframe, 1) == 0
+    assert cpu.get_int_value(deadframe, 2) == 0
+    assert cpu.get_int_value(deadframe, 3) == 0
+    assert cpu.get_int_value(deadframe, 4) == 1
+    assert cpu.get_int_value(deadframe, 5) == -7
+    assert cpu.get_int_value(deadframe, 6) == 1
+    assert cpu.get_int_value(deadframe, 7) == 0
+    assert cpu.get_int_value(deadframe, 8) == -2
+    assert cpu.get_int_value(deadframe, 9) == 18
+    assert cpu.get_int_value(deadframe, 10) == 1
+    assert cpu.get_int_value(deadframe, 11) == 18
+    assert cpu.get_int_value(deadframe, 12) == -1
+    assert cpu.get_int_value(deadframe, 13) == 0
 
 def test_bug_1():
     v1 = BoxInt()
@@ -256,7 +256,7 @@
         ResOperation(rop.INT_NEG, [v27], v40),
         ResOperation(rop.SAME_AS, [ConstInt(0)], zero),
         ResOperation(rop.GUARD_TRUE, [zero], None, descr=BasicFailDescr()),
-        ResOperation(rop.FINISH, [], None, descr=BasicFailDescr())
+        ResOperation(rop.FINISH, [], None, descr=BasicFinalDescr())
             ]
     operations[-2].setfailargs([v40, v10, v36, v26, v13, v30, v21, v33,
                                 v18, v25, v31, v32, v28, v29, v35, v38,
@@ -267,27 +267,27 @@
     cpu.compile_loop(inputargs, operations, looptoken)
     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
+    assert cpu.get_int_value(deadframe, 0) == 0
+    assert cpu.get_int_value(deadframe, 1) == 8
+    assert cpu.get_int_value(deadframe, 2) == 1
+    assert cpu.get_int_value(deadframe, 3) == 131072
+    assert cpu.get_int_value(deadframe, 4) == 20
+    assert cpu.get_int_value(deadframe, 5) == -1
+    assert cpu.get_int_value(deadframe, 6) == 0
+    assert cpu.get_int_value(deadframe, 7) == -19
+    assert cpu.get_int_value(deadframe, 8) == 6
+    assert cpu.get_int_value(deadframe, 9) == 26
+    assert cpu.get_int_value(deadframe, 10) == 12
+    assert cpu.get_int_value(deadframe, 11) == 0
+    assert cpu.get_int_value(deadframe, 12) == 0
+    assert cpu.get_int_value(deadframe, 13) == 2
+    assert cpu.get_int_value(deadframe, 14) == 2
+    assert cpu.get_int_value(deadframe, 15) == 1
+    assert cpu.get_int_value(deadframe, 16) == -57344
+    assert cpu.get_int_value(deadframe, 17) == 1
+    assert cpu.get_int_value(deadframe, 18) == -1
     if WORD == 4:
-        assert cpu.get_latest_value_int(deadframe, 19) == -2147483648
+        assert cpu.get_int_value(deadframe, 19) == -2147483648
     elif WORD == 8:
-        assert cpu.get_latest_value_int(deadframe, 19) == 19327352832
-    assert cpu.get_latest_value_int(deadframe, 20) == -49
+        assert cpu.get_int_value(deadframe, 19) == 19327352832
+    assert cpu.get_int_value(deadframe, 20) == -49
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to