[pypy-commit] pypy default: Issue #1817: missing support for virtual_refs pointing to several different types in the same RPython program
arigo
noreply at buildbot.pypy.org
Thu Jul 24 14:12:15 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r72480:35fdf446e439
Date: 2014-07-24 14:11 +0200
http://bitbucket.org/pypy/pypy/changeset/35fdf446e439/
Log: Issue #1817: missing support for virtual_refs pointing to several
different types in the same RPython program
diff --git a/rpython/jit/metainterp/test/test_virtualref.py b/rpython/jit/metainterp/test/test_virtualref.py
--- a/rpython/jit/metainterp/test/test_virtualref.py
+++ b/rpython/jit/metainterp/test/test_virtualref.py
@@ -34,7 +34,7 @@
#
def check_call(op, fname):
assert op.opname == 'direct_call'
- assert op.args[0].value._obj._name == fname
+ assert op.args[0].value._obj._name.startswith(fname)
#
ops = [op for block, op in graph.iterblockops()]
check_call(ops[-3], 'virtual_ref')
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -340,6 +340,7 @@
# ____________________________________________________________
# VRefs
+ at specialize.argtype(0)
def virtual_ref(x):
"""Creates a 'vref' object that contains a reference to 'x'. Calls
to virtual_ref/virtual_ref_finish must be properly nested. The idea
@@ -351,6 +352,7 @@
return DirectJitVRef(x)
virtual_ref.oopspec = 'virtual_ref(x)'
+ at specialize.argtype(1)
def virtual_ref_finish(vref, x):
"""See docstring in virtual_ref(x)"""
keepalive_until_here(x) # otherwise the whole function call is removed
More information about the pypy-commit
mailing list