Author: Ronan Lamy <[email protected]>
Branch: translation-cleanup
Changeset: r56988:b82f8c3ed572
Date: 2012-08-10 02:19 +0100
http://bitbucket.org/pypy/pypy/changeset/b82f8c3ed572/

Log:    Kill FlowEC.crnt_offset

        Duplicates frame.last_instr, so use that instead

diff --git a/pypy/objspace/flow/flowcontext.py 
b/pypy/objspace/flow/flowcontext.py
--- a/pypy/objspace/flow/flowcontext.py
+++ b/pypy/objspace/flow/flowcontext.py
@@ -73,7 +73,6 @@
         self.crnt_block.operations.append(operation)
 
     def bytecode_trace(self, ec, frame):
-        ec.crnt_offset = frame.last_instr      # save offset for opcode
         if self.enterspamblock:
             # If we have a SpamBlock, the first call to bytecode_trace()
             # occurs as soon as frame.resume() starts, before interpretation
@@ -196,14 +195,12 @@
         code = PyCode._from_code(space, func.func_code)
         self.code = code
 
-        self.crnt_offset = -1
         self.frame = frame = FlowSpaceFrame(self.space, code,
                                func, constargs)
         self.joinpoints = {}
         self.graph = frame._init_graph(func)
         self.pendingblocks = collections.deque([self.graph.startblock])
 
-
         while self.pendingblocks:
             block = self.pendingblocks.popleft()
             try:
diff --git a/pypy/objspace/flow/objspace.py b/pypy/objspace/flow/objspace.py
--- a/pypy/objspace/flow/objspace.py
+++ b/pypy/objspace/flow/objspace.py
@@ -263,7 +263,7 @@
         except error.FlowingError, a:
             # attach additional source info to AnnotatorError
             _, _, tb = sys.exc_info()
-            formated = error.format_global_error(ec.graph, ec.crnt_offset,
+            formated = error.format_global_error(ec.graph, ec.frame.last_instr,
                                                  str(a))
             e = error.FlowingError(formated)
             raise error.FlowingError, e, tb
@@ -303,7 +303,7 @@
     def do_operation(self, name, *args_w):
         spaceop = SpaceOperation(name, args_w, Variable())
         if hasattr(self, 'executioncontext'):  # not here during bootstrapping
-            spaceop.offset = self.executioncontext.crnt_offset
+            spaceop.offset = self.executioncontext.frame.last_instr
             self.executioncontext.recorder.append(spaceop)
         return spaceop.result
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to