[pypy-commit] pypy framestate: move graph._next_pos init to _iter_instr() and really kill JUMP_XXX.bc_flow()
rlamy
noreply at buildbot.pypy.org
Mon Nov 24 17:30:20 CET 2014
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: framestate
Changeset: r74706:f048ea78f140
Date: 2014-11-24 03:09 +0000
http://bitbucket.org/pypy/pypy/changeset/f048ea78f140/
Log: move graph._next_pos init to _iter_instr() and really kill
JUMP_XXX.bc_flow()
diff --git a/rpython/flowspace/bytecode.py b/rpython/flowspace/bytecode.py
--- a/rpython/flowspace/bytecode.py
+++ b/rpython/flowspace/bytecode.py
@@ -136,7 +136,9 @@
def _iter_instr(self, code):
self.offset = 0
i = 0
+ last_offset = -1
while self.offset < len(code.co_code):
+ self.graph._next_pos.setdefault(last_offset, self.offset)
if self.offset in self.pending_blocks:
new_block = self.pending_blocks[self.offset]
if not self.curr_block.operations:
@@ -144,6 +146,7 @@
self.enter_next_block(new_block)
next_offset, instr = self.read(code, self.offset)
yield instr
+ last_offset = instr.offset
self.offset = next_offset
i += 1
@@ -186,14 +189,11 @@
self.blocks = [SimpleBlock([])]
self.curr_block = self.blocks[0]
self.graph = graph = BytecodeGraph(self.blocks[0])
- last_offset = -1
for instr in self._iter_instr(code):
offsets.append(instr.offset)
block = self.curr_block
graph.pos_index[instr.offset] = block, len(block.operations)
- graph._next_pos[last_offset] = instr.offset
instr.prepare_flow(self)
- last_offset = instr.offset
graph._next_pos[offsets[-1]] = len(code.co_code)
for block in self.blocks:
@@ -398,7 +398,7 @@
@flow_opcode
def JUMP_ABSOLUTE(self, reader):
- reader.graph._next_pos[self.offset] = self.arg
+ pass
def prepare(self, reader):
block = reader.curr_block
@@ -412,7 +412,7 @@
@flow_opcode
def JUMP_FORWARD(self, reader):
- reader.graph._next_pos[self.offset] = self.arg
+ pass
def prepare(self, reader):
block = reader.curr_block
More information about the pypy-commit
mailing list