[pypy-commit] pypy remove-globals-in-jit: Restore this fact: PropagateExceptionDescr() should only be

arigo noreply at buildbot.pypy.org
Sat Jan 5 17:30:05 CET 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: remove-globals-in-jit
Changeset: r59736:b4a06c2187c9
Date: 2013-01-05 17:29 +0100
http://bitbucket.org/pypy/pypy/changeset/b4a06c2187c9/

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

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
@@ -895,7 +895,7 @@
         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),
diff --git a/pypy/jit/metainterp/jitdriver.py b/pypy/jit/metainterp/jitdriver.py
--- a/pypy/jit/metainterp/jitdriver.py
+++ b/pypy/jit/metainterp/jitdriver.py
@@ -19,6 +19,7 @@
     #    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
 
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
@@ -1463,6 +1463,7 @@
         #
         # 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',
@@ -1472,8 +1473,8 @@
             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
         #
diff --git a/pypy/jit/metainterp/test/test_compile.py b/pypy/jit/metainterp/test/test_compile.py
--- a/pypy/jit/metainterp/test/test_compile.py
+++ b/pypy/jit/metainterp/test/test_compile.py
@@ -166,6 +166,7 @@
         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
     #


More information about the pypy-commit mailing list