[pypy-svn] r62516 - in pypy/branch/pyjitpl5/pypy/jit/metainterp: . test

fijal at codespeak.net fijal at codespeak.net
Wed Mar 4 11:29:23 CET 2009


Author: fijal
Date: Wed Mar  4 11:29:23 2009
New Revision: 62516

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/dump.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_debug.py
Log:
Improve debug info


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/dump.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/dump.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/dump.py	Wed Mar  4 11:29:23 2009
@@ -141,11 +141,14 @@
     for ev, code, args in call_history:
         if ev == 'enter':
             if args is not None:
-                args_s = [str(a) for a in args]
+                args_s = [repr(a) for a in args]
             else:
                 args_s = []
-            print >>outfile, "%s%s(%s)" % (" "*indent, code.name, ','.join(args_s))
+            print >>outfile, "%s%s(%s)" % (" "*indent, code.name, ', '.join(args_s))
             indent += 2
+        elif ev == 'call':
+            args_s = [repr(a) for a in args]
+            print >>outfile, "%sCALL %r(%s)" % (" "*indent, code, ', '.join(args_s))
         elif ev.startswith('leave'):
             indent -= 2
         elif ev == 'guard_failure':

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	Wed Mar  4 11:29:23 2009
@@ -717,6 +717,9 @@
             if not self.metainterp.history.generate_anything_since(old_index):
                 assert pure
                 return False
+            if not we_are_translated():
+                self.metainterp._debug_history.append(['call',
+                                                  argboxes[0], argboxes[1:]])
             etype = lltype.nullptr(rclass.OBJECT_VTABLE)
             evalue = lltype.nullptr(rclass.OBJECT)
         type_as_int = self.metainterp.cpu.cast_adr_to_int(

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_debug.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_debug.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_debug.py	Wed Mar  4 11:29:23 2009
@@ -29,14 +29,15 @@
         res = self.meta_interp(f, [10], policy=StopAtXPolicy(x))
         assert res == 0
         ch = get_stats().loops[0]._call_history
-        cmp = [(i, getattr(j, 'name', 'gf')) for i, j, _ in ch]
+        cmp = [(i, getattr(j, 'name', None)) for i, j, _ in ch]
         assert cmp == [
             ('enter', 'f'),
             ('enter', 'g'),
             ('enter', 'z'),
+            ('call',  None),
             ('leave', 'z'),
             ('leave', 'g'),
-            ('guard_failure', 'gf'),
+            ('guard_failure', None),
             ('enter', 'f'),
             ('leave', 'f'),
             ]



More information about the Pypy-commit mailing list