Author: Maciej Fijalkowski <[email protected]>
Branch: jitframe-on-heap
Changeset: r60200:4bf8cd0f1d34
Date: 2013-01-19 13:17 +0200
http://bitbucket.org/pypy/pypy/changeset/4bf8cd0f1d34/
Log: shadowstack support, disable stackchecking for now
diff --git a/pypy/jit/backend/llsupport/gc.py b/pypy/jit/backend/llsupport/gc.py
--- a/pypy/jit/backend/llsupport/gc.py
+++ b/pypy/jit/backend/llsupport/gc.py
@@ -241,6 +241,10 @@
def register_asm_addr(self, start, mark):
pass
+ def get_root_stack_top_addr(self):
+ rst_addr = llop.gc_adr_of_root_stack_top(llmemory.Address)
+ return rffi.cast(lltype.Signed, rst_addr)
+
class WriteBarrierDescr(AbstractDescr):
def __init__(self, gc_ll_descr):
self.llop1 = gc_ll_descr.llop1
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
@@ -253,8 +253,8 @@
def _build_stack_check_slowpath(self):
_, _, slowpathaddr = self.cpu.insert_stack_check()
- if slowpathaddr == 0 or not self.cpu.propagate_exception_descr:
- return # no stack check (for tests, or non-translated)
+ #if slowpathaddr == 0 or not self.cpu.propagate_exception_descr:
+ return # no stack check (for tests, or non-translated)
xxx
#
# make a "function" that is called immediately at the start of
@@ -852,23 +852,23 @@
self.mc.MOV_ri(r13.value, rst) # MOV r13, rootstacktop
self.mc.MOV_rm(eax.value, (r13.value, 0)) # MOV eax, [r13]
#
- MARKER = gcrootmap.MARKER_FRAME
- self.mc.LEA_rm(ebx.value, (eax.value, 2*WORD)) # LEA ebx, [eax+2*WORD]
- self.mc.MOV_mi((eax.value, WORD), MARKER) # MOV [eax+WORD], MARKER
- self.mc.MOV_mr((eax.value, 0), ebp.value) # MOV [eax], ebp
- #
+ if IS_X86_64:
+ self.mc.MOV_mr((eax.value, 0), edi.value) # MOV [eax], edi
+ else:
+ xxx
+ self.mc.ADD_ri(eax.value, WORD)
if rx86.fits_in_32bits(rst):
- self.mc.MOV_jr(rst, ebx.value) # MOV [rootstacktop], ebx
+ self.mc.MOV_jr(rst, eax.value) # MOV [rootstacktop], eax
else:
- self.mc.MOV_mr((r13.value, 0), ebx.value) # MOV [r13], ebx
+ self.mc.MOV_mr((r13.value, 0), eax.value) # MOV [r13], eax
def _call_footer_shadowstack(self, gcrootmap):
rst = gcrootmap.get_root_stack_top_addr()
if rx86.fits_in_32bits(rst):
- self.mc.SUB_ji8(rst, 2*WORD) # SUB [rootstacktop], 2*WORD
+ self.mc.SUB_ji8(rst, WORD) # SUB [rootstacktop], WORD
else:
self.mc.MOV_ri(ebx.value, rst) # MOV ebx, rootstacktop
- self.mc.SUB_mi8((ebx.value, 0), 2*WORD) # SUB [ebx], 2*WORD
+ self.mc.SUB_mi8((ebx.value, 0), WORD) # SUB [ebx], WORD
def redirect_call_assembler(self, oldlooptoken, newlooptoken):
# some minimal sanity checking
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit