Author: Armin Rigo <[email protected]>
Branch: stmgc-c7-rewindjmp
Changeset: r72874:a279a16c839d
Date: 2014-08-18 12:06 +0200
http://bitbucket.org/pypy/pypy/changeset/a279a16c839d/

Log:    in-progress

diff --git a/rpython/jit/backend/llsupport/assembler.py 
b/rpython/jit/backend/llsupport/assembler.py
--- a/rpython/jit/backend/llsupport/assembler.py
+++ b/rpython/jit/backend/llsupport/assembler.py
@@ -74,9 +74,9 @@
             self.gc_minimal_size_in_nursery = 
gc_ll_descr.minimal_size_in_nursery
         else:
             self.gc_minimal_size_in_nursery = 0
-        if getattr(gc_ll_descr, 'gcheaderbuilder', None) is not None:
+        try:
             self.gc_size_of_header = gc_ll_descr.gcheaderbuilder.size_gc_header
-        else:
+        except AttributeError:
             self.gc_size_of_header = WORD # for tests
         self.memcpy_addr = self.cpu.cast_ptr_to_int(memcpy_fn)
         # building the barriers needs to happen before these:
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
@@ -856,10 +856,6 @@
         gcrootmap = self.cpu.gc_ll_descr.gcrootmap
         return self.heap_tl(gcrootmap.get_root_stack_top_addr())
 
-    def heap_rjthread(self):
-        """STM: Return an AddressLoc for '&stm_thread_local.rjthread'."""
-        return self.heap_tl(rstm.adr_rjthread)
-
     def heap_rjthread_head(self):
         """STM: Return an AddressLoc for '&stm_thread_local.rjthread.head'."""
         return self.heap_tl(rstm.adr_rjthread_head)
@@ -878,17 +874,17 @@
                                                       # MOV [ebx], ebp
         if self.cpu.gc_ll_descr.stm:
             # inlining stm_rewind_jmp_enterframe()
-            r11v = X86_64_SCRATCH_REG.value
+            r11 = X86_64_SCRATCH_REG
             rjh = self.heap_rjthread_head()
-            mc.ADD_ri8(ebx.value, 1)                 # ADD ebx, 1
-            mc.MOV_rm(r11v, rjh)                     # MOV r11, [rjthread.head]
+            mc.ADD_ri(ebx.value, 1)                  # ADD ebx, 1
+            mc.MOV(r11, rjh)                         # MOV r11, [rjthread.head]
             mc.MOV_sr(STM_SHADOWSTACK_BASE_OFS, ebx.value)
                                                      # MOV [esp+ssbase], ebx
-            mc.ADD_ri8(ebx.value, WORD-1)            # ADD ebx, 7
-            mc.MOV_sr(STM_PREV_OFS, r11v)            # MOV [esp+prev], r11
+            mc.ADD_ri(ebx.value, WORD-1)             # ADD ebx, 7
+            mc.MOV_sr(STM_PREV_OFS, r11.value)       # MOV [esp+prev], r11
             mc.MOV(self.heap_shadowstack_top(), ebx) # MOV [rootstacktop], ebx
-            mc.LEA_rs(r11v, STM_JMPBUF_OFS)          # LEA r11, [esp+bufofs]
-            mc.MOV_mr(rjh, r11v)                     # MOV [rjthread.head], r11
+            mc.LEA_rs(r11.value, STM_JMPBUF_OFS)     # LEA r11, [esp+bufofs]
+            mc.MOV(rjh, r11)                         # MOV [rjthread.head], r11
         #
         else:
             mc.ADD_ri(ebx.value, WORD)               # ADD ebx, WORD
@@ -902,16 +898,16 @@
             # that this occurs more than once.  So we have to restore
             # the old shadowstack by looking up its original saved value.
             # The rest of this is inlining stm_rewind_jmp_leaveframe().
-            r11v = X86_64_SCRATCH_REG.value
+            r11 = X86_64_SCRATCH_REG
             rjh = self.heap_rjthread_head()
             rjmovd_o_b = self.heap_rjthread_moved_off_base()
-            adr_rjthread_moved_off_base
-            mc.MOV_rs(r11v, STM_SHADOWSTACK_BASE_OFS) # MOV r11, [esp+ssbase]
-            mc.MOV_rs(ebx.value, STM_PREV_OFS)        # MOV ebx, [esp+prev]
-            mc.MOV(self.heap_shadowstack_top(), r11v) # MOV [rootstacktop], r11
-            mc.LEA_rs(r11v, STM_JMPBUF_OFS)           # LEA r11, [esp+bufofs]
-            mc.MOV_mr(rjh, ebx.value)                 # MOV [rjthread.head], 
ebx
-            mc.CMP_rm(r11v, rjmovd_o_b)               # CMP r11, 
[rjth.movd_o_b]
+            mc.MOV_rs(ebx.value, STM_SHADOWSTACK_BASE_OFS)
+                                                      # MOV ebx, [esp+ssbase]
+            mc.MOV_rs(r11.value, STM_PREV_OFS)        # MOV r11, [esp+prev]
+            mc.MOV(self.heap_shadowstack_top(), ebx)  # MOV [rootstacktop], ebx
+            mc.LEA_rs(ebx.value, STM_JMPBUF_OFS)      # LEA ebx, [esp+bufofs]
+            mc.MOV(rjh, r11)                          # MOV [rjthread.head], 
r11
+            mc.CMP(ebx, rjmovd_o_b)                   # CMP ebx, 
[rjth.movd_o_b]
             mc.J_il8(rx86.Conditions['NE'], 0)        # JNE label_below
             jne_location = mc.get_relative_pos()
             #
diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -17,12 +17,10 @@
 adr_nursery_top  = CFlexSymbolic('((long)&STM_SEGMENT->nursery_end)')
 adr_pypy_stm_nursery_low_fill_mark = (
     CFlexSymbolic('((long)&pypy_stm_nursery_low_fill_mark)'))
-adr_rjthread = (
-    CFlexSymbolic('((long)&stm_thread_local.rjthread'))
 adr_rjthread_head = (
-    CFlexSymbolic('((long)&stm_thread_local.rjthread.head'))
+    CFlexSymbolic('((long)&stm_thread_local.rjthread.head)'))
 adr_rjthread_moved_off_base = (
-    CFlexSymbolic('((long)&stm_thread_local.rjthread.moved_off_base'))
+    CFlexSymbolic('((long)&stm_thread_local.rjthread.moved_off_base)'))
 adr_transaction_read_version = (
     CFlexSymbolic('((long)&STM_SEGMENT->transaction_read_version)'))
 adr_segment_base = (
@@ -74,7 +72,7 @@
 
 @dont_look_inside
 def break_transaction():
-    llop.stm_break_transaction(lltype.Void)
+    llop.stm_transaction_break(lltype.Void)
 
 @dont_look_inside
 def set_transaction_length(fraction):
diff --git a/rpython/translator/backendopt/gilanalysis.py 
b/rpython/translator/backendopt/gilanalysis.py
--- a/rpython/translator/backendopt/gilanalysis.py
+++ b/rpython/translator/backendopt/gilanalysis.py
@@ -24,7 +24,7 @@
         return False
 
     def analyze_simple_operation(self, op, graphinfo):
-        if op.opname == 'stm_break_transaction':
+        if op.opname == 'stm_transaction_break':
             return True
         return False
 
diff --git a/rpython/translator/stm/src_stm/extracode.h 
b/rpython/translator/stm/src_stm/extracode.h
--- a/rpython/translator/stm/src_stm/extracode.h
+++ b/rpython/translator/stm/src_stm/extracode.h
@@ -77,16 +77,6 @@
     long fnlen = 1, nlen = 1, line = 0;
     char *fn = "?", *name = "?";
 
-#ifdef RPY_STM_JIT
-    if (odd_number == STM_STACK_MARKER_NEW ||
-        odd_number == STM_STACK_MARKER_OLD) {
-        assert(o);
-        /* XXX ji_jf_forward */
-        /* XXX */
-        o = NULL;
-    }
-#endif
-
     if (o) {
         co_filename   =_fetch_rpsspace0(segment_base, o, g_co_filename_ofs);
         co_name       =_fetch_rpsspace0(segment_base, o, g_co_name_ofs);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to