Author: Armin Rigo <[email protected]>
Branch: stmgc-c4
Changeset: r65111:3451bcd67240
Date: 2013-06-29 23:17 +0200
http://bitbucket.org/pypy/pypy/changeset/3451bcd67240/
Log: stm_initialize()
diff --git a/rpython/memory/gc/stmgc.py b/rpython/memory/gc/stmgc.py
--- a/rpython/memory/gc/stmgc.py
+++ b/rpython/memory/gc/stmgc.py
@@ -3,7 +3,7 @@
from rpython/translator/stm/src_stm/.
"""
-from rpython.memory.gc.base import MovingGCBase
+from rpython.memory.gc.base import GCBase, MovingGCBase
from rpython.rtyper.lltypesystem import lltype, llmemory, llgroup, rffi
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.rlib.debug import ll_assert
@@ -25,6 +25,14 @@
TRANSLATION_PARAMS = {}
+ def setup(self):
+ # Hack: MovingGCBase.setup() sets up stuff related to id(), which
+ # we implement differently anyway. So directly call GCBase.setup().
+ GCBase.setup(self)
+ #
+ llop.stm_initialize(lltype.Void)
+
+
def get_type_id(self, obj):
return llop.stm_get_tid(llgroup.HALFWORD, obj)
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
@@ -421,6 +421,7 @@
# direct_calls and maybe several casts, but it looks less heavy-weight
# to keep them as operations until the genc stage)
+ 'stm_initialize': LLOp(),
'stm_barrier': LLOp(sideeffects=False),
'stm_allocate': LLOp(sideeffects=False),
'stm_become_inevitable': LLOp(),
diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -584,6 +584,7 @@
from rpython.translator.stm.funcgen import op_stm
self.__class__.op_stm = op_stm
return self.op_stm(op)
+ OP_STM_INITIALIZE = _OP_STM
OP_STM_BECOME_INEVITABLE = _OP_STM
OP_STM_BARRIER = _OP_STM
OP_STM_PTR_EQ = _OP_STM
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
@@ -22,19 +22,8 @@
self.obj.prebuilt_hash)
-def stm_start_transaction(funcgen, op):
- xxx
- # only for testing. With stmgc, this operation should have been handled
- # already by gctransform.
- assert funcgen.db.translator.config.translation.gc == 'none'
- return 'stm_nogc_start_transaction();'
-
-def stm_stop_transaction(funcgen, op):
- xxx
- # only for testing. With stmgc, this operation should have been handled
- # already by gctransform.
- assert funcgen.db.translator.config.translation.gc == 'none'
- return 'stm_nogc_stop_transaction();'
+def stm_initialize(funcgen, op):
+ return 'stm_initialize();'
_STM_BARRIER_FUNCS = { # XXX try to see if some combinations can be shorter
'P2R': 'stm_read_barrier',
diff --git a/rpython/translator/stm/stmgcintf.py
b/rpython/translator/stm/stmgcintf.py
--- a/rpython/translator/stm/stmgcintf.py
+++ b/rpython/translator/stm/stmgcintf.py
@@ -6,6 +6,8 @@
cdir = os.path.abspath(os.path.join(cdir2, '..', 'stm'))
separate_source = '''
+#define _GC_DEBUG 2 /* XXX move elsewhere */
+
#include "src_stm/stmgc.h"
extern Signed pypy_stmcb_size(void*);
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit