[pypy-commit] pypy stmgc-c7: Use stm stack markers

arigo noreply at buildbot.pypy.org
Wed Apr 16 17:40:08 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r70661:7ea6e9a3e2b8
Date: 2014-04-16 17:30 +0200
http://bitbucket.org/pypy/pypy/changeset/7ea6e9a3e2b8/

Log:	Use stm stack markers

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
@@ -859,11 +859,18 @@
         # (ebp is a writeable object and does not need a write-barrier
         # again (ensured by the code calling the loop))
         self.mc.MOV(ebx, self.heap_shadowstack_top())
-        self.mc.MOV_mr((self.SEGMENT_NO, ebx.value, 0), ebp.value)
-                                                      # MOV [ebx], ebp
         if self.cpu.gc_ll_descr.stm:
+            self.mc.MOV_mi((self.SEGMENT_NO, ebx.value, 0),
+                           rstm.STM_STACK_MARKER_NEW) # MOV [ebx], MARKER_NEW
+            self.mc.MOV_mr((self.SEGMENT_NO, ebx.value, WORD),
+                           ebp.value)                 # MOV [ebx+WORD], ebp
             self.mc.MOV_sr(STM_OLD_SHADOWSTACK, ebx.value)
-        self.mc.ADD_ri(ebx.value, WORD)
+                                                      # MOV [esp+xx], ebx
+            self.mc.ADD_ri(ebx.value, 2 * WORD)
+        else:
+            self.mc.MOV_mr((self.SEGMENT_NO, ebx.value, 0),
+                           ebp.value)                 # MOV [ebx], ebp
+            self.mc.ADD_ri(ebx.value, WORD)
         self.mc.MOV(self.heap_shadowstack_top(), ebx) # MOV [rootstacktop], ebx
 
     def _call_footer_shadowstack(self):
diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -12,6 +12,8 @@
 TID = rffi.UINT
 tid_offset = CFlexSymbolic('offsetof(struct rpyobj_s, tid)')
 stm_nb_segments = CFlexSymbolic('STM_NB_SEGMENTS')
+stm_stack_marker_new = CFlexSymbolic('STM_STACK_MARKER_NEW')
+stm_stack_marker_old = CFlexSymbolic('STM_STACK_MARKER_OLD')
 adr_nursery_free = CFlexSymbolic('((long)&STM_SEGMENT->nursery_current)')
 adr_nursery_top  = CFlexSymbolic('((long)&STM_SEGMENT->nursery_end)')
 adr_pypy_stm_nursery_low_fill_mark = (


More information about the pypy-commit mailing list