Author: Antonio Cuni <[email protected]>
Branch: invalidate-virtualrefs
Changeset: r44507:6b786e71c765
Date: 2011-05-26 13:29 +0200
http://bitbucket.org/pypy/pypy/changeset/6b786e71c765/

Log:    (antocuni, arigo around) backout 8b6429ceffa8: we don't really need
        the jit_invalidate_vref_maybe op, we will use another approach

diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -195,11 +195,9 @@
 
 def virtual_ref_finish(vref, x):
     """See docstring in virtual_ref(x)"""
+    keepalive_until_here(x)   # otherwise the whole function call is removed
     _virtual_ref_finish(vref, x)
-
-def ll_virtual_ref_finish(x):
-    keepalive_until_here(x)   # otherwise the whole function call is removed
-ll_virtual_ref_finish.oopspec = 'virtual_ref_finish(x)'
+virtual_ref_finish.oopspec = 'virtual_ref_finish(x)'
 
 def non_virtual_ref(x):
     """Creates a 'vref' that just returns x when called; nothing more special.
@@ -259,16 +257,13 @@
         return _jit_vref.SomeVRef(s_obj)
 
 class Entry(ExtRegistryEntry):
-    _about_ = virtual_ref_finish
+    _about_ = _virtual_ref_finish
 
     def compute_result_annotation(self, s_vref, s_obj):
         pass
 
     def specialize_call(self, hop):
-        v_vref, v_obj = hop.inputargs(*hop.args_r)
-        hop.genop('jit_invalidate_vref_maybe', [v_vref])
-        hop.gendirectcall(ll_virtual_ref_finish, v_obj)
-
+        pass
     
 vref_None = non_virtual_ref(None)
 
diff --git a/pypy/rlib/test/test__jit_vref.py b/pypy/rlib/test/test__jit_vref.py
--- a/pypy/rlib/test/test__jit_vref.py
+++ b/pypy/rlib/test/test__jit_vref.py
@@ -135,18 +135,6 @@
         x = self.interpret(f, [])
         assert x == 42
 
-    def test_rtype_vref_finish(self):
-        from pypy.jit.codewriter.support import decode_builtin_call
-        def f():
-            x1 = X()
-            vref = virtual_ref(x1)
-            virtual_ref_finish(vref, x1)
-            return x1
-        _, _, graph = self.gengraph(f, [])
-        ops = [op for block, op in graph.iterblockops()]
-        assert ops[-2].opname == 'jit_invalidate_vref_maybe'
-        oopspec_name, _ = decode_builtin_call(ops[-1])
-        assert oopspec_name == 'virtual_ref_finish'
 
 class TestLLtype(BaseTestVRef, LLRtypeMixin):
     OBJECTTYPE = OBJECTPTR
diff --git a/pypy/rpython/lltypesystem/lloperation.py 
b/pypy/rpython/lltypesystem/lloperation.py
--- a/pypy/rpython/lltypesystem/lloperation.py
+++ b/pypy/rpython/lltypesystem/lloperation.py
@@ -434,7 +434,6 @@
     'jit_force_virtualizable':LLOp(canrun=True),
     'jit_force_virtual':    LLOp(canrun=True),
     'jit_force_quasi_immutable': LLOp(canrun=True),
-    'jit_invalidate_vref_maybe': LLOp(canrun=True),
     'get_exception_addr':   LLOp(),
     'get_exc_value_addr':   LLOp(),
     'do_malloc_fixedsize_clear':LLOp(canraise=(MemoryError,),canunwindgc=True),
diff --git a/pypy/rpython/lltypesystem/opimpl.py 
b/pypy/rpython/lltypesystem/opimpl.py
--- a/pypy/rpython/lltypesystem/opimpl.py
+++ b/pypy/rpython/lltypesystem/opimpl.py
@@ -534,9 +534,6 @@
 def op_jit_force_quasi_immutable(*args):
     pass
 
-def op_jit_invalidate_vref_maybe(*args):
-    pass
-
 def op_get_group_member(TYPE, grpptr, memberoffset):
     from pypy.rpython.lltypesystem import llgroup
     assert isinstance(memberoffset, llgroup.GroupMemberOffset)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to