[pypy-commit] pypy framestate: initialise HostCode.graph more explicitly
rlamy
noreply at buildbot.pypy.org
Mon Nov 24 17:29:58 CET 2014
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: framestate
Changeset: r74687:d2bc0f5d6391
Date: 2014-05-11 17:41 +0100
http://bitbucket.org/pypy/pypy/changeset/d2bc0f5d6391/
Log: initialise HostCode.graph more explicitly
diff --git a/rpython/flowspace/bytecode.py b/rpython/flowspace/bytecode.py
--- a/rpython/flowspace/bytecode.py
+++ b/rpython/flowspace/bytecode.py
@@ -56,7 +56,7 @@
self.co_firstlineno = firstlineno
self.co_lnotab = lnotab
self.signature = cpython_code_signature(self)
- self.build_flow()
+ self.graph = self.build_flow()
def build_flow(self):
contents, offsets, jumps = bc_reader.disassemble(self)
@@ -66,7 +66,7 @@
pendingblocks = [SimpleBlock(contents[i:j])
for i, j in zip([0] + cuts, cuts + [len(self.co_code)])]
- graph = self.graph = BytecodeGraph(pendingblocks[0])
+ graph = BytecodeGraph(pendingblocks[0])
for block in pendingblocks:
for i, op in enumerate(block.operations):
graph.pos_index[op.offset] = block, i
@@ -77,6 +77,7 @@
block = pendingblocks.pop()
for i, op in enumerate(block.operations):
op.bc_flow(block, graph)
+ return graph
@classmethod
def _from_code(cls, code):
More information about the pypy-commit
mailing list