Author: Richard Plangger <planri...@gmail.com>
Branch: vecopt-merge
Changeset: r80088:8f3c47c05e89
Date: 2015-10-09 17:07 +0200
http://bitbucket.org/pypy/pypy/changeset/8f3c47c05e89/

Log:    reverted the jitlogparser file (modifications not used anymore)

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
@@ -167,6 +167,7 @@
     def update_memo(self, val, name):
         pass
 
+
 class NonCodeError(Exception):
     pass
 
@@ -413,35 +414,16 @@
 def import_log(logname, ParserCls=SimpleParser):
     log = parse_log_file(logname)
     addrs = parse_addresses(extract_category(log, 'jit-backend-addr'))
-    from rpython.jit.backend.tool.viewcode import CodeRange
-    ranges = {}
-    backend_name = None
+    from rpython.jit.backend.tool.viewcode import World
+    world = World()
     for entry in extract_category(log, 'jit-backend-dump'):
-        for line in entry.splitlines(True):
-            # copied from class World
-            if line.startswith('BACKEND '):
-                backend_name = line.split(' ')[1].strip()
-            if line.startswith('CODE_DUMP '):
-                pieces = line.split()
-                assert pieces[1].startswith('@')
-                assert pieces[2].startswith('+')
-                if len(pieces) == 3:
-                    continue     # empty line
-                baseaddr = long(pieces[1][1:], 16)
-                if baseaddr < 0:
-                    baseaddr += (2 * sys.maxint + 2)
-                offset = int(pieces[2][1:])
-                addr = baseaddr + offset
-                data = pieces[3].replace(':', '').decode('hex')
-                coderange = CodeRange(None, addr, data)
-                ranges[addr] = coderange
+        world.parse(entry.splitlines(True))
     dumps = {}
-    for rang in sorted(ranges.values()):
-        addr = rang.addr
-        if addr in addrs and addrs[addr]:
-            name = addrs[addr].pop(0) # they should come in order
-            data = rang.data.encode('hex') # backward compatibility
-            dumps[name] = (backend_name, addr, data)
+    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)
     loops = []
     cat = extract_category(log, 'jit-log-opt')
     if not cat:
@@ -468,9 +450,6 @@
                               parser.postprocess(loop, backend_tp=bname,
                                                  backend_dump=dump,
                                                  dump_start=start_ofs))
-            loop.start_ofs = start_ofs
-        else:
-            loop.start_ofs = -1
         loops += split_trace(loop)
     return log, loops
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to