[pypy-commit] pypy unroll-if-const: call support
fijal
noreply at buildbot.pypy.org
Mon Jul 25 17:55:40 CEST 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: unroll-if-const
Changeset: r45966:4340dbad8abe
Date: 2011-07-25 17:30 +0200
http://bitbucket.org/pypy/pypy/changeset/4340dbad8abe/
Log: call support
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
@@ -139,7 +139,7 @@
return 'builtin'
if (hasattr(targetgraph, 'func') and
hasattr(targetgraph.func, '_jit_unroll_if_const_')):
- return 'regularifconst'
+ return 'regular_ifconst'
elif op.opname == 'oosend':
SELFTYPE, methname, opargs = support.decompose_oosend(op)
if SELFTYPE.oopspec_name is not None:
diff --git a/pypy/jit/codewriter/test/test_call.py b/pypy/jit/codewriter/test/test_call.py
--- a/pypy/jit/codewriter/test/test_call.py
+++ b/pypy/jit/codewriter/test/test_call.py
@@ -144,6 +144,17 @@
assert res is None
assert cc.guess_call_kind(op) == 'residual'
+ class funcptr:
+ class graph:
+ class func:
+ _jit_unroll_if_const_ = (0,)
+
+ op = SpaceOperation('direct_call', [Constant(funcptr), Variable()],
+ Variable())
+ res = cc.graphs_from(op)
+ assert res is None
+ assert cc.guess_call_kind(op) == 'regular_ifconst'
+
# ____________________________________________________________
def test_get_jitcode():
@@ -191,4 +202,4 @@
[block, _] = list(f_graph.iterblocks())
[op] = block.operations
call_descr = cc.getcalldescr(op)
- assert call_descr.extrainfo.can_release_gil
\ No newline at end of file
+ assert call_descr.extrainfo.can_release_gil
More information about the pypy-commit
mailing list