Commits

Antonio Cuni  committed ccec386

debug aid that have been living in my working copy for ages

  • Participants
  • Parent commits 422cc2d
  • Branches oo-jit

Comments (0)

Files changed (1)

File pypy/jit/codegen/cli/operation.py

     def storeExcFlag(self):
         self.gv_excflag().store(self.meth)
 
+    def getname(self):
+        return None
+
 
 class UnaryOp(Operation):
     def __init__(self, meth, gv_x):
         self.gv_x.load(self.meth)
 
     def emit(self):
+        name = self.getname()
+        if name is not None:
+            self.meth.il.EmitWriteLine(name)
         self.pushAllArgs()
         self.meth.il.Emit(self.getOpCode())
         self.storeResult()
         self.gv_y.load(self.meth)
 
     def emit(self):
+        name = self.getname()
+        if name is not None:
+            self.meth.il.EmitWriteLine(name)
         self.pushAllArgs()
         self.meth.il.Emit(self.getOpCode())
         self.storeResult()
         out[opname].restype = globals()[funcname]
 
 
+TRACE_OPERATIONS=False
+
 def renderSimpleOp(baseclass, opname, value, out):
     attrname = opcode2attrname(value)
     source = py.code.Source("""
     class %(opname)s (%(baseclass)s):
         def getOpCode(self):
             return OpCodes.%(attrname)s
+
+        if TRACE_OPERATIONS:
+            def getname(self):
+                return "%(opname)s"
     """ % locals())
     code = source.compile()
     exec code in globals(), out