[pypy-commit] pypy op_malloc_gc: hg merge default

arigo noreply at buildbot.pypy.org
Mon Dec 19 07:45:45 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: op_malloc_gc
Changeset: r50697:f654eab08551
Date: 2011-12-19 07:45 +0100
http://bitbucket.org/pypy/pypy/changeset/f654eab08551/

Log:	hg merge default

diff --git a/pypy/jit/backend/llsupport/llmodel.py b/pypy/jit/backend/llsupport/llmodel.py
--- a/pypy/jit/backend/llsupport/llmodel.py
+++ b/pypy/jit/backend/llsupport/llmodel.py
@@ -108,7 +108,8 @@
 
         def save_exception_memoryerr():
             save_exception()
-            self.saved_exc_value = "memoryerror!"    # for tests
+            if not self.saved_exc_value:
+                self.saved_exc_value = "memoryerror!"    # for tests
 
         self.pos_exception = pos_exception
         self.pos_exc_value = pos_exc_value
@@ -141,9 +142,11 @@
         def save_exception_memoryerr():
             from pypy.rpython.annlowlevel import cast_instance_to_base_ptr
             save_exception()
-            exc = MemoryError()
-            exc = cast_instance_to_base_ptr(exc)
-            self.saved_exc_value = lltype.cast_opaque_ptr(llmemory.GCREF, exc)
+            if not self.saved_exc_value:
+                exc = MemoryError()
+                exc = cast_instance_to_base_ptr(exc)
+                exc = lltype.cast_opaque_ptr(llmemory.GCREF, exc)
+                self.saved_exc_value = exc
 
         from pypy.rlib import rstack
         STACK_CHECK_SLOWPATH = lltype.Ptr(lltype.FuncType([lltype.Signed],
@@ -192,8 +195,9 @@
 
     _ON_JIT_LEAVE_FUNC = lltype.Ptr(lltype.FuncType([], lltype.Void))
 
-    def get_on_leave_jitted_int(self, save_exception, memoryerror=False):
-        if memoryerror:
+    def get_on_leave_jitted_int(self, save_exception,
+                                default_to_memoryerror=False):
+        if default_to_memoryerror:
             f = llhelper(self._ON_JIT_LEAVE_FUNC, self.on_leave_jitted_memoryerr)
         elif save_exception:
             f = llhelper(self._ON_JIT_LEAVE_FUNC, self.on_leave_jitted_save_exc)
diff --git a/pypy/jit/backend/x86/assembler.py b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -258,7 +258,7 @@
         self.mc = codebuf.MachineCodeBlockWrapper()
         # call on_leave_jitted_save_exc()
         addr = self.cpu.get_on_leave_jitted_int(save_exception=True,
-                                                memoryerror=True)
+                                                default_to_memoryerror=True)
         self.mc.CALL(imm(addr))
         self.mc.MOV_ri(eax.value, self.cpu.propagate_exception_v)
         self._call_footer()
@@ -848,8 +848,8 @@
         high_part = rffi.cast(rffi.CArrayPtr(rffi.INT), from_loc.value)[1]
         low_part  = intmask(low_part)
         high_part = intmask(high_part)
-        self.mc.MOV_bi(to_loc.value,     low_part)
-        self.mc.MOV_bi(to_loc.value + 4, high_part)
+        self.mc.MOV32_bi(to_loc.value,     low_part)
+        self.mc.MOV32_bi(to_loc.value + 4, high_part)
 
     def regalloc_perform(self, op, arglocs, resloc):
         genop_list[op.getopnum()](self, op, arglocs, resloc)


More information about the pypy-commit mailing list