[pypy-svn] pypy default: Write a more detailed __repr__ for CallDescrs.

arigo commits-noreply at bitbucket.org
Fri May 6 17:15:30 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r43932:a16fce4a93f5
Date: 2011-05-06 17:15 +0200
http://bitbucket.org/pypy/pypy/changeset/a16fce4a93f5/

Log:	Write a more detailed __repr__ for CallDescrs.

diff --git a/pypy/jit/backend/llsupport/descr.py b/pypy/jit/backend/llsupport/descr.py
--- a/pypy/jit/backend/llsupport/descr.py
+++ b/pypy/jit/backend/llsupport/descr.py
@@ -261,6 +261,19 @@
         self.arg_classes = arg_classes    # string of "r" and "i" (ref/int)
         self.extrainfo = extrainfo
 
+    def __repr__(self):
+        res = '%s(%s)' % (self.__class__.__name__, self.arg_classes)
+        oopspecindex = getattr(self.extrainfo, 'oopspecindex', 0)
+        if oopspecindex:
+            from pypy.jit.codewriter.effectinfo import EffectInfo
+            for key, value in EffectInfo.__dict__.items():
+                if key.startswith('OS_') and value == oopspecindex:
+                    break
+            else:
+                key = 'oopspecindex=%r' % oopspecindex
+            res += ' ' + key
+        return '<%s>' % res
+
     def get_extra_info(self):
         return self.extrainfo
 


More information about the Pypy-commit mailing list