[pypy-commit] pypy default: phew, restore showing the assembler

arigo pypy.commits at gmail.com
Thu Apr 14 11:33:58 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r83672:405af54d6c54
Date: 2016-04-14 17:31 +0200
http://bitbucket.org/pypy/pypy/changeset/405af54d6c54/

Log:	phew, restore showing the assembler

diff --git a/rpython/tool/jitlogparser/parser.py b/rpython/tool/jitlogparser/parser.py
--- a/rpython/tool/jitlogparser/parser.py
+++ b/rpython/tool/jitlogparser/parser.py
@@ -93,15 +93,19 @@
         if backend_dump is not None:
             raw_asm = self._asm_disassemble(backend_dump.decode('hex'),
                                             backend_tp, dump_start)
+            # additional mess: if the backend_dump starts with a series
+            # of zeros, raw_asm's first regular line is *after* that,
+            # after a line saying "...".  So we assume that start==dump_start
+            # if this parameter was passed.
             asm = []
-            start = 0
+            start = dump_start
             for elem in raw_asm:
                 if len(elem.split("\t")) < 3:
                     continue
                 e = elem.split("\t")
                 adr = e[0]
                 v = elem   # --- more compactly:  " ".join(e[2:])
-                if not start:
+                if not start:     # only if 'dump_start' is left at 0
                     start = int(adr.strip(":"), 16)
                 ofs = int(adr.strip(":"), 16) - start
                 if ofs >= 0:
@@ -127,9 +131,9 @@
                     op.asm = '\n'.join([asm[i][1] for i in range(asm_index, end_index)])
         return loop
 
-    def _asm_disassemble(self, d, origin_addr, tp):
+    def _asm_disassemble(self, d, tp, origin_addr):
         from rpython.jit.backend.tool.viewcode import machine_code_dump
-        return list(machine_code_dump(d, tp, origin_addr))
+        return list(machine_code_dump(d, origin_addr, tp))
 
     @classmethod
     def parse_from_input(cls, input, **kwds):
@@ -419,10 +423,11 @@
         world.parse(entry.splitlines(True))
     dumps = {}
     for r in world.ranges:
-        if r.addr in addrs and addrs[r.addr]:
-            name = addrs[r.addr].pop(0) # they should come in order
-            data = r.data.encode('hex')       # backward compatibility
-            dumps[name] = (world.backend_name, r.addr, data)
+        for pos1 in range(r.addr, r.addr + len(r.data)):
+            if pos1 in addrs and addrs[pos1]:
+                name = addrs[pos1].pop(0) # they should come in order
+                data = r.data.encode('hex')
+                dumps[name] = (world.backend_name, r.addr, data)
     loops = []
     cat = extract_category(log, 'jit-log-opt')
     if not cat:


More information about the pypy-commit mailing list