Commits

Ronan Lamy  committed b82f8c3

Kill FlowEC.crnt_offset

Duplicates frame.last_instr, so use that instead

  • Participants
  • Parent commits 548063e
  • Branches translation-cleanup

Comments (0)

Files changed (2)

File pypy/objspace/flow/flowcontext.py

         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
         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:

File pypy/objspace/flow/objspace.py

         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
     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