[pypy-commit] pypy framestate: move BREAK_LOOP, CONTINUE_LOOP
rlamy
noreply at buildbot.pypy.org
Mon Dec 1 16:59:21 CET 2014
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: framestate
Changeset: r74778:8796e220baf7
Date: 2014-11-26 19:38 +0100
http://bitbucket.org/pypy/pypy/changeset/8796e220baf7/
Log: move BREAK_LOOP, CONTINUE_LOOP
diff --git a/rpython/flowspace/bytecode.py b/rpython/flowspace/bytecode.py
--- a/rpython/flowspace/bytecode.py
+++ b/rpython/flowspace/bytecode.py
@@ -499,6 +499,18 @@
else:
raise
+ at bc_reader.register_opcode
+class BREAK_LOOP(BCInstruction):
+ def eval(self, ctx):
+ from rpython.flowspace.flowcontext import Break
+ raise Break
+
+ at bc_reader.register_opcode
+class CONTINUE_LOOP(BCInstruction):
+ def eval(self, ctx):
+ from rpython.flowspace.flowcontext import Continue
+ raise Continue(self.arg)
+
class SetupInstruction(BCInstruction):
def bc_flow(self, reader):
reader.curr_block.operations.append(self)
diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -479,12 +479,6 @@
def BAD_OPCODE(self, _):
raise FlowingError("This operation is not RPython")
- def BREAK_LOOP(self, oparg):
- raise Break
-
- def CONTINUE_LOOP(self, startofloop):
- raise Continue(startofloop)
-
def not_(self, w_obj):
w_bool = op.bool(w_obj).eval(self)
return const(not self.guessbool(w_bool))
More information about the pypy-commit
mailing list