[pypy-commit] pypy unroll-if-const: pass also funcbox

fijal noreply at buildbot.pypy.org
Mon Jul 25 18:49:20 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: unroll-if-const
Changeset: r45972:26e58f6d6065
Date: 2011-07-25 18:44 +0200
http://bitbucket.org/pypy/pypy/changeset/26e58f6d6065/

Log:	pass also funcbox

diff --git a/pypy/jit/codewriter/jtransform.py b/pypy/jit/codewriter/jtransform.py
--- a/pypy/jit/codewriter/jtransform.py
+++ b/pypy/jit/codewriter/jtransform.py
@@ -347,7 +347,8 @@
                                                called_from=self.graph)
         no = targetgraph.func._jit_unroll_if_const_[0]
         c_no = Constant(no, lltype.Signed)
-        op0 = self.rewrite_call(op, 'inline_ifconst_call', [jitcode, c_no])
+        op0 = self.rewrite_call(op, 'inline_ifconst_call', [jitcode, c_no,
+                                                            op.args[0]])
         op1 = SpaceOperation('-live-', [], None)
         return [op0, op1]
 
diff --git a/pypy/jit/codewriter/test/test_jtransform.py b/pypy/jit/codewriter/test/test_jtransform.py
--- a/pypy/jit/codewriter/test/test_jtransform.py
+++ b/pypy/jit/codewriter/test/test_jtransform.py
@@ -331,7 +331,8 @@
     assert op0.opname == 'inline_ifconst_call_%s_%s' % (expectedkind, reskind)
     assert op0.args[0] == 'somejitcode'
     assert op0.args[1].value == 0
-    assert len(op0.args) == 2 + len(expectedkind)
+    assert op0.args[2] == op.args[0]
+    assert len(op0.args) == 3 + len(expectedkind)
 
 def direct_call_test(argtypes, restype, expectedkind):
     op = get_direct_call_op(argtypes, restype)


More information about the pypy-commit mailing list