[pypy-commit] pypy default: Change again the repr of CallDescrs, this time to standardize the format

arigo noreply at buildbot.pypy.org
Tue Dec 20 15:53:32 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r50757:b3fc00ecbb30
Date: 2011-12-20 13:55 +0000
http://bitbucket.org/pypy/pypy/changeset/b3fc00ecbb30/

Log:	Change again the repr of CallDescrs, this time to standardize the
	format with the other Descrs and to include more information.

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
@@ -425,7 +425,15 @@
                 self.arg_classes.count('L')) == len(args_f or ())
 
     def repr_of_descr(self):
-        return '<CallDescr(%s/%s)>' % (self.arg_classes, self.result_type)
+        res = 'Call%s %d' % (self.result_type, self.result_size)
+        if self.arg_classes:
+            res += ' ' + self.arg_classes
+        if self.extrainfo:
+            res += ' EF=%d' % self.extrainfo.extraeffect
+            oopspecindex = self.extrainfo.oopspecindex
+            if oopspecindex:
+                res += ' OS=%d' % oopspecindex
+        return '<%s>' % res
 
 
 def map_type_to_argclass(ARG, accept_void=False):
diff --git a/pypy/jit/backend/llsupport/test/test_descr.py b/pypy/jit/backend/llsupport/test/test_descr.py
--- a/pypy/jit/backend/llsupport/test/test_descr.py
+++ b/pypy/jit/backend/llsupport/test/test_descr.py
@@ -342,16 +342,16 @@
     assert repr_of_descr(descr3i) == '<ArrayU 1>'
     #
     descr4 = get_call_descr(c0, [lltype.Char, lltype.Ptr(S)], lltype.Ptr(S))
-    assert repr_of_descr(descr4) == '<CallDescr(ir/r)>'
+    assert repr_of_descr(descr4) == '<Callr %d ir>' % o
     #
     descr4i = get_call_descr(c0, [lltype.Char, lltype.Ptr(S)], lltype.Char)
-    assert repr_of_descr(descr4i) == '<CallDescr(ir/i)>'
+    assert repr_of_descr(descr4i) == '<Calli 1 ir>'
     #
     descr4f = get_call_descr(c0, [lltype.Char, lltype.Ptr(S)], lltype.Float)
-    assert repr_of_descr(descr4f) == '<CallDescr(ir/f)>'
+    assert repr_of_descr(descr4f) == '<Callf 8 ir>'
     #
     descr5f = get_call_descr(c0, [lltype.Char], lltype.SingleFloat)
-    assert repr_of_descr(descr5f) == '<CallDescr(i/S)>'
+    assert repr_of_descr(descr5f) == '<CallS 4 i>'
 
 def test_call_stubs_1():
     c0 = GcCache(False)


More information about the pypy-commit mailing list