[pypy-svn] r7488 - pypy/trunk/src/pypy/objspace/flow

tismer at codespeak.net tismer at codespeak.net
Sat Nov 20 10:35:10 CET 2004


Author: tismer
Date: Sat Nov 20 10:35:09 2004
New Revision: 7488

Modified:
   pypy/trunk/src/pypy/objspace/flow/flowcontext.py
   pypy/trunk/src/pypy/objspace/flow/model.py
   pypy/trunk/src/pypy/objspace/flow/objspace.py
Log:
added bytecode offset information to the operations.

Modified: pypy/trunk/src/pypy/objspace/flow/flowcontext.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/flowcontext.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/flowcontext.py	Sat Nov 20 10:35:09 2004
@@ -109,6 +109,7 @@
         if not isinstance(self.crnt_ops, list):
             return
         next_instr = frame.next_instr
+        self.crnt_offset = next_instr # save offset for opcode
         if next_instr in self.joinpoints:
             currentstate = FrameState(frame)
             # can 'currentstate' be merged with one of the blocks that

Modified: pypy/trunk/src/pypy/objspace/flow/model.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/model.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/model.py	Sat Nov 20 10:35:09 2004
@@ -138,10 +138,11 @@
 Constant.__init__(UNDEFINED, None)
 
 class SpaceOperation:
-    def __init__(self, opname, args, result): 
+    def __init__(self, opname, args, result):
         self.opname = opname      # operation name
         self.args   = list(args)  # mixed list of var/const
         self.result = result      # either Variable or Constant instance
+        self.offset = -1          # offset in code string, to be added later
 
     def __eq__(self, other):
         return (self.__class__ is other.__class__ and 

Modified: pypy/trunk/src/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/objspace.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/objspace.py	Sat Nov 20 10:35:09 2004
@@ -172,6 +172,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
             self.executioncontext.crnt_ops.append(spaceop)
         return spaceop.result
     



More information about the Pypy-commit mailing list