[pypy-commit] pypy default: Tentatively let StackOverflow and MemoryError exit the JIT tracing

arigo noreply at buildbot.pypy.org
Sat Jul 23 18:02:26 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r45900:2413c8ed9933
Date: 2011-07-23 18:02 +0200
http://bitbucket.org/pypy/pypy/changeset/2413c8ed9933/

Log:	Tentatively let StackOverflow and MemoryError exit the JIT tracing
	and be propagated outside.

diff --git a/pypy/jit/metainterp/warmspot.py b/pypy/jit/metainterp/warmspot.py
--- a/pypy/jit/metainterp/warmspot.py
+++ b/pypy/jit/metainterp/warmspot.py
@@ -10,6 +10,7 @@
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.rlib.unroll import unrolling_iterable
 from pypy.rlib.debug import fatalerror
+from pypy.rlib.rstackovf import StackOverflow
 from pypy.translator.simplify import get_functype
 from pypy.translator.unsimplify import call_final_function
 
@@ -408,6 +409,15 @@
         jd.warmstate = state
 
         def crash_in_jit(e):
+            try:
+                raise e
+            except JitException:
+                raise     # go through
+            except MemoryError:
+                raise     # go through
+            except StackOverflow:
+                raise     # go through
+            except Exception, e:
             if not we_are_translated():
                 print "~~~ Crash in JIT!"
                 print '~~~ %s: %s' % (e.__class__, e)
@@ -421,8 +431,6 @@
             def maybe_enter_jit(*args):
                 try:
                     maybe_compile_and_run(state.increment_threshold, *args)
-                except JitException:
-                    raise     # go through
                 except Exception, e:
                     crash_in_jit(e)
             maybe_enter_jit._always_inline_ = True


More information about the pypy-commit mailing list