[pypy-commit] pypy unroll-if-const: test and a fix

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


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: unroll-if-const
Changeset: r45970:5b8d8a10a0f3
Date: 2011-07-25 18:24 +0200
http://bitbucket.org/pypy/pypy/changeset/5b8d8a10a0f3/

Log:	test and a fix

diff --git a/pypy/jit/codewriter/call.py b/pypy/jit/codewriter/call.py
--- a/pypy/jit/codewriter/call.py
+++ b/pypy/jit/codewriter/call.py
@@ -70,7 +70,7 @@
                     continue
                 kind = self.guess_call_kind(op, is_candidate)
                 # use callers() to view the calling chain in pdb
-                if kind != "regular":
+                if kind != "regular" and kind != 'regular_ifconst':
                     continue
                 for graph in self.graphs_from(op, is_candidate):
                     if graph in candidate_graphs:
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]
         calldescr = self.callcontrol.getcalldescr(op)
-        op0 = self.rewrite_call(op, 'inline_ifconst_call', [jitcode, no,
+        c_no = Constant(no, lltype.Signed)
+        op0 = self.rewrite_call(op, 'inline_ifconst_call', [jitcode, c_no,
                                                             calldescr])
         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
@@ -330,6 +330,8 @@
     reskind = getkind(restype)[0]
     assert op0.opname == 'inline_ifconst_call_%s_%s' % (expectedkind, reskind)
     assert op0.args[0] == 'somejitcode'
+    assert op0.args[1].value == 0
+    assert op0.args[2] == 'calldescr'
 
 def direct_call_test(argtypes, restype, expectedkind):
     op = get_direct_call_op(argtypes, restype)


More information about the pypy-commit mailing list