[pypy-commit] pypy default: put in_recursion back into debug_merge_points

fijal noreply at buildbot.pypy.org
Tue Jun 7 14:50:27 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r44784:ae580e2a4f69
Date: 2011-06-07 14:40 +0200
http://bitbucket.org/pypy/pypy/changeset/ae580e2a4f69/

Log:	put in_recursion back into debug_merge_points

diff --git a/pypy/jit/metainterp/pyjitpl.py b/pypy/jit/metainterp/pyjitpl.py
--- a/pypy/jit/metainterp/pyjitpl.py
+++ b/pypy/jit/metainterp/pyjitpl.py
@@ -916,8 +916,8 @@
 
     def debug_merge_point(self, jd_index, in_recursion, greenkey):
         # debugging: produce a DEBUG_MERGE_POINT operation
-        self.metainterp.history.record(rop.DEBUG_MERGE_POINT,
-                                       [ConstInt(jd_index)] + greenkey, None)
+        args = [ConstInt(jd_index), ConstInt(in_recursion)] + greenkey
+        self.metainterp.history.record(rop.DEBUG_MERGE_POINT, args, None)
 
     @arguments("box", "label")
     def opimpl_goto_if_exception_mismatch(self, vtablebox, next_exc_target):
diff --git a/pypy/jit/tool/oparser.py b/pypy/jit/tool/oparser.py
--- a/pypy/jit/tool/oparser.py
+++ b/pypy/jit/tool/oparser.py
@@ -212,7 +212,7 @@
         descr = None
         if argspec.strip():
             if opname == 'debug_merge_point':
-                allargs = [argspec]
+                allargs = argspec.split(',', 1)
             else:
                 allargs = [arg for arg in argspec.split(",")
                            if arg != '']
diff --git a/pypy/jit/tool/test/test_oparser.py b/pypy/jit/tool/test/test_oparser.py
--- a/pypy/jit/tool/test/test_oparser.py
+++ b/pypy/jit/tool/test/test_oparser.py
@@ -141,16 +141,16 @@
 def test_debug_merge_point():
     x = '''
     []
-    debug_merge_point("info")
-    debug_merge_point('info')
-    debug_merge_point('<some ('other,')> info')
-    debug_merge_point('(stuff) #1')
+    debug_merge_point(0, "info")
+    debug_merge_point(0, 'info')
+    debug_merge_point(1, '<some ('other,')> info')
+    debug_merge_point(0, '(stuff) #1')
     '''
     loop = parse(x)
-    assert loop.operations[0].getarg(0)._get_str() == 'info'
-    assert loop.operations[1].getarg(0)._get_str() == 'info'
-    assert loop.operations[2].getarg(0)._get_str() == "<some ('other,')> info"
-    assert loop.operations[3].getarg(0)._get_str() == "(stuff) #1"
+    assert loop.operations[0].getarg(1)._get_str() == 'info'
+    assert loop.operations[1].getarg(1)._get_str() == 'info'
+    assert loop.operations[2].getarg(1)._get_str() == "<some ('other,')> info"
+    assert loop.operations[3].getarg(1)._get_str() == "(stuff) #1"
     
 
 def test_descr_with_obj_print():
diff --git a/pypy/tool/jitlogparser/parser.py b/pypy/tool/jitlogparser/parser.py
--- a/pypy/tool/jitlogparser/parser.py
+++ b/pypy/tool/jitlogparser/parser.py
@@ -95,12 +95,12 @@
 
     def __init__(self, operations, storage):
         if operations[0].name == 'debug_merge_point':
-            self.inline_level = int(operations[0].args[1])
+            self.inline_level = int(operations[0].args[0])
             m = re.search('<code object ([<>\w]+), file \'(.+?)\', line (\d+)> #(\d+) (\w+)',
-                         operations[0].getarg(0))
+                         operations[0].getarg(1))
             if m is None:
                 # a non-code loop, like StrLiteralSearch or something
-                self.bytecode_name = operations[0].args[0].split(" ")[0][1:]
+                self.bytecode_name = operations[0].args[1].split(" ")[0][1:]
             else:
                 self.name, self.filename, lineno, bytecode_no, self.bytecode_name = m.groups()
                 self.startlineno = int(lineno)


More information about the pypy-commit mailing list