[pypy-commit] pypy continulet-jit-3: (fijal, arigo)

arigo noreply at buildbot.pypy.org
Sat Oct 13 19:15:15 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: continulet-jit-3
Changeset: r58108:37d03a323870
Date: 2012-10-13 19:12 +0200
http://bitbucket.org/pypy/pypy/changeset/37d03a323870/

Log:	(fijal, arigo)

	Yay, we pass the whole test_virtualizable.

diff --git a/pypy/jit/backend/llgraph/llimpl.py b/pypy/jit/backend/llgraph/llimpl.py
--- a/pypy/jit/backend/llgraph/llimpl.py
+++ b/pypy/jit/backend/llgraph/llimpl.py
@@ -1381,12 +1381,19 @@
             return lltype.cast_opaque_ptr(llmemory.GCREF, result)
         else:
             return lltype.nullptr(llmemory.GCREF.TO)
-    #assert lltype.typeOf(x) == llmemory.GCREF
+    assert lltype.typeOf(x) == llmemory.GCREF
+    frame._finish_value = 'deleted by the previous call to finish_value_ref'
     return x
 
-def set_finish_value_ref(frame, value):
+def get_savedata_ref(frame):
     frame = _from_opaque(frame)
-    frame._finish_value = value
+    x = frame._savedata
+    del frame._savedata
+    return x
+
+def set_savedata_ref(frame, value):
+    frame = _from_opaque(frame)
+    frame._savedata = value
 
 ##_pseudo_exceptions = {}
 
@@ -1947,7 +1954,8 @@
 setannotation(finish_value_int,   annmodel.SomeInteger())
 setannotation(finish_value_float, s_FloatStorage)
 setannotation(finish_value_ref,   annmodel.SomePtr(llmemory.GCREF))
-setannotation(set_finish_value_ref, annmodel.s_None)
+setannotation(get_savedata_ref, annmodel.SomePtr(llmemory.GCREF))
+setannotation(set_savedata_ref, annmodel.s_None)
 setannotation(force, annmodel.SomeInteger())
 
 setannotation(do_arraylen_gc, annmodel.SomeInteger())
diff --git a/pypy/jit/backend/llgraph/runner.py b/pypy/jit/backend/llgraph/runner.py
--- a/pypy/jit/backend/llgraph/runner.py
+++ b/pypy/jit/backend/llgraph/runner.py
@@ -321,10 +321,14 @@
         assert lltype.typeOf(jitframe) == llmemory.GCREF
         return llimpl.finish_value_ref(jitframe)
 
-    def set_finish_value_ref(self, jitframe, value):
+    def get_savedata_ref(self, jitframe):
+        assert lltype.typeOf(jitframe) == llmemory.GCREF
+        return llimpl.get_savedata_ref(jitframe)
+
+    def set_savedata_ref(self, jitframe, value):
         assert lltype.typeOf(jitframe) == llmemory.GCREF
         #assert lltype.typeOf(value) == llmemory.GCREF
-        llimpl.set_finish_value_ref(jitframe, value)
+        llimpl.set_savedata_ref(jitframe, value)
 
     def redirect_call_assembler(self, oldlooptoken, newlooptoken):
         if we_are_translated():
diff --git a/pypy/jit/backend/model.py b/pypy/jit/backend/model.py
--- a/pypy/jit/backend/model.py
+++ b/pypy/jit/backend/model.py
@@ -165,12 +165,18 @@
         """Return and clear the result passed to FINISH, which was a GCREF.
         Also used when it exits due to a failure of a GUARD_EXCEPTION or
         GUARD_NO_EXCEPTION, to return the exception."""
+        xxxx
         return jitframe.jf_finish_ref
 
-    def set_finish_value_ref(self, jitframe, value):
+    def get_savedata_ref(self, jitframe):
+        """Return and clear the last value stored by the frontend with
+        set_savedata_ref."""
+        xxxx
+
+    def set_savedata_ref(self, jitframe, value):
         """Store on the jitframe a random GCREF value that will be returned
-        by the following call to get_finish_value_ref()."""
-        jitframe.jf_finish_ref = value
+        by the following call to get_savedata_ref()."""
+        xxxx
 
     def redirect_call_assembler(self, oldlooptoken, newlooptoken):
         """Redirect oldlooptoken to newlooptoken.  More precisely, it is
diff --git a/pypy/jit/metainterp/blackhole.py b/pypy/jit/metainterp/blackhole.py
--- a/pypy/jit/metainterp/blackhole.py
+++ b/pypy/jit/metainterp/blackhole.py
@@ -1419,7 +1419,7 @@
               opnum == rop.GUARD_EXCEPTION or
               opnum == rop.GUARD_NOT_FORCED):
             return lltype.cast_opaque_ptr(rclass.OBJECTPTR,
-                                          self.cpu.grab_exc_value(jitframe))
+                        self.cpu.get_finish_value_ref(jitframe))
         #
         elif opnum == rop.GUARD_NO_OVERFLOW:
             # Produced by int_xxx_ovf().  The pc is just after the opcode.
diff --git a/pypy/jit/metainterp/compile.py b/pypy/jit/metainterp/compile.py
--- a/pypy/jit/metainterp/compile.py
+++ b/pypy/jit/metainterp/compile.py
@@ -640,10 +640,10 @@
 
     def save_data(self, jitframe, value):
         llvalue = erase_list_virtuals(value)
-        self.metainterp_sd.cpu.set_finish_value_ref(jitframe, llvalue)
+        self.metainterp_sd.cpu.set_savedata_ref(jitframe, llvalue)
 
     def fetch_data(self, jitframe):
-        llvalue = self.metainterp_sd.cpu.get_finish_value_ref(jitframe)
+        llvalue = self.metainterp_sd.cpu.get_savedata_ref(jitframe)
         return unerase_list_virtuals(llvalue)
 
     def _clone_if_mutable(self):
diff --git a/pypy/jit/metainterp/pyjitpl.py b/pypy/jit/metainterp/pyjitpl.py
--- a/pypy/jit/metainterp/pyjitpl.py
+++ b/pypy/jit/metainterp/pyjitpl.py
@@ -2091,7 +2091,7 @@
               opnum == rop.GUARD_NONNULL_CLASS):
             pass        # the pc is already set to the *start* of the opcode
         elif opnum == rop.GUARD_NO_EXCEPTION or opnum == rop.GUARD_EXCEPTION:
-            exception = self.cpu.grab_exc_value(jitframe)
+            exception = self.cpu.get_finish_value_ref(jitframe)
             if exception:
                 self.execute_ll_raised(lltype.cast_opaque_ptr(rclass.OBJECTPTR,
                                                               exception))


More information about the pypy-commit mailing list