[pypy-svn] r52008 - in pypy/branch/jit-refactoring/pypy/jit/rainbow: . test
cfbolz at codespeak.net
cfbolz at codespeak.net
Sat Mar 1 18:02:09 CET 2008
Author: cfbolz
Date: Sat Mar 1 18:02:07 2008
New Revision: 52008
Modified:
pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py
pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py
pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py
Log:
Enable the lazy exception path. This requires the insertion of some
global_merge_point hints and a hack around the residual call handling. One test
is going into an infinite loop, investigating.
Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py (original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/codewriter.py Sat Mar 1 18:02:07 2008
@@ -90,7 +90,7 @@
etrafo = hannotator.exceptiontransformer
type_system = self.rtyper.type_system.name
self.exceptiondesc = exception.ExceptionDesc(
- RGenOp, etrafo, type_system, False)
+ RGenOp, etrafo, type_system, True)
self.interpreter = JitInterpreter(self.exceptiondesc, RGenOp)
self.RGenOp = RGenOp
self.current_block = None
@@ -821,7 +821,6 @@
self.emit("goto_if_oopcall_was_virtual", tlabel(("oop_call", op)))
self.emit("after_oop_residual_call")
self.emit(self.promotiondesc_position(lltype.Signed))
-
self.emit(label(("oop_call", op)))
def handle_green_call(self, op, withexc):
Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py (original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py Sat Mar 1 18:02:07 2008
@@ -601,7 +601,13 @@
check_forced = False
flagbox = rtimeshift.after_residual_call(self.jitstate,
exceptiondesc, check_forced)
- done = rtimeshift.promote(self.jitstate, flagbox, promotiondesc)
+ # XXX slightly hackish: the flagbox needs to be in local_boxes
+ # to be passed along to the new block
+ self.frame.local_boxes.append(flagbox)
+ try:
+ done = rtimeshift.promote(self.jitstate, flagbox, promotiondesc)
+ finally:
+ self.frame.local_boxes.pop()
if done:
return self.dispatch()
gv_flag = flagbox.getgenvar(self.jitstate)
@@ -623,7 +629,13 @@
exceptiondesc = None
flagbox = rtimeshift.after_residual_call(self.jitstate,
exceptiondesc, True)
- done = rtimeshift.promote(self.jitstate, flagbox, promotiondesc)
+ # XXX slightly hackish: the flagbox needs to be in local_boxes
+ # to be passed along to the new block
+ self.frame.local_boxes.append(flagbox)
+ try:
+ done = rtimeshift.promote(self.jitstate, flagbox, promotiondesc)
+ finally:
+ self.frame.local_boxes.pop()
if done:
return self.dispatch()
gv_flag = flagbox.getgenvar(self.jitstate)
Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py (original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py Sat Mar 1 18:02:07 2008
@@ -1014,6 +1014,7 @@
return 2*h(x)
def f(x):
+ hint(None, global_merge_point=True)
try:
return g(x)
except ValueError:
@@ -1260,6 +1261,7 @@
else:
return -12 + y
def f(x, y):
+ hint(None, global_merge_point=True)
x = hint(x, concrete=True)
if x == 1:
return g(lltype.nullptr(S), y)
@@ -1312,6 +1314,7 @@
ll_assert(bool(s), "please don't give me a null")
return 5
def f(m):
+ hint(None, global_merge_point=True)
s = h()
n = g(s)
if not s:
@@ -1354,6 +1357,7 @@
return h(n) + x
def f(n, x):
+ hint(None, global_merge_point=True)
try:
return g(n, x)
except ValueError:
More information about the Pypy-commit
mailing list