Author: Richard Plangger <[email protected]>
Branch: jitlog-32bit
Changeset: r85864:ecef6ae71893
Date: 2016-07-25 21:10 +0200
http://bitbucket.org/pypy/pypy/changeset/ecef6ae71893/

Log:    do not subroutine call encode_le_32bit, but inline it directly into
        encode_str

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
@@ -92,7 +92,12 @@
 
 @always_inline
 def encode_str(string):
-    return encode_le_32bit(len(string)) + string
+    val = len(string)
+    return ''.join([chr((val >> 0) & 0xff),
+                    chr((val >> 8) & 0xff),
+                    chr((val >> 16) & 0xff),
+                    chr((val >> 24) & 0xff),
+                    string])
 
 @always_inline
 def encode_le_16bit(val):
@@ -131,7 +136,7 @@
     elif type == "i":
         return encode_le_32bit(value)
     elif type == "h":
-        return encode_le_32bit(value)
+        return encode_le_16bit(value)
     else:
         raise NotImplementedError
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to