1. Pypy
  2. Untitled project
  3. pypy

Commits

Remi Meier  committed 162a671

treat OS_JIT_STM_SHOULD_BREAK_TRANSACTION as a non-collecting function in the jit

  • Participants
  • Parent commits 1f646fa
  • Branches stmgc-c4

Comments (0)

Files changed (2)

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

View file
                 continue
             # ----------  calls  ----------
             if op.is_call():
+                if opnum == rop.CALL and op.getdescr():
+                    d = op.getdescr()
+                    assert isinstance(d, CallDescr)
+                    ei = d.get_extra_info()
+                    if ei and ei.oopspecindex == EffectInfo.OS_JIT_STM_SHOULD_BREAK_TRANSACTION:
+                        self.newops.append(op)
+                        continue
+                    
                 self.emitting_an_operation_that_can_collect()
                 self.next_op_may_be_in_new_transaction()
                                     

File rpython/jit/backend/x86/assembler.py

View file
         cb = callbuilder.CallBuilder(self, arglocs[2], arglocs[3:], resloc)
 
         descr = op.getdescr()
+        effectinfo = descr.get_extra_info()
         assert isinstance(descr, CallDescr)
         cb.callconv = descr.get_call_conv()
         cb.argtypes = descr.get_arg_types()
         assert isinstance(signloc, ImmedLoc)
         cb.ressign = signloc.value
 
-        if is_call_release_gil:
+        if effectinfo and effectinfo.oopspecindex == EffectInfo.OS_JIT_STM_SHOULD_BREAK_TRANSACTION:
+            cb.emit_no_collect()
+        elif is_call_release_gil:
             cb.emit_call_release_gil()
         else:
             cb.emit()