[pypy-svn] r21223 - pypy/dist/pypy/jit

arigo at codespeak.net arigo at codespeak.net
Fri Dec 16 17:42:30 CET 2005


Author: arigo
Date: Fri Dec 16 17:42:28 2005
New Revision: 21223

Modified:
   pypy/dist/pypy/jit/llabstractinterp.py
Log:
Checking in minor local changes to llabstractinterp: a __repr__ for the
virtual structures and an extra supported operation.


Modified: pypy/dist/pypy/jit/llabstractinterp.py
==============================================================================
--- pypy/dist/pypy/jit/llabstractinterp.py	(original)
+++ pypy/dist/pypy/jit/llabstractinterp.py	Fri Dec 16 17:42:28 2005
@@ -271,6 +271,12 @@
     """Stands for a pointer to a malloc'ed structure; the structure is not
     malloc'ed so far, but we record which fields have which value.
     """
+    def __repr__(self):
+        items = self.fields.items()
+        items.sort()
+        flds = ['%s=%r' % item for item in items]
+        return '<virtual %s %s>' % (self.T._name, ', '.join(flds))
+
     def getnames(self):
         return self.T._names
 
@@ -288,6 +294,12 @@
     malloc'ed so far, but we record which fields have which value -- here
     a field is an item, indexed by an integer instead of a string field name.
     """
+    def __repr__(self):
+        items = self.fields.items()
+        items.sort()
+        flds = ['%s=%r' % item for item in items]
+        return '<virtual [%s]>' % (', '.join(flds),)
+
     def getnames(self):
         c = self.a_length.maybe_get_constant()
         assert c is not None
@@ -803,6 +815,9 @@
     def op_cast_char_to_int(self, op, a):
         return self.residualize(op, [a], ord)
 
+    def op_cast_bool_to_int(self, op, a):
+        return self.residualize(op, [a], int)
+
     def op_same_as(self, op, a):
         return a
 



More information about the Pypy-commit mailing list