[pypy-commit] pypy better-jit-hooks: be secure against not having any jit_merge_points found
fijal
noreply at buildbot.pypy.org
Wed Jan 11 17:44:21 CET 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: better-jit-hooks
Changeset: r51234:b53f0ac39e01
Date: 2012-01-11 18:43 +0200
http://bitbucket.org/pypy/pypy/changeset/b53f0ac39e01/
Log: be secure against not having any jit_merge_points found
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
@@ -1794,9 +1794,14 @@
self.staticdata.profiler.count(reason)
debug_print('~~~ ABORTING TRACING')
jd_sd = self.jitdriver_sd
- greenkey = self.current_merge_points[0][0][:jd_sd.num_green_args]
- self.staticdata.warmrunnerdesc.hooks.on_abort(reason, jd_sd.jitdriver,
- greenkey, jd_sd.warmstate.get_location_str(greenkey))
+ if not self.current_merge_points:
+ greenkey = None # we're in the bridge
+ else:
+ greenkey = self.current_merge_points[0][0][:jd_sd.num_green_args]
+ self.staticdata.warmrunnerdesc.hooks.on_abort(reason,
+ jd_sd.jitdriver,
+ greenkey,
+ jd_sd.warmstate.get_location_str(greenkey))
self.staticdata.stats.aborted()
def blackhole_if_trace_too_long(self):
diff --git a/pypy/module/pypyjit/interp_resop.py b/pypy/module/pypyjit/interp_resop.py
--- a/pypy/module/pypyjit/interp_resop.py
+++ b/pypy/module/pypyjit/interp_resop.py
@@ -20,6 +20,8 @@
self.w_optimize_hook = space.w_None
def wrap_greenkey(space, jitdriver, greenkey, greenkey_repr):
+ if greenkey is None:
+ return space.wrap('UNKNOWN')
jitdriver_name = jitdriver.name
if jitdriver_name == 'pypyjit':
next_instr = greenkey[0].getint()
More information about the pypy-commit
mailing list