[pypy-commit] pypy jitframe-on-heap: leave this check in

fijal noreply at buildbot.pypy.org
Wed Jan 23 22:27:01 CET 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r60403:4e6a23ba8977
Date: 2013-01-23 23:26 +0200
http://bitbucket.org/pypy/pypy/changeset/4e6a23ba8977/

Log:	leave this check in

diff --git a/rpython/jit/backend/llsupport/llmodel.py b/rpython/jit/backend/llsupport/llmodel.py
--- a/rpython/jit/backend/llsupport/llmodel.py
+++ b/rpython/jit/backend/llsupport/llmodel.py
@@ -52,11 +52,12 @@
         pass
 
     def _setup_frame_realloc(self, translate_support_code):
-        FUNC_TP = lltype.Ptr(lltype.FuncType([llmemory.GCREF],
+        FUNC_TP = lltype.Ptr(lltype.FuncType([llmemory.GCREF, lltype.Signed],
                                              llmemory.GCREF))
 
-        def realloc_frame(frame, size, asm):
+        def realloc_frame(frame, size):
             frame = lltype.cast_opaque_ptr(jitframe.JITFRAMEPTR, frame)
+            assert size <= frame.jf_frame_info.jfi_frame_depth
             new_frame = jitframe.JITFRAME.allocate(frame.jf_frame_info)
             # XXX now we know, rewrite this
             # we need to do this, because we're not sure what things
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
@@ -202,7 +202,6 @@
         gcmap_ofs = self.cpu.get_ofs_of_frame_field('jf_gcmap')
         mc.MOV_br(gcmap_ofs, ecx.value)
         mc.MOV_rs(esi.value, WORD*2)
-        mc.MOV_rs(edx.value, WORD*3)
         # push first arg
         mc.LEA_rb(edi.value, -base_ofs)
         # align
@@ -589,8 +588,8 @@
                                              operations,
                                              self.current_clt.allgcrefs,
                                              self.current_clt.frame_info)
-        stack_check_patch_ofs = self._check_frame_depth(self.mc,
-                                                         regalloc.get_gcmap())
+        stack_check_patch_ofs, ofs2 = self._check_frame_depth(self.mc,
+                                                       regalloc.get_gcmap())
         frame_depth = self._assemble(regalloc, inputargs, operations)
         codeendpos = self.mc.get_relative_pos()
         self.write_pending_failure_recoveries()
@@ -611,6 +610,7 @@
         frame_depth = max(self.current_clt.frame_info.jfi_frame_depth,
                           frame_depth + JITFRAME_FIXED_SIZE)
         self._patch_stackadjust(stack_check_patch_ofs + rawstart, frame_depth)
+        self._patch_stackadjust(ofs2 + rawstart, frame_depth)
         self.fixup_target_tokens(rawstart)
         self.update_frame_depth(frame_depth)
         self.teardown()
@@ -696,13 +696,15 @@
         assert not IS_X86_32
         mc.J_il8(rx86.Conditions['GE'], 0)
         jg_location = mc.get_relative_pos()
+        mc.MOV_si(0, 0xffffff)
+        ofs2 = mc.get_relative_pos() - 4
         self.push_gcmap(mc, gcmap, mov=True)
         mc.CALL(imm(self._stack_check_failure))
         # patch the JG above
         offset = mc.get_relative_pos() - jg_location
         assert 0 < offset <= 127
         mc.overwrite(jg_location-1, chr(offset))
-        return stack_check_cmp_ofs
+        return stack_check_cmp_ofs, ofs2
 
     def _patch_stackadjust(self, adr, allocated_depth):
         mc = codebuf.MachineCodeBlockWrapper()


More information about the pypy-commit mailing list