[pypy-commit] pypy jitframe-on-heap: use this also in malloc slowpath

fijal noreply at buildbot.pypy.org
Mon Jan 21 11:39:28 CET 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r60292:3f75b755c718
Date: 2013-01-21 12:39 +0200
http://bitbucket.org/pypy/pypy/changeset/3f75b755c718/

Log:	use this also in malloc slowpath

diff --git a/rpython/jit/backend/x86/assembler.py b/rpython/jit/backend/x86/assembler.py
--- a/rpython/jit/backend/x86/assembler.py
+++ b/rpython/jit/backend/x86/assembler.py
@@ -215,6 +215,7 @@
         mc.MOV(edi, heap(nursery_free_adr))   # load this in EDX
         # clear the gc pattern
         mc.MOV_bi(ofs, 0)
+        self._reload_frame_if_necessary(mc)
         mc.RET()
         #
         # If the slowpath malloc failed, we raise a MemoryError that
@@ -1228,13 +1229,16 @@
         self.mc.CALL(x)
         if align:
             self.mc.ADD_ri(esp.value, align * WORD)
+        self._reload_frame_if_necessary(self.mc)
+
+    def _reload_frame_if_necessary(self, mc):
         gcrootmap = self.cpu.gc_ll_descr.gcrootmap
         if gcrootmap and gcrootmap.is_shadow_stack:
             rst = gcrootmap.get_root_stack_top_addr()
-            self.mc.MOV(edx, heap(rst))
-            self.mc.MOV(ebp, mem(edx, -WORD))
+            mc.MOV(edx, heap(rst))
+            mc.MOV(ebp, mem(edx, -WORD))
             base_ofs = self.cpu.get_baseofs_of_frame_field()
-            self.mc.ADD_ri(ebp.value, base_ofs)
+            mc.ADD_ri(ebp.value, base_ofs)
 
     def call(self, addr, args, res):
         self._emit_call(imm(addr), args)


More information about the pypy-commit mailing list