[pypy-svn] r77746 - in pypy/branch/jit-unroll-loops/pypy/jit/metainterp: optimizeopt test

hakanardo at codespeak.net hakanardo at codespeak.net
Sat Oct 9 17:12:41 CEST 2010


Author: hakanardo
Date: Sat Oct  9 17:12:39 2010
New Revision: 77746

Modified:
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/optimizeopt/unroll.py
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_basic.py
Log:
arguments of jump fixed

Modified: pypy/branch/jit-unroll-loops/pypy/jit/metainterp/optimizeopt/unroll.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/jit/metainterp/optimizeopt/unroll.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/jit/metainterp/optimizeopt/unroll.py	Sat Oct  9 17:12:39 2010
@@ -20,7 +20,8 @@
             loop.preamble.operations = self.optimizer.newoperations
             self.optimizer.newoperations = []
             jump_args = op.getarglist()
-            inputargs = self.inline(loop.operations,
+            op.initarglist([])
+            inputargs = self.inline(loop.preamble.operations + [op],
                                     loop.inputargs, jump_args)
             loop.inputargs = inputargs
             jmp = ResOperation(rop.JUMP, loop.inputargs[:], None)
@@ -59,7 +60,8 @@
 
             if newop.getopnum() == rop.JUMP:
                 args = []
-                for arg in newop.getarglist():
+                #for arg in newop.getarglist():
+                for arg in [argmap[a] for a in inputargs]:
                     args.extend(self.getvalue(arg).get_forced_boxes())
                 newop.initarglist(args + inputargs[len(args):])
 

Modified: pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_basic.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_basic.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_basic.py	Sat Oct  9 17:12:39 2010
@@ -595,7 +595,7 @@
         res = self.meta_interp(f, [21, 5])
         assert res == -1
         # the CALL_PURE is constant-folded away by optimizeopt.py
-        self.check_loops(int_sub=1, call=0, call_pure=0, getfield_gc=1)
+        self.check_loops(int_sub=1, call=0, call_pure=0, getfield_gc=0)
 
     def test_constant_across_mp(self):
         myjitdriver = JitDriver(greens = [], reds = ['n'])
@@ -968,10 +968,9 @@
         self.meta_interp(f, [20], repeat=7)
         self.check_tree_loop_count(2)      # the loop and the entry path
         # we get:
-        #    ENTER             - compile the new loop
-        #    ENTER             - compile the entry bridge
+        #    ENTER             - compile the new loop and the entry bridge
         #    ENTER             - compile the leaving path
-        self.check_enter_count(3)
+        self.check_enter_count(2)
 
     def test_bridge_from_interpreter_2(self):
         # one case for backend - computing of framesize on guard failure



More information about the Pypy-commit mailing list