Commits

Armin Rigo committed f654eab Merge

hg merge default

  • Participants
  • Parent commits 5d8f681, 805e3e5
  • Branches op_malloc_gc

Comments (0)

Files changed (2)

File pypy/jit/backend/llsupport/llmodel.py

 
         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
         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],
 
     _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)

File pypy/jit/backend/x86/assembler.py

         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()
         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)