[pypy-commit] pypy jit-simplify-backendintf: Fix test_random.

arigo noreply at buildbot.pypy.org
Mon Dec 12 11:53:08 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: jit-simplify-backendintf
Changeset: r50421:ee8cf5779f0c
Date: 2011-12-12 11:43 +0100
http://bitbucket.org/pypy/pypy/changeset/ee8cf5779f0c/

Log:	Fix test_random.

diff --git a/pypy/jit/backend/llgraph/llimpl.py b/pypy/jit/backend/llgraph/llimpl.py
--- a/pypy/jit/backend/llgraph/llimpl.py
+++ b/pypy/jit/backend/llgraph/llimpl.py
@@ -414,7 +414,8 @@
     op.jump_target_opindex = target_opindex
     op.jump_target_inputargs = target_inputargs
     assert op.opnum == rop.JUMP
-    assert len(op.args) == len(target_inputargs)
+    assert [v.concretetype for v in op.args] == (
+           [v.concretetype for v in target_inputargs])
     #
     if loop_target == loop:
         log.info("compiling new loop")
diff --git a/pypy/jit/backend/test/test_random.py b/pypy/jit/backend/test/test_random.py
--- a/pypy/jit/backend/test/test_random.py
+++ b/pypy/jit/backend/test/test_random.py
@@ -617,8 +617,13 @@
             return self.loop._jitcelltoken
         if not hasattr(self, '_initialjumploop_celltoken'):
             self._initialjumploop_celltoken = JitCellToken()
-            self.cpu.compile_loop(self.startvars[:],
-                                  [ResOperation(rop.JUMP, self.startvars[:], None,
+            args = []
+            for box in self.startvars:
+                if box not in self.loop.inputargs:
+                    box = box.constbox()
+                args.append(box)
+            self.cpu.compile_loop(self.loop.inputargs,
+                                  [ResOperation(rop.JUMP, args, None,
                                                 descr=self.loop._targettoken)],
                                   self._initialjumploop_celltoken)
         return self._initialjumploop_celltoken
@@ -650,7 +655,7 @@
         exc = cpu.grab_exc_value()
         assert not exc
 
-        arguments = [box.value for box in self.startvars]
+        arguments = [box.value for box in self.loop.inputargs]
         fail = cpu.execute_token(self.runjitcelltoken(), *arguments)
         assert fail is self.should_fail_by.getdescr()
         for i, v in enumerate(self.get_fail_args()):
@@ -716,7 +721,7 @@
             # New restriction: must have the same argument count and types
             # as the original loop
             subset = []
-            for box in self.startvars:
+            for box in self.loop.inputargs:
                 srcbox = r.choice(fail_args)
                 if srcbox.type != box.type:
                     if box.type == INT:


More information about the pypy-commit mailing list