[pypy-svn] r37470 - pypy/dist/pypy/translator/backendopt

pedronis at codespeak.net pedronis at codespeak.net
Sun Jan 28 15:32:33 CET 2007


Author: pedronis
Date: Sun Jan 28 15:32:32 2007
New Revision: 37470

Modified:
   pypy/dist/pypy/translator/backendopt/escape.py
Log:
attach some debug type info to the creation points.

Keepalive was not there?



Modified: pypy/dist/pypy/translator/backendopt/escape.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/escape.py	(original)
+++ pypy/dist/pypy/translator/backendopt/escape.py	Sun Jan 28 15:32:32 2007
@@ -7,7 +7,7 @@
 from pypy.tool.uid import uid
 
 class CreationPoint(object):
-    def __init__(self, creation_method="?"):
+    def __init__(self, creation_method, lltype):
         self.changes = False
         self.escapes = False
         self.creation_method = creation_method
@@ -15,10 +15,11 @@
             self.changes = True
             self.escapes = True
             self.malloced = False
+        self.lltype = lltype
 
     def __repr__(self):
-        return ("CreationPoint(<0x%x>, %s, esc=%s, cha=%s)" %
-                (uid(self), self.creation_method, self.escapes, self.changes))
+        return ("CreationPoint(<0x%x>, %r, %s, esc=%s, cha=%s)" %
+                (uid(self), self.lltype, self.creation_method, self.escapes, self.changes))
 
 class VarState(object):
     def __init__(self, crep=None):
@@ -93,7 +94,7 @@
             varstate = VarState()
         else:
             if var_or_const not in self.constant_cps:
-                crep = CreationPoint("constant")
+                crep = CreationPoint("constant", var_or_const.concretetype)
                 self.constant_cps[var_or_const] = crep
             else:
                 crep = self.constant_cps[var_or_const]
@@ -110,7 +111,7 @@
     def get_creationpoint(self, var, method="?"):
         if var in self.creationpoints:
             return self.creationpoints[var]
-        crep = CreationPoint(method)
+        crep = CreationPoint(method, var.concretetype)
         self.creationpoints[var] = crep
         return crep
     
@@ -240,6 +241,9 @@
     def op_malloc_varsize(self, op, typestate, lengthstate):
         return VarState(self.get_creationpoint(op.result, "malloc_varsize"))
 
+    def op_keepalive(self, op, state):
+        return None
+
     def op_cast_pointer(self, op, state):
         return state
     



More information about the Pypy-commit mailing list