[pypy-commit] pypy stmgc-c7: Fixes for test_stm_atomic

arigo noreply at buildbot.pypy.org
Wed Mar 12 09:39:52 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r69889:fafe0f9d754c
Date: 2014-03-12 09:39 +0100
http://bitbucket.org/pypy/pypy/changeset/fafe0f9d754c/

Log:	Fixes for test_stm_atomic

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
@@ -441,6 +441,10 @@
     'stm_threadlocal_get':    LLOp(sideeffects=False),
     'stm_threadlocal_set':    LLOp(),
 
+    'stm_increment_atomic':   LLOp(),
+    'stm_decrement_atomic':   LLOp(),
+    'stm_get_atomic':         LLOp(sideeffects=False),
+
 ##    'stm_allocate_nonmovable_int_adr': LLOp(sideeffects=False, canmallocgc=True),
 ##    'stm_become_inevitable':  LLOp(canmallocgc=True),
 ##    'stm_stop_all_other_threads': LLOp(canmallocgc=True),
@@ -449,9 +453,6 @@
 ##    'stm_major_collect':      LLOp(canmallocgc=True),
 ##    'stm_get_tid':            LLOp(canfold=True),
 ##    'stm_ptr_eq':             LLOp(canfold=True),
-##    'stm_change_atomic':      LLOp(),
-##    'stm_get_atomic':         LLOp(sideeffects=False),
-##    'stm_perform_transaction':LLOp(canmallocgc=True),
 ##    'stm_abort_and_retry':    LLOp(canmallocgc=True),
 
 ##    'stm_weakref_allocate':   LLOp(sideeffects=False, canmallocgc=True),
diff --git a/rpython/translator/stm/funcgen.py b/rpython/translator/stm/funcgen.py
--- a/rpython/translator/stm/funcgen.py
+++ b/rpython/translator/stm/funcgen.py
@@ -171,6 +171,16 @@
     return ('pypy_stm_perform_transaction((object_t *)%s, '
             '(int(*)(object_t *, int))%s);' % (arg0, arg1))
 
+def stm_increment_atomic(funcgen, op):
+    return 'pypy_stm_increment_atomic();'
+
+def stm_decrement_atomic(funcgen, op):
+    return 'pypy_stm_decrement_atomic();'
+
+def stm_get_atomic(funcgen, op):
+    result = funcgen.expr(op.result)
+    return '%s = pypy_stm_get_atomic();' % (result,)
+
 
 ##def stm_initialize(funcgen, op):
 ##    return '''stm_initialize();
@@ -301,14 +311,6 @@
 ##    result = funcgen.expr(op.result)
 ##    return '%s = ((struct rpyobj_s*)%s)->tid;' % (result, arg0)
 
-##def stm_change_atomic(funcgen, op):
-##    arg0 = funcgen.expr(op.args[0])
-##    return 'stm_atomic(%s);' % (arg0,)
-
-##def stm_get_atomic(funcgen, op):
-##    result = funcgen.expr(op.result)
-##    return '%s = stm_atomic(0);' % (result,)
-
 ##def stm_enter_callback_call(funcgen, op):
 ##    result = funcgen.expr(op.result)
 ##    return '%s = stm_enter_callback_call();' % (result,)


More information about the pypy-commit mailing list