Commits

Armin Rigo committed 6f6aaf8

Pff pff pff. Test (in model.py) and fix for running all of
x86/test/test_ztranslation.py in the same test session.

  • Participants
  • Parent commits a4cc624
  • Branches remove-globals-in-jit

Comments (0)

Files changed (3)

File pypy/jit/backend/model.py

 from pypy.rlib.debug import debug_start, debug_print, debug_stop
+from pypy.rlib.objectmodel import we_are_translated
 from pypy.jit.metainterp import history
 from pypy.rpython.lltypesystem import lltype
 
 
     def get_fail_descr_number(self, descr):
         assert isinstance(descr, history.AbstractFailDescr)
+        if not we_are_translated():
+            if not hasattr(descr, '_cpu'):
+                assert descr.index == -1, "descr.index is already >= 0??"
+                descr._cpu = self
+            assert descr._cpu is self,"another CPU has already seen the descr!"
+        #
         n = descr.index
         if n < 0:
             n = self.reserve_some_free_fail_descr_number()

File pypy/jit/metainterp/compile.py

         assert exception, "PropagateExceptionDescr: no exception??"
         raise metainterp_sd.ExitFrameWithExceptionRef(cpu, exception)
 
-propagate_exception_descr = PropagateExceptionDescr()
-
 def compile_tmp_callback(cpu, jitdriver_sd, greenboxes, redargtypes,
                          memory_manager=None):
     """Make a LoopToken that corresponds to assembler code that just
         finishargs = []
     #
     jd = jitdriver_sd
-    faildescr = propagate_exception_descr
+    faildescr = PropagateExceptionDescr()
     operations = [
         ResOperation(rop.CALL, callargs, result, descr=jd.portal_calldescr),
         ResOperation(rop.GUARD_NO_EXCEPTION, [], None, descr=faildescr),

File pypy/jit/metainterp/pyjitpl.py

             num = self.cpu.get_fail_descr_number(tokens[0].finishdescr)
             setattr(self.cpu, 'done_with_this_frame_%s_v' % name, num)
         #
-        exc_descr = compile.propagate_exception_descr
+        exc_descr = compile.PropagateExceptionDescr()
         num = self.cpu.get_fail_descr_number(exc_descr)
         self.cpu.propagate_exception_v = num
         #