Author: Remi Meier <[email protected]>
Branch: stmgc-c4
Changeset: r68606:b18d1e39ab92
Date: 2014-01-12 13:06 +0100
http://bitbucket.org/pypy/pypy/changeset/b18d1e39ab92/
Log: another test, more fixes
diff --git a/rpython/jit/metainterp/pyjitpl.py
b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -206,8 +206,10 @@
else:
return ConstInt(0)
+ @arguments()
def opimpl_stm_transaction_break(self):
- self.execute(rop.STM_TRANSACTION_BREAK)
+ self.metainterp._record_helper_nonpure_varargs(
+ rop.STM_TRANSACTION_BREAK, None, None, [])
for _opimpl in ['int_add', 'int_sub', 'int_mul', 'int_floordiv', 'int_mod',
'int_lt', 'int_le', 'int_eq',
diff --git a/rpython/jit/metainterp/resoperation.py
b/rpython/jit/metainterp/resoperation.py
--- a/rpython/jit/metainterp/resoperation.py
+++ b/rpython/jit/metainterp/resoperation.py
@@ -510,7 +510,7 @@
'QUASIIMMUT_FIELD/1d', # [objptr], descr=SlowMutateDescr
'RECORD_KNOWN_CLASS/2', # [objptr, clsptr]
'KEEPALIVE/1',
- 'STM_TRANSACTION_BREAK/1',
+ 'STM_TRANSACTION_BREAK/0',
'STM_SET_REVISION_GC/1d', # not really GC, writes raw to the header
'_CANRAISE_FIRST', # ----- start of can_raise operations -----
diff --git a/rpython/jit/metainterp/test/test_stm.py
b/rpython/jit/metainterp/test/test_stm.py
--- a/rpython/jit/metainterp/test/test_stm.py
+++ b/rpython/jit/metainterp/test/test_stm.py
@@ -24,9 +24,23 @@
res = self.interp_operations(g, [], translationoptions={"stm":True})
assert res == False
self.check_operations_history(call=1, call_may_force=1)
+
+ def test_transaction_break(self):
+ def g():
+ rstm.jit_stm_transaction_break_point()
+ return 42
+ self.interp_operations(g, [], translationoptions={"stm":True})
+ self.check_operations_history({'stm_transaction_break':1})
class TestLLtype(STMTests, LLJitMixin):
pass
+
+
+
+
+
+
+
diff --git a/rpython/rtyper/llinterp.py b/rpython/rtyper/llinterp.py
--- a/rpython/rtyper/llinterp.py
+++ b/rpython/rtyper/llinterp.py
@@ -979,7 +979,6 @@
op_stm_become_inevitable = _stm_not_implemented
op_stm_stop_all_other_threads = _stm_not_implemented
op_stm_partial_commit_and_resume_other_threads = _stm_not_implemented
- op_jit_stm_transaction_break_point = _stm_not_implemented
# __________________________________________________________
# operations on addresses
diff --git a/rpython/rtyper/lltypesystem/lloperation.py
b/rpython/rtyper/lltypesystem/lloperation.py
--- a/rpython/rtyper/lltypesystem/lloperation.py
+++ b/rpython/rtyper/lltypesystem/lloperation.py
@@ -524,7 +524,7 @@
'jit_assembler_call': LLOp(canrun=True, # similar to an 'indirect_call'
canraise=(Exception,),
canmallocgc=True),
- 'jit_stm_transaction_break_point' : LLOp(canmallocgc=True),
+ 'jit_stm_transaction_break_point' : LLOp(canrun=True,canmallocgc=True),
'jit_stm_should_break_transaction' : LLOp(canrun=True),
# __________ GC operations __________
diff --git a/rpython/rtyper/lltypesystem/opimpl.py
b/rpython/rtyper/lltypesystem/opimpl.py
--- a/rpython/rtyper/lltypesystem/opimpl.py
+++ b/rpython/rtyper/lltypesystem/opimpl.py
@@ -704,6 +704,10 @@
def op_jit_stm_should_break_transaction(if_there_is_no_other):
return False
+def op_jit_stm_transaction_break_point():
+ pass
+
+
# ____________________________________________________________
def get_op_impl(opname):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit