Author: Richard Plangger <planri...@gmail.com>
Branch: new-jit-log
Changeset: r83913:ef963d113f77
Date: 2016-04-26 17:20 +0200
http://bitbucket.org/pypy/pypy/changeset/ef963d113f77/

Log:    init merge point needs a counter before encoding the types, removed
        one wrong start_new_trace which started a trace too often!

diff --git a/rpython/jit/metainterp/compile.py 
b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -512,7 +512,6 @@
 
 def send_loop_to_backend(greenkey, jitdriver_sd, metainterp_sd, loop, type,
                          orig_inpargs, memo):
-    metainterp_sd.jitlog.start_new_trace(metainterp_sd, None, type == "entry 
bridge")
     forget_optimization_info(loop.operations)
     forget_optimization_info(loop.inputargs)
     vinfo = jitdriver_sd.virtualizable_info
diff --git a/rpython/rlib/jitlog.py b/rpython/rlib/jitlog.py
--- a/rpython/rlib/jitlog.py
+++ b/rpython/rlib/jitlog.py
@@ -188,6 +188,24 @@
     for mark, in marks:
         print '%s = chr(%s)' % ('MARK_' + mark, hex(globals()['MARK_' + mark]))
     print 'MARK_JITLOG_END = chr(%s)' % hex(start)
+    for key,value in locals().items():
+        if key.startswith("MP_"):
+            print '%s = (%s,"%s")' % (key, hex(value[0]), value[1])
+    print 'SEM_TYPE_NAMES = {'
+    for key,value in locals().items():
+        if key.startswith("MP_") and value[0] != 0:
+            print '    %s: "%s",' % (hex(value[0]), key[3:].lower())
+    print '}'
+
+MP_STR = (0x0, "s")
+MP_INT = (0x0, "i")
+
+# concrete parameters
+MP_FILENAME = (0x1, "s")
+MP_LINENO = (0x2, "i")
+MP_INDEX = (0x4, "i")
+MP_SCOPE = (0x8, "s")
+MP_OPCODE = (0x10, "s")
 
 del marks
 del start
@@ -391,7 +409,8 @@
             for i, (semantic_type, generic_type) in enumerate(types):
                 encoded_types.append(chr(semantic_type))
                 encoded_types.append(generic_type)
-            log._write_marked(MARK_INIT_MERGE_POINT, ''.join(encoded_types))
+            count = encode_le_16bit(len(types))
+            log._write_marked(MARK_INIT_MERGE_POINT, count + 
''.join(encoded_types))
 
         # the types have already been written
         encoded = encode_merge_point(log, self.common_prefix, values)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to