[pypy-commit] pypy default: merge jitlog-32bit and document branch

plan_rich pypy.commits at gmail.com
Mon Jul 25 12:06:00 EDT 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: 
Changeset: r85862:fac5eed8e650
Date: 2016-07-25 18:05 +0200
http://bitbucket.org/pypy/pypy/changeset/fac5eed8e650/

Log:	merge jitlog-32bit and document branch

diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -97,3 +97,7 @@
 .. branch: new-jit-log
 
 The new logging facility that integrates with and adds features to vmprof.com.
+
+.. branch: jitlog-32bit
+
+Resolve issues to use the new logging facility on a 32bit system
diff --git a/rpython/rlib/rjitlog/rjitlog.py b/rpython/rlib/rjitlog/rjitlog.py
--- a/rpython/rlib/rjitlog/rjitlog.py
+++ b/rpython/rlib/rjitlog/rjitlog.py
@@ -1,6 +1,5 @@
 import py
 import sys
-import sys
 import weakref
 import struct
 import os
@@ -281,8 +280,11 @@
 def assemble_header():
     version = JITLOG_VERSION_16BIT_LE
     count = len(resoperations.opname)
+    is_32bit = chr(0x1)
+    if not IS_32_BIT:
+        is_32bit = chr(0x0)
     content = [version, MARK_RESOP_META,
-               encode_le_16bit(count)]
+               is_32bit, encode_le_16bit(count)]
     for opnum, opname in resoperations.opname.items():
         content.append(encode_le_16bit(opnum))
         content.append(encode_str(opname.lower()))
@@ -303,7 +305,7 @@
     def __init__(self, cpu=None):
         self.cpu = cpu
         self.memo = {}
-        self.trace_id = -1
+        self.trace_id = 0
         self.metainterp_sd = None
         # legacy
         self.logger_ops = None
diff --git a/rpython/rlib/rjitlog/test/test_jitlog.py b/rpython/rlib/rjitlog/test/test_jitlog.py
--- a/rpython/rlib/rjitlog/test/test_jitlog.py
+++ b/rpython/rlib/rjitlog/test/test_jitlog.py
@@ -55,9 +55,10 @@
         fd.close()
         logger.finish()
         binary = file.read()
-        assert binary == (jl.MARK_START_TRACE) + jl.encode_le_addr(0) + \
+        is_32bit = chr(sys.maxint == 2**31-1)
+        assert binary == (jl.MARK_START_TRACE) + jl.encode_le_addr(1) + \
                          jl.encode_str('loop') + jl.encode_le_addr(0) + \
-                         (jl.MARK_TRACE) + jl.encode_le_addr(0) + \
+                         (jl.MARK_TRACE) + jl.encode_le_addr(1) + \
                          (jl.MARK_INPUT_ARGS) + jl.encode_str('') + \
                          (jl.MARK_INIT_MERGE_POINT) + b'\x05\x00\x01s\x00i\x08s\x00i\x10s' + \
                          (jl.MARK_MERGE_POINT) + \


More information about the pypy-commit mailing list