Author: Armin Rigo <[email protected]>
Branch: remove-globals-in-jit
Changeset: r58890:9b081186d924
Date: 2012-11-14 15:57 +0100
http://bitbucket.org/pypy/pypy/changeset/9b081186d924/

Log:    Finish test_llgraph.

diff --git a/pypy/jit/backend/llgraph/runner.py 
b/pypy/jit/backend/llgraph/runner.py
--- a/pypy/jit/backend/llgraph/runner.py
+++ b/pypy/jit/backend/llgraph/runner.py
@@ -266,8 +266,11 @@
         assert frame.forced_deadframe is None
         values = []
         for box in frame.force_guard_op.getfailargs():
-            if box is not None and box is not frame.current_op.result:
-                value = frame.env[box]
+            if box is not None:
+                if box is not frame.current_op.result:
+                    value = frame.env[box]
+                else:
+                    value = box.value    # 0 or 0.0 or NULL
             else:
                 value = None
             values.append(value)
diff --git a/pypy/jit/backend/test/runner_test.py 
b/pypy/jit/backend/test/runner_test.py
--- a/pypy/jit/backend/test/runner_test.py
+++ b/pypy/jit/backend/test/runner_test.py
@@ -3421,12 +3421,12 @@
         res = self.cpu.get_latest_value_int(deadframe, 0)
         assert res == 10
 
-        inputargs = [i0]
-        operations = [
+        inputargs2 = [i0]
+        operations2 = [
             ResOperation(rop.INT_SUB, [i0, ConstInt(20)], i2),
             ResOperation(rop.JUMP, [i2], None, descr=targettoken2),
             ]
-        self.cpu.compile_bridge(faildescr, inputargs, operations, looptoken)
+        self.cpu.compile_bridge(faildescr, inputargs2, operations2, looptoken)
 
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
@@ -3540,7 +3540,7 @@
         i15 = BoxInt(); i16 = BoxInt(); i17 = BoxInt(); i18 = BoxInt(); i19 = 
BoxInt()
         i20 = BoxInt()
         inputargs = [i0]
-        operations = [
+        operations2 = [
             ResOperation(rop.LABEL, [i0], None, descr=targettoken1),
             ResOperation(rop.INT_ADD, [i0, ConstInt(1)], i1),
             ResOperation(rop.INT_ADD, [i1, ConstInt(1)], i2),
@@ -3569,15 +3569,15 @@
             ResOperation(rop.GUARD_TRUE, [i20], None, 
descr=BasicFailDescr(42)),
             ResOperation(rop.JUMP, [i19], None, descr=targettoken1),
             ]
-        operations[-2].setfailargs([])
-        self.cpu.compile_bridge(faildescr1, inputargs, operations, looptoken1)
+        operations2[-2].setfailargs([])
+        self.cpu.compile_bridge(faildescr1, inputargs, operations2, looptoken1)
 
         looptoken2 = JitCellToken()
         inputargs = [BoxInt()]
-        operations = [
+        operations3 = [
             ResOperation(rop.JUMP, [ConstInt(0)], None, descr=targettoken1),
             ]
-        self.cpu.compile_loop(inputargs, operations, looptoken2)
+        self.cpu.compile_loop(inputargs, operations3, looptoken2)
 
         deadframe = self.cpu.execute_token(looptoken2, -9)
         fail = self.cpu.get_latest_descr(deadframe)
@@ -3710,7 +3710,6 @@
         def maybe_force(token, flag):
             deadframe = self.cpu.force(token)
             values.append(self.cpu.get_latest_value_int(deadframe, 0))
-            values.append(token)
             return 42
 
         FUNC = self.FuncType([lltype.Signed, lltype.Signed], lltype.Signed)
@@ -3740,5 +3739,3 @@
         # make sure that force reads the registers from a zeroed piece of
         # memory
         assert values[0] == 0
-        token = self.cpu.get_latest_force_token()
-        assert values[1] == token
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to