[pypy-commit] pypy default: adjust to new situation

fijal noreply at buildbot.pypy.org
Tue Dec 27 15:41:19 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r50903:974244d55fe2
Date: 2011-12-27 16:41 +0200
http://bitbucket.org/pypy/pypy/changeset/974244d55fe2/

Log:	adjust to new situation

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
@@ -219,7 +219,6 @@
         Also detect inlined functions and make them Function
         """
         stack = []
-        seen_dmp = False
 
         def getpath(stack):
             return ",".join([str(len(v)) for v in stack])
@@ -240,14 +239,11 @@
         stack = []
         for op in operations:
             if op.name == 'debug_merge_point':
-                if seen_dmp:
-                    if so_far:
-                        append_to_res(cls.TraceForOpcode(so_far, storage))
-                        if limit:
-                            break
-                        so_far = []
-                else:
-                    seen_dmp = True
+                if so_far:
+                    append_to_res(cls.TraceForOpcode(so_far, storage))
+                    if limit:
+                        break
+                    so_far = []
             so_far.append(op)
         if so_far:
             append_to_res(cls.TraceForOpcode(so_far, storage))
@@ -391,7 +387,7 @@
     if trace.comment and 'Guard' in trace.comment:
         descrs = ['bridge ' + re.search('Guard (\d+)', trace.comment).group(1)]
     else:
-        descrs = ['']
+        descrs = ['entry ' + re.search('Loop (\d+)', trace.comment).group(1)]
     for i, op in enumerate(trace.operations):
         if op.name == 'label':
             labels.append(i)
diff --git a/pypy/tool/jitlogparser/test/test_parser.py b/pypy/tool/jitlogparser/test/test_parser.py
--- a/pypy/tool/jitlogparser/test/test_parser.py
+++ b/pypy/tool/jitlogparser/test/test_parser.py
@@ -38,7 +38,6 @@
 def test_split():
     ops = parse('''
     [i0]
-    label()
     debug_merge_point(0, "<code object stuff. file '/I/dont/exist.py'. line 200> #10 ADD")
     debug_merge_point(0, "<code object stuff. file '/I/dont/exist.py'. line 200> #11 SUB")
     i1 = int_add(i0, 1)
@@ -47,7 +46,7 @@
     ''')
     res = Function.from_operations(ops.operations, LoopStorage())
     assert len(res.chunks) == 3
-    assert len(res.chunks[0].operations) == 2
+    assert len(res.chunks[0].operations) == 1
     assert len(res.chunks[1].operations) == 2
     assert len(res.chunks[2].operations) == 2
     assert res.chunks[2].bytecode_no == 11
@@ -97,7 +96,7 @@
     i2 = int_add(i1, 1)
     ''')
     res = Function.from_operations(ops.operations, LoopStorage())
-    assert res.repr() == res.chunks[0].repr()
+    assert res.repr() == res.chunks[1].repr()
 
 def test_lineno():
     fname = str(py.path.local(__file__).join('..', 'x.py'))
@@ -246,6 +245,7 @@
     guard_true(i19, descr=<Guard2>) []
     i113 = getfield_raw(151937600, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
     ''')
+    loop.comment = 'Loop 0'
     parts = split_trace(loop)
     assert len(parts) == 3
     assert len(parts[0].operations) == 2
@@ -273,7 +273,7 @@
     finish(i0)
     ''')
     bridge.comment = 'bridge out of Guard 2 with 1 ops'
-    loop.comment = ''
+    loop.comment = 'Loop 0'
     loops = split_trace(loop) + split_trace(bridge)
     input = ['grrr:123\nasb:12\nbridge 2:1234']
     parse_log_counts(input, loops)


More information about the pypy-commit mailing list