[pypy-commit] pypy jitframe-on-heap: Fixes for saving registers while reloading frame. Test coming
fijal
noreply at buildbot.pypy.org
Tue Feb 19 09:21:27 CET 2013
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r61440:ef27c4b585bb
Date: 2013-02-19 10:20 +0200
http://bitbucket.org/pypy/pypy/changeset/ef27c4b585bb/
Log: Fixes for saving registers while reloading frame. Test coming
diff --git a/rpython/jit/backend/llsupport/test/test_gc_integration.py b/rpython/jit/backend/llsupport/test/test_gc_integration.py
--- a/rpython/jit/backend/llsupport/test/test_gc_integration.py
+++ b/rpython/jit/backend/llsupport/test/test_gc_integration.py
@@ -579,6 +579,10 @@
item = rffi.cast(lltype.Ptr(S), frame.jf_frame[gcmap[0]])
assert item == new_items[2]
+ def test_shadowstack_collecting_call_float(self):
+ cpu = self.cpu
+ xxx
+
def test_malloc_1(self):
cpu = self.cpu
sizeof = cpu.sizeof(self.S)
diff --git a/rpython/jit/backend/x86/arch.py b/rpython/jit/backend/x86/arch.py
--- a/rpython/jit/backend/x86/arch.py
+++ b/rpython/jit/backend/x86/arch.py
@@ -30,9 +30,9 @@
# start of every frame: the saved value of some registers
if WORD == 4:
- # ebp + ebx + esi + edi + 6 extra words + return address = 9 words
- FRAME_FIXED_SIZE = 11
- PASS_ON_MY_FRAME = 6
+ # ebp + ebx + esi + edi + 12 extra words + return address = 17 words
+ FRAME_FIXED_SIZE = 17
+ PASS_ON_MY_FRAME = 12
JITFRAME_FIXED_SIZE = 6 + 8 * 2 # 6 GPR + 8 XMM * 2 WORDS/float
else:
# rbp + rbx + r12 + r13 + r14 + r15 + 12 extra words + return address = 19
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
@@ -321,8 +321,12 @@
# we're possibly called from the slowpath of malloc, so we have
# one extra CALL on the stack, but one less PUSH,
# save to store stuff 2 locations away on the stack.
+ # we have to save all the things that can potentially
+ # be returned from a call
mc.MOV_sr(3 * WORD, eax.value) # save for later
+ mc.MOVSD_sx(6 * WORD, xmm0.value)
if IS_X86_32:
+ mc.MOV_sr(4 * WORD, edx.value)
mc.SUB_ri(esp.value, 2 * WORD) # align
mc.MOV_sr(0, ebp.value)
else:
@@ -351,6 +355,8 @@
else:
if IS_X86_32:
mc.LEA_rs(esp.value, 2 * WORD)
+ mc.MOV_rs(edx.value, 4 * WORD)
+ mc.MOVSD_xs(xmm0.value, 6 * WORD)
mc.MOV_rs(eax.value, 3 * WORD) # restore
mc.RET()
More information about the pypy-commit
mailing list