aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Pape <tobias@netshed.de>2016-03-08 20:49:22 +0100
committerTobias Pape <tobias@netshed.de>2016-03-08 20:49:22 +0100
commit9210eeabba117ca0a0a29f8bc6e2533543ce5b30 (patch)
tree69e971df5faba4119cd2452acc76eac47500d6bd /rpython/jit/tool
parentmerge (diff)
downloadpypy-9210eeabba117ca0a0a29f8bc6e2533543ce5b30.tar.gz
pypy-9210eeabba117ca0a0a29f8bc6e2533543ce5b30.tar.bz2
pypy-9210eeabba117ca0a0a29f8bc6e2533543ce5b30.zip
Fix guard sorting in trace viewer
(previously sorted by string order, which does not work for hex)
Diffstat (limited to 'rpython/jit/tool')
-rwxr-xr-xrpython/jit/tool/traceviewer.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/rpython/jit/tool/traceviewer.py b/rpython/jit/tool/traceviewer.py
index 3207be9d05..b4aa0c986e 100755
--- a/rpython/jit/tool/traceviewer.py
+++ b/rpython/jit/tool/traceviewer.py
@@ -103,9 +103,9 @@ class BasicBlock(object):
self.last_guard = -1
else:
# guards can be out of order nowadays
- groups = sorted(groups)
- self.first_guard = guard_number(groups[0])
- self.last_guard = guard_number(groups[-1])
+ groups = sorted(map(guard_number, groups))
+ self.first_guard = groups[0]
+ self.last_guard = groups[-1]
content = property(get_content, set_content)
@@ -156,8 +156,7 @@ class Block(BasicBlock):
dotgen.emit_edge(self.name(), self.right.name())
def split_one_loop(real_loops, guard_s, guard_content, lineno, no, allloops):
- for i in range(len(allloops) - 1, -1, -1):
- loop = allloops[i]
+ for i, loop in enumerate(allloops):
if no < loop.first_guard or no > loop.last_guard:
continue
content = loop.content