Author: Ronan Lamy <[email protected]>
Branch: framestate
Changeset: r74678:98ad1b9e8759
Date: 2014-05-11 15:51 +0100
http://bitbucket.org/pypy/pypy/changeset/98ad1b9e8759/
Log: move .read() to BytecodeGraph
diff --git a/rpython/flowspace/bytecode.py b/rpython/flowspace/bytecode.py
--- a/rpython/flowspace/bytecode.py
+++ b/rpython/flowspace/bytecode.py
@@ -98,13 +98,6 @@
def is_generator(self):
return bool(self.co_flags & CO_GENERATOR)
- def read(self, offset):
- block, i = self.graph.pos_index[offset]
- op = block[i]
- next_offset = self.graph.next_pos[offset]
- return next_offset, op
-
-
class BytecodeReader(object):
def __init__(self, opnames):
self.opnames = opnames
@@ -183,6 +176,12 @@
self.entry.set_exits([startblock])
self.pos_index = {}
+ def read(self, offset):
+ block, i = self.pos_index[offset]
+ op = block[i]
+ next_offset = self.next_pos[offset]
+ return next_offset, op
+
class BytecodeBlock(object):
"""Base class for opcode blocks"""
diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -452,7 +452,7 @@
self.last_offset = next_offset
next_offset, instr = self.pycode.read(next_offset)
try:
- res = instr.eval(self)
+ offset = instr.eval(self)
return offset if offset is not None else next_offset
except FlowSignal as signal:
return self.unroll(signal)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit