[pypy-svn] r51267 - in pypy/branch/jit-refactoring/pypy/jit/rainbow: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Feb 4 21:20:51 CET 2008


Author: cfbolz
Date: Mon Feb  4 21:20:50 2008
New Revision: 51267

Modified:
   pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py
   pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py
Log:
another passing test. reminder: always run _all_ tests.


Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py	(original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py	Mon Feb  4 21:20:50 2008
@@ -144,15 +144,16 @@
                 linkfalse, linktrue = linktrue, linkfalse
             color = self.varcolor(block.exitswitch)
             index = self.serialize_oparg(color, block.exitswitch)
-            srcopname, srcargs = self.trace_back_bool_var(
-                block, block.exitswitch)
-            if color == "red" and srcopname is not None:
-                if srcopname == 'ptr_nonzero':
-                    reverse = False
-                    split_extras = srcargs
-                elif srcopname == 'ptr_iszero':
-                    reverse = True
-                    split_extras = srcargs
+            reverse = None
+            if color == "red":
+                srcopname, srcargs = self.trace_back_bool_var(
+                    block, block.exitswitch)
+                if srcopname is not None:
+                    if srcopname == 'ptr_nonzero':
+                        reverse = False
+                    elif srcopname == 'ptr_iszero':
+                        reverse = True
+            if reverse is not None:
                 ptrindex = self.serialize_oparg("red", srcargs[0])
                 self.emit("red_goto_ifptrnonzero")
                 self.emit(reverse)
@@ -433,7 +434,7 @@
             args = targetgraph.getargs()
             emitted_args = self.args_of_call(op.args[1:], args)
             self.emit("red_direct_call")
-            self.emit(emitted_args)
+            self.emit(*emitted_args)
             self.emit(graphindex)
             if kind == "red":
                 self.register_redvar(op.result)
@@ -443,7 +444,7 @@
             args = targetgraph.getargs()
             emitted_args = self.args_of_call(op.args[1:], args)
             self.emit("green_direct_call")
-            self.emit(emitted_args)
+            self.emit(*emitted_args)
             self.emit(pos)
             self.register_greenvar(op.result)
         elif kind == "yellow":
@@ -451,7 +452,7 @@
             args = targetgraph.getargs()
             emitted_args = self.args_of_call(op.args[1:], args)
             self.emit("yellow_direct_call")
-            self.emit(emitted_args)
+            self.emit(*emitted_args)
             self.emit(graphindex)
             self.emit("yellow_after_direct_call")
             self.emit("yellow_retrieve_result")

Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py	(original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py	Mon Feb  4 21:20:50 2008
@@ -820,7 +820,6 @@
         assert res == "3"
 
     def test_red_propagate(self):
-        py.test.skip("arrays and structs are not working")
         S = lltype.GcStruct('S', ('n', lltype.Signed))
         def ll_function(n, k):
             s = lltype.malloc(S)
@@ -828,7 +827,7 @@
             if k < 0:
                 return -123
             return s.n * k
-        res = self.interpret(ll_function, [3, 8], [], policy=P_NOVIRTUAL)
+        res = self.interpret(ll_function, [3, 8], [])
         assert res == 24
         self.check_insns({'int_lt': 1, 'int_mul': 1})
 



More information about the Pypy-commit mailing list