[pypy-commit] pypy framestate: Add SETUP_EXCEPT instruction
rlamy
noreply at buildbot.pypy.org
Mon Nov 24 17:29:54 CET 2014
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: framestate
Changeset: r74684:1ee1acf65ff1
Date: 2014-05-05 02:28 +0100
http://bitbucket.org/pypy/pypy/changeset/1ee1acf65ff1/
Log: Add SETUP_EXCEPT instruction
diff --git a/rpython/flowspace/bytecode.py b/rpython/flowspace/bytecode.py
--- a/rpython/flowspace/bytecode.py
+++ b/rpython/flowspace/bytecode.py
@@ -331,6 +331,13 @@
target_block, _ = graph.pos_index[self.arg]
graph.add_jump(block, target_block)
+ at bc_reader.register_opcode
+class SETUP_EXCEPT(BCInstruction):
+ def eval(self, ctx):
+ from rpython.flowspace.flowcontext import ExceptBlock
+ block = ExceptBlock(ctx, self.arg)
+ ctx.blockstack.append(block)
+
_unary_ops = [
('UNARY_POSITIVE', op.pos),
('UNARY_NEGATIVE', op.neg),
diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -734,10 +734,6 @@
block = LoopBlock(self, target)
self.blockstack.append(block)
- def SETUP_EXCEPT(self, target):
- block = ExceptBlock(self, target)
- self.blockstack.append(block)
-
def SETUP_FINALLY(self, target):
block = FinallyBlock(self, target)
self.blockstack.append(block)
More information about the pypy-commit
mailing list