Commits

Remi Meier  committed 4fc00f2

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)

  • Participants
  • Parent commits d3957e5
  • Branches stmgc-c7

Comments (0)

Files changed (3)

File rpython/jit/backend/llsupport/stmrewrite.py

         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()

File rpython/memory/gctransform/stmframework.py

     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):

File rpython/translator/stm/inevitable.py

     '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',
             return funcptr._name + '()'
         except AttributeError:
             return True
-        
+
     elif op.opname == 'indirect_call':
         tographs = op.args[-1].value
         if tographs is not None:
             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: