Commits

Armin Rigo  committed b4a06c2

Restore this fact: PropagateExceptionDescr() should only be
instantiated once. It's now cached in the JitDriverSD's
instead of globally.

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

Comments (0)

Files changed (4)

File pypy/jit/metainterp/compile.py

         finishargs = []
     #
     jd = jitdriver_sd
-    faildescr = PropagateExceptionDescr()
+    faildescr = jitdriver_sd.propagate_exc_descr
     operations = [
         ResOperation(rop.CALL, callargs, result, descr=jd.portal_calldescr),
         ResOperation(rop.GUARD_NO_EXCEPTION, [], None, descr=faildescr),

File pypy/jit/metainterp/jitdriver.py

     #    self.handle_jitexc_from_bh pypy.jit.metainterp.warmspot
     #    self.no_loop_header    ... pypy.jit.metainterp.warmspot
     #    self.portal_finishtoken... pypy.jit.metainterp.pyjitpl
+    #    self.propagate_exc_descr.. pypy.jit.metainterp.pyjitpl
     #    self.index             ... pypy.jit.codewriter.call
     #    self.mainjitcode       ... pypy.jit.codewriter.call
 

File pypy/jit/metainterp/pyjitpl.py

         #
         # store this information for fastpath of call_assembler
         # (only the paths that can actually be taken)
+        exc_descr = compile.PropagateExceptionDescr()
         for jd in self.jitdrivers_sd:
             name = {history.INT: 'int',
                     history.REF: 'ref',
             jd.portal_finishtoken = tokens[0].finishdescr
             num = self.cpu.get_fail_descr_number(tokens[0].finishdescr)
             setattr(self.cpu, 'done_with_this_frame_%s_v' % name, num)
+            jd.propagate_exc_descr = exc_descr
         #
-        exc_descr = compile.PropagateExceptionDescr()
         num = self.cpu.get_fail_descr_number(exc_descr)
         self.cpu.propagate_exception_v = num
         #

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

         portal_runner_adr = llmemory.cast_ptr_to_adr(portal_runner_ptr)
         portal_calldescr = cpu.calldescrof(FUNC, FUNC.ARGS, FUNC.RESULT, None)
         portal_finishtoken = compile.DoneWithThisFrameDescrInt()
+        propagate_exc_descr = compile.PropagateExceptionDescr()
         num_red_args = 2
         result_type = INT
     #