Author: Ronan Lamy <[email protected]>
Branch: translation-cleanup
Changeset: r56996:35a503e9b11c
Date: 2012-08-12 05:27 +0100
http://bitbucket.org/pypy/pypy/changeset/35a503e9b11c/

Log:    Copy .handle_bytecode() into FlowSpaceFrame

        and let the builtin exceptions propagate in standard fashion.

diff --git a/pypy/objspace/flow/flowcontext.py 
b/pypy/objspace/flow/flowcontext.py
--- a/pypy/objspace/flow/flowcontext.py
+++ b/pypy/objspace/flow/flowcontext.py
@@ -5,7 +5,7 @@
 from pypy.interpreter import pyframe, nestedscope
 from pypy.interpreter.argument import ArgumentsForTranslation
 from pypy.interpreter.pyopcode import (Return, Yield, SuspendedUnroller,
-        SReturnValue, BytecodeCorruption)
+        SReturnValue, BytecodeCorruption, Reraise, RaiseWithExplicitTraceback)
 from pypy.objspace.flow import operation
 from pypy.objspace.flow.model import *
 from pypy.objspace.flow.framestate import (FrameState, recursively_unflatten,
@@ -432,6 +432,20 @@
             prevblock = parent
         return recorder
 
+    def handle_bytecode(self, code, next_instr, ec):
+        try:
+            next_instr = self.dispatch_bytecode(code, next_instr, ec)
+        except OperationError, operr:
+            next_instr = self.handle_operation_error(ec, operr)
+        except Reraise:
+            operr = self.last_exception
+            next_instr = self.handle_operation_error(ec, operr,
+                                                     attach_tb=False)
+        except RaiseWithExplicitTraceback, e:
+            next_instr = self.handle_operation_error(ec, e.operr,
+                                                     attach_tb=False)
+        return next_instr
+
     def dispatch_bytecode(self, code, next_instr, ec):
         while True:
             self.last_instr = next_instr
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to