Author: Richard Plangger <planri...@gmail.com>
Branch: new-jit-log
Changeset: r83726:4f0c9af6057b
Date: 2016-04-15 11:18 +0200
http://bitbucket.org/pypy/pypy/changeset/4f0c9af6057b/

Log:    instead of many, only one syscall to write is executed while
        initializing the jitlog (even slows down the test execution)

diff --git a/rpython/jit/metainterp/jitlog.py b/rpython/jit/metainterp/jitlog.py
--- a/rpython/jit/metainterp/jitlog.py
+++ b/rpython/jit/metainterp/jitlog.py
@@ -97,9 +97,12 @@
 
         count = len(resoperations.opname)
         mark = MARK_RESOP_META
+        content = [encode_le_16bit(len(resoperations.opname))]
         for opnum, opname in resoperations.opname.items():
-            line = encode_le_16bit(opnum) + encode_str(opname.lower())
-            cintf.jitlog_write_marked(mark, line, len(line))
+            content.append(encode_le_16bit(opnum))
+            content.append(encode_str(opname.lower()))
+        blob = ''.join(content)
+        cintf.jitlog_write_marked(MARK_RESOP_META, blob, len(blob))
 
     def finish(self):
         self.cintf.jitlog_teardown()
@@ -261,6 +264,7 @@
         dump = []
 
         start_offset = ops_offset[op]
+        assert start_offset >= 0
         # end offset is either the last pos in the assembler
         # or the offset of op2
         if op2 is None:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to