[pypy-svn] r63239 - in pypy/branch/pyjitpl5-simplify/pypy/jit: backend/llgraph metainterp/test
arigo at codespeak.net
arigo at codespeak.net
Mon Mar 23 16:40:31 CET 2009
Author: arigo
Date: Mon Mar 23 16:40:30 2009
New Revision: 63239
Modified:
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py
pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_exception.py
Log:
Fix exceptions -- we don't need to special-case them
at all in execute_operations().
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py Mon Mar 23 16:40:30 2009
@@ -145,29 +145,23 @@
raise Exception("bad box in valueboxes: %r" % (box,))
# run the loop
fail_index = llimpl.frame_execute(frame)
- # get the exception to raise and really raise it, if any
- exception_addr = llimpl.get_exception()
- if exception_addr:
- exc_value_gcref = llimpl.get_exc_value()
- xxxx
- else:
- # common case: we hit a FAIL operation. Fish for the values
- # (in a real backend, this should be done by the FAIL operation
- # itself, not here)
- op = self.fail_ops[fail_index]
- currentboxes = []
- for i in range(len(op.args)):
- box = op.args[i]
- if isinstance(box, history.BoxInt):
- value = llimpl.frame_int_getvalue(frame, i)
- box = history.BoxInt(value)
- elif isinstance(box, history.BoxPtr):
- value = llimpl.frame_ptr_getvalue(frame, i)
- box = history.BoxPtr(value)
- else:
- raise Exception("bad box in 'fail': %r" % (box,))
- currentboxes.append(box)
- return GuardFailure(op.key, currentboxes)
+ # we hit a FAIL operation. Fish for the values
+ # (in a real backend, this should be done by the FAIL operation
+ # itself, not here)
+ op = self.fail_ops[fail_index]
+ currentboxes = []
+ for i in range(len(op.args)):
+ box = op.args[i]
+ if isinstance(box, history.BoxInt):
+ value = llimpl.frame_int_getvalue(frame, i)
+ box = history.BoxInt(value)
+ elif isinstance(box, history.BoxPtr):
+ value = llimpl.frame_ptr_getvalue(frame, i)
+ box = history.BoxPtr(value)
+ else:
+ raise Exception("bad box in 'fail': %r" % (box,))
+ currentboxes.append(box)
+ return GuardFailure(op.key, currentboxes)
def get_exception(self):
return self.cast_adr_to_int(llimpl.get_exception())
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_exception.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_exception.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_exception.py Mon Mar 23 16:40:30 2009
@@ -35,7 +35,7 @@
return n
res = self.meta_interp(f, [10])
assert res == 0
- self.check_loops({'merge_point': 1, 'jump': 1,
+ self.check_loops({'jump': 1,
'int_gt': 1, 'guard_true': 1,
'int_sub': 1})
More information about the Pypy-commit
mailing list