Commits

Armin Rigo committed a328d63

Fix

  • Participants
  • Parent commits 7cc2d16
  • Branches remove-globals-in-jit

Comments (0)

Files changed (2)

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 = PropagateExceptionDescr()
+    faildescr = propagate_exception_descr
     operations = [
         ResOperation(rop.CALL, callargs, result, descr=jd.portal_calldescr),
         ResOperation(rop.GUARD_NO_EXCEPTION, [], None, descr=faildescr),

File pypy/jit/metainterp/test/test_compile.py

     from pypy.rpython.annlowlevel import llhelper
     from pypy.rpython.llinterp import LLException
     #
-    cpu = runner.LLtypeCPU(None)
+    cpu = runner.LLGraphCPU(None)
     FUNC = lltype.FuncType([lltype.Signed]*4, lltype.Signed)
     def ll_portal_runner(g1, g2, r3, r4):
         assert (g1, g2, r3, r4) == (12, 34, -156, -178)
     #
     raiseme = None
     # only two arguments must be passed in
-    fail_descr = cpu.execute_token(loop_token, -156, -178)
+    deadframe = cpu.execute_token(loop_token, -156, -178)
+    fail_descr = cpu.get_latest_descr(deadframe)
     assert fail_descr is FakeJitDriverSD().portal_finishtoken
     #
     EXC = lltype.GcStruct('EXC')
     llexc = lltype.malloc(EXC)
     raiseme = LLException("exception class", llexc)
-    fail_descr = cpu.execute_token(loop_token, -156, -178)
+    deadframe = cpu.execute_token(loop_token, -156, -178)
+    fail_descr = cpu.get_latest_descr(deadframe)
     assert isinstance(fail_descr, compile.PropagateExceptionDescr)
-    got = cpu.grab_exc_value()
+    got = cpu.grab_exc_value(deadframe)
     assert lltype.cast_opaque_ptr(lltype.Ptr(EXC), got) == llexc
     #
     class FakeMetaInterpSD:
         class ExitFrameWithExceptionRef(Exception):
             pass
     FakeMetaInterpSD.cpu = cpu
-    fail_descr = cpu.execute_token(loop_token, -156, -178)
+    deadframe = cpu.execute_token(loop_token, -156, -178)
+    fail_descr = cpu.get_latest_descr(deadframe)
     try:
-        fail_descr.handle_fail(FakeMetaInterpSD(), None)
+        fail_descr.handle_fail(deadframe, FakeMetaInterpSD(), None)
     except FakeMetaInterpSD.ExitFrameWithExceptionRef, e:
         assert lltype.cast_opaque_ptr(lltype.Ptr(EXC), e.args[1]) == llexc
     else: