[pypy-svn] r65532 - pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp

fijal at codespeak.net fijal at codespeak.net
Mon Jun 1 20:35:09 CEST 2009


Author: fijal
Date: Mon Jun  1 20:35:06 2009
New Revision: 65532

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/resoperation.py
Log:
Improve printing of resops


Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py	Mon Jun  1 20:35:06 2009
@@ -582,19 +582,22 @@
         self.cpu = cpu
         self.inputargs = None
         self.operations = []
-    def record(self, opnum, argboxes, resbox, descr=None):
+    def record(self, opnum, argboxes, resbox, descr=None, pc=0, name=""):
         raise NotImplementedError
 
 class History(RunningMatcher):
     extratext = ''
-    def record(self, opnum, argboxes, resbox, descr=None):
+    def record(self, opnum, argboxes, resbox, descr=None,
+               pc=0, name=""):
         op = ResOperation(opnum, argboxes, resbox, descr)
+        op.pc = pc
+        op.name = name
         self.operations.append(op)
         return op
 
 class BlackHole(RunningMatcher):
     extratext = ' (BlackHole)'
-    def record(self, opnum, argboxes, resbox, descr=None):
+    def record(self, opnum, argboxes, resbox, descr=None, pc=0, name=""):
         return None
 
 # ____________________________________________________________

Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/resoperation.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/resoperation.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/resoperation.py	Mon Jun  1 20:35:06 2009
@@ -15,6 +15,10 @@
     # for x86 backend and guards
     inputargs = None
 
+    # debug
+    name = ""
+    pc = 0
+
     def __init__(self, opnum, args, result, descr=None):
         assert isinstance(opnum, int)
         self.opnum = opnum
@@ -48,11 +52,15 @@
             sres = '%s = ' % (self.result,)
         else:
             sres = ''
+        if self.name:
+            prefix = "%s:%s:" % (self.name, self.pc)
+        else:
+            prefix = ""
         if self.descr is None or we_are_translated():
-            return '%s%s(%s)' % (sres, self.getopname(),
+            return '%s%s%s(%s)' % (prefix, sres, self.getopname(),
                                  ', '.join([str(a) for a in self.args]))
         else:
-            return '%s%s(%s, descr=%r)' % (sres, self.getopname(),
+            return '%s%s%s(%s, descr=%r)' % (prefix, sres, self.getopname(),
                             ', '.join([str(a) for a in self.args]), self.descr)
 
     def getopname(self):



More information about the Pypy-commit mailing list