Author: Remi Meier
Branch: stmgc-c7
Changeset: r70295:4fc00f232e44
Date: 2014-03-26 14:35 +0100
http://bitbucket.org/pypy/pypy/changeset/4fc00f232e44/

Log:    probably fixes something (call_assembler didn't assume next op could
        be in a new transaction & it looks like we didn't save roots around
        some llops)

diff --git a/rpython/jit/backend/llsupport/stmrewrite.py 
b/rpython/jit/backend/llsupport/stmrewrite.py
--- a/rpython/jit/backend/llsupport/stmrewrite.py
+++ b/rpython/jit/backend/llsupport/stmrewrite.py
@@ -96,6 +96,12 @@
         assert not op.is_call() and not op.is_malloc()
         self.fallback_inevitable(op)
 
+    def handle_call_assembler(self, op):
+        # required, because this op is only handled in super class
+        # and we didn't call this line yet:
+        self.next_op_may_be_in_new_transaction()
+        GcRewriterAssembler.handle_call_assembler(self, op)
+
     def next_op_may_be_in_new_transaction(self):
         self.always_inevitable = False
         self.read_barrier_applied.clear()
diff --git a/rpython/memory/gctransform/stmframework.py 
b/rpython/memory/gctransform/stmframework.py
--- a/rpython/memory/gctransform/stmframework.py
+++ b/rpython/memory/gctransform/stmframework.py
@@ -113,17 +113,18 @@
     def gct_gc_can_move(self, hop):
         hop.rename('stm_can_move')
 
-##    def _gct_with_roots_pushed(self, hop):
-##        livevars = self.push_roots(hop)
-##        self.default(hop)
-##        self.pop_roots(hop, livevars)
+    def _gct_with_roots_pushed(self, hop):
+        livevars = self.push_roots(hop)
+        self.default(hop)
+        self.pop_roots(hop, livevars)
 
-##    # sync with lloperation.py
-##    gct_stm_become_inevitable                       = _gct_with_roots_pushed
-##    gct_stm_partial_commit_and_resume_other_threads = _gct_with_roots_pushed
-##    gct_stm_perform_transaction                     = _gct_with_roots_pushed
-##    gct_stm_inspect_abort_info                      = _gct_with_roots_pushed
-##    gct_stm_threadlocalref_set                      = _gct_with_roots_pushed
+    # sync with lloperation.py
+    gct_stm_become_inevitable                       = _gct_with_roots_pushed
+
+    gct_stm_become_globally_unique_transaction      = _gct_with_roots_pushed
+    gct_stm_perform_transaction                     = _gct_with_roots_pushed
+    gct_stm_inspect_abort_info                      = _gct_with_roots_pushed
+    gct_stm_threadlocalref_set                      = _gct_with_roots_pushed
 
 
 class StmRootWalker(BaseRootWalker):
diff --git a/rpython/translator/stm/inevitable.py 
b/rpython/translator/stm/inevitable.py
--- a/rpython/translator/stm/inevitable.py
+++ b/rpython/translator/stm/inevitable.py
@@ -16,7 +16,7 @@
     'jit_force_quasi_immutable', 'jit_marker', 'jit_is_virtual',
     'jit_record_known_class',
     'gc_identityhash', 'gc_id', 'gc_can_move', 'gc__collect',
-    'gc_adr_of_root_stack_top',
+    'gc_adr_of_root_stack_top', 'gc_add_memory_pressure',
     'weakref_create', 'weakref_deref',
     'stm_threadlocalref_get', 'stm_threadlocalref_set',
     'stm_threadlocalref_count', 'stm_threadlocalref_addr',
@@ -68,7 +68,7 @@
             return funcptr._name + '()'
         except AttributeError:
             return True
-        
+
     elif op.opname == 'indirect_call':
         tographs = op.args[-1].value
         if tographs is not None:
@@ -76,10 +76,10 @@
             return False
         # unknown function
         return True
-        
+
     assert False
-    
-    
+
+
 def should_turn_inevitable(op, block, fresh_mallocs):
     # Always-allowed operations never cause a 'turn inevitable'
     if op.opname in ALWAYS_ALLOW_OPERATIONS:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to