Author: Antonio Cuni <[email protected]>
Branch: faster-rstruct
Changeset: r80671:ec2db01088b1
Date: 2015-11-14 02:08 +0100
http://bitbucket.org/pypy/pypy/changeset/ec2db01088b1/

Log:    hg merge default

diff --git a/pypy/module/cpyext/pystrtod.py b/pypy/module/cpyext/pystrtod.py
--- a/pypy/module/cpyext/pystrtod.py
+++ b/pypy/module/cpyext/pystrtod.py
@@ -5,6 +5,7 @@
 from rpython.rlib import rdtoa
 from rpython.rlib import rfloat
 from rpython.rlib import rposix, jit
+from rpython.rlib.rarithmetic import intmask
 from rpython.rtyper.lltypesystem import lltype
 from rpython.rtyper.lltypesystem import rffi
 
@@ -112,7 +113,9 @@
     NULL if the conversion failed. The caller is responsible for freeing the
     returned string by calling PyMem_Free().
     """
-    buffer, rtype = rfloat.double_to_string(val, format_code, precision, flags)
+    buffer, rtype = rfloat.double_to_string(val, format_code,
+                                            intmask(precision),
+                                            intmask(flags))
     if ptype != lltype.nullptr(rffi.INTP.TO):
         ptype[0] = rffi.cast(rffi.INT, DOUBLE_TO_STRING_TYPES_MAP[rtype])
     bufp = rffi.str2charp(buffer)
diff --git a/rpython/jit/backend/llsupport/rewrite.py 
b/rpython/jit/backend/llsupport/rewrite.py
--- a/rpython/jit/backend/llsupport/rewrite.py
+++ b/rpython/jit/backend/llsupport/rewrite.py
@@ -120,13 +120,14 @@
         # this case means between CALLs or unknown-size mallocs.
         #
         operations = self.remove_bridge_exception(operations)
-        self._source_operations = operations
+        self._changed_op = None
         for i in range(len(operations)):
-            self._current_position = i
             op = operations[i]
             assert op.get_forwarded() is None
             if op.getopnum() == rop.DEBUG_MERGE_POINT:
                 continue
+            if op is self._changed_op:
+                op = self._changed_op_to
             # ---------- GETFIELD_GC ----------
             if op.getopnum() in (rop.GETFIELD_GC_I, rop.GETFIELD_GC_F,
                                  rop.GETFIELD_GC_R):
@@ -213,11 +214,10 @@
         self.emit_op(op1)
         lst = op.getfailargs()[:]
         lst[i] = op1
-        operations = self._source_operations
-        assert operations[self._current_position + 1] is op
         newop = op.copy_and_change(opnum)
         newop.setfailargs(lst)
-        operations[self._current_position + 1] = newop
+        self._changed_op = op
+        self._changed_op_to = newop
 
     # ----------
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to