Author: Ronan Lamy <[email protected]>
Branch: framestate
Changeset: r74685:33f277317ece
Date: 2014-05-11 17:11 +0100
http://bitbucket.org/pypy/pypy/changeset/33f277317ece/
Log: pass instructions into ctx.handle_bytecode() instead of offsets
diff --git a/rpython/flowspace/flowcontext.py b/rpython/flowspace/flowcontext.py
--- a/rpython/flowspace/flowcontext.py
+++ b/rpython/flowspace/flowcontext.py
@@ -349,9 +349,12 @@
self.setstate(block.framestate)
next_offset = block.framestate.next_offset
self.recorder = block.make_recorder()
+ bc_graph = self.pycode.graph
try:
while True:
- next_offset = self.handle_bytecode(next_offset)
+ instr = bc_graph.read(next_offset)
+ self.last_offset = instr.offset
+ next_offset = self.handle_bytecode(instr)
self.recorder.final_state = self.getstate(next_offset)
except RaiseImplicit as e:
@@ -449,12 +452,10 @@
stack_items_w[i] = w_new
break
- def handle_bytecode(self, next_offset):
+ def handle_bytecode(self, instr):
bc_graph = self.pycode.graph
- next_offset, instr = self.pycode.read(next_offset)
- self.last_offset = instr.offset
try:
- offset = instr.eval(self)
+ next_offset = instr.eval(self)
except FlowSignal as signal:
return self.unroll(signal)
if next_offset is None:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit