Author: Armin Rigo <[email protected]>
Branch: continulet-jit-3
Changeset: r57655:7a66bc41f018
Date: 2012-09-29 06:31 +0200
http://bitbucket.org/pypy/pypy/changeset/7a66bc41f018/

Log:    Finish to fix the jit front-end.

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
@@ -1387,7 +1387,8 @@
             assert kind == 'v'
         return lltype.nullptr(rclass.OBJECTPTR.TO)
 
-    def _prepare_resume_from_failure(self, opnum, dont_change_position=False):
+    def _prepare_resume_from_failure(self, opnum, jitframe,
+                                     dont_change_position=False):
         from pypy.jit.metainterp.resoperation import rop
         #
         if opnum == rop.GUARD_TRUE:
@@ -1419,7 +1420,7 @@
               opnum == rop.GUARD_EXCEPTION or
               opnum == rop.GUARD_NOT_FORCED):
             return lltype.cast_opaque_ptr(rclass.OBJECTPTR,
-                                          self.cpu.grab_exc_value())
+                                          self.cpu.grab_exc_value(jitframe))
         #
         elif opnum == rop.GUARD_NO_OVERFLOW:
             # Produced by int_xxx_ovf().  The pc is just after the opcode.
@@ -1562,7 +1563,7 @@
         dont_change_position = False
 
     current_exc = blackholeinterp._prepare_resume_from_failure(
-        resumedescr.guard_opnum, dont_change_position)
+        resumedescr.guard_opnum, jitframe, dont_change_position)
 
     #try:
     _run_forever(blackholeinterp, current_exc)
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
@@ -653,16 +653,16 @@
         # the virtualrefs and virtualizable have been forced by
         # handle_async_forcing() just a moment ago.
         from pypy.jit.metainterp.blackhole import resume_in_blackhole
-        token = metainterp_sd.cpu.get_latest_force_token()
-        all_virtuals = self.fetch_data(token)
+        all_virtuals = self.fetch_data(jitframe)
         if all_virtuals is None:
             all_virtuals = []
         assert jitdriver_sd is self.jitdriver_sd
-        resume_in_blackhole(metainterp_sd, jitdriver_sd, self, all_virtuals)
+        resume_in_blackhole(metainterp_sd, jitdriver_sd, jitframe, self,
+                            all_virtuals)
         assert 0, "unreachable"
 
     @staticmethod
-    def force_now(cpu, token):
+    def force_now(cpu, jitframetoken):
         # Called during a residual call from the assembler, if the code
         # actually needs to force one of the virtualrefs or the virtualizable.
         # Implemented by forcing *all* virtualrefs and the virtualizable.
@@ -672,22 +672,23 @@
         # an inconsistent state
         rstack._stack_criticalcode_start()
         try:
-            faildescr = cpu.force(token)
+            faildescr = cpu.force(jitframetoken)
             assert isinstance(faildescr, ResumeGuardForcedDescr)
-            faildescr.handle_async_forcing(token)
+            faildescr.handle_async_forcing(jitframetoken)
         finally:
             rstack._stack_criticalcode_stop()
 
-    def handle_async_forcing(self, force_token):
+    def handle_async_forcing(self, jitframe):
         from pypy.jit.metainterp.resume import force_from_resumedata
         metainterp_sd = self.metainterp_sd
         vinfo = self.jitdriver_sd.virtualizable_info
         ginfo = self.jitdriver_sd.greenfield_info
-        all_virtuals = force_from_resumedata(metainterp_sd, self, vinfo, ginfo)
+        all_virtuals = force_from_resumedata(metainterp_sd, jitframe, self,
+                                             vinfo, ginfo)
         # The virtualizable data was stored on the real virtualizable above.
         # Handle all_virtuals: keep them for later blackholing from the
         # future failure of the GUARD_NOT_FORCED
-        self.save_data(force_token, all_virtuals)
+        self.save_data(jitframe, all_virtuals)
 
     def save_data(self, key, value):
         globaldata = self.metainterp_sd.globaldata
diff --git a/pypy/jit/metainterp/resume.py b/pypy/jit/metainterp/resume.py
--- a/pypy/jit/metainterp/resume.py
+++ b/pypy/jit/metainterp/resume.py
@@ -1044,8 +1044,8 @@
             break
     return firstbh
 
-def force_from_resumedata(metainterp_sd, storage, vinfo, ginfo):
-    resumereader = ResumeDataDirectReader(metainterp_sd, storage)
+def force_from_resumedata(metainterp_sd, jitframe, storage, vinfo, ginfo):
+    resumereader = ResumeDataDirectReader(metainterp_sd, jitframe, storage)
     resumereader.handling_async_forcing()
     vrefinfo = metainterp_sd.virtualref_info
     resumereader.consume_vref_and_vable(vrefinfo, vinfo, ginfo)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to