[pypy-commit] pypy stm-thread-2: Finish the fix.
arigo
noreply at buildbot.pypy.org
Fri Sep 7 15:50:44 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: stm-thread-2
Changeset: r57212:c3d8f6a49c4a
Date: 2012-09-07 15:50 +0200
http://bitbucket.org/pypy/pypy/changeset/c3d8f6a49c4a/
Log: Finish the fix.
diff --git a/pypy/rpython/memory/gc/stmgc.py b/pypy/rpython/memory/gc/stmgc.py
--- a/pypy/rpython/memory/gc/stmgc.py
+++ b/pypy/rpython/memory/gc/stmgc.py
@@ -337,7 +337,9 @@
llmemory.raw_memcopy(obj - size_gc_header,
localobj - size_gc_header,
totalsize)
- self.header(localobj).tid |= GCFLAG_VISITED
+ hdr = self.header(localobj)
+ hdr.tid &= ~(GCFLAG_GLOBAL | GCFLAG_POSSIBLY_OUTDATED)
+ hdr.tid |= (GCFLAG_VISITED | GCFLAG_LOCAL_COPY)
return localobj
# ----------
diff --git a/pypy/rpython/memory/gc/stmtls.py b/pypy/rpython/memory/gc/stmtls.py
--- a/pypy/rpython/memory/gc/stmtls.py
+++ b/pypy/rpython/memory/gc/stmtls.py
@@ -44,10 +44,7 @@
# --- a thread-local allocator for the shared area
from pypy.rpython.memory.gc.stmshared import StmGCThreadLocalAllocator
self.sharedarea_tls = StmGCThreadLocalAllocator(self.gc.sharedarea)
- # --- the GCFLAG_LOCAL_COPY objects are also allocated with
- # self.sharedarea_tls, but we need their 'revision', so we
- # can't do add_regular() on them. They go here instead:
- self.copied_local_objects = self.AddressStack()
+ self.copied_local_objects = self.AddressStack() # XXX KILL
# --- the LOCAL objects which are weakrefs. They are also listed
# in the appropriate place, like sharedarea_tls, if needed.
self.local_weakrefs = self.AddressStack()
@@ -251,7 +248,7 @@
"""Allocate an object that will be used as a LOCAL COPY of
some GLOBAL object."""
localobj = self.sharedarea_tls.malloc_object(totalsize)
- self.copied_local_objects.append(localobj)
+ self.copied_local_objects.append(localobj) # XXX KILL
return localobj
def fresh_new_weakref(self, obj):
@@ -490,11 +487,10 @@
self.stm_operations.tldict_enum()
@staticmethod
- def _stm_enum_callback(tlsaddr, globalobj, localobj):
+ def _stm_enum_callback(tlsaddr, localobj):
self = StmGCTLS.cast_address_to_tls_object(tlsaddr)
localhdr = self.gc.header(localobj)
- ll_assert(hdr_revision(localhdr) == globalobj,
- "in a root: localobj.version != globalobj")
+ globalobj = hdr_revision(localhdr)
ll_assert(localhdr.tid & GCFLAG_GLOBAL == 0,
"in a root: unexpected GCFLAG_GLOBAL")
ll_assert(localhdr.tid & GCFLAG_LOCAL_COPY != 0,
diff --git a/pypy/translator/stm/src_stm/et.c b/pypy/translator/stm/src_stm/et.c
--- a/pypy/translator/stm/src_stm/et.c
+++ b/pypy/translator/stm/src_stm/et.c
@@ -448,7 +448,7 @@
gcptr *items = d->gcroots.items;
for (i=0; i<=lastitem; i+=2)
{
- gcptr R = items[i]->h_revision;
+ gcptr R = (gcptr)items[i]->h_revision;
revision_t v = (revision_t)items[i+1];
if (v == 0)
break;
diff --git a/pypy/translator/stm/stmgcintf.py b/pypy/translator/stm/stmgcintf.py
--- a/pypy/translator/stm/stmgcintf.py
+++ b/pypy/translator/stm/stmgcintf.py
@@ -31,7 +31,7 @@
lltype.Signed))
DUPLICATE = lltype.Ptr(lltype.FuncType([llmemory.Address],
llmemory.Address))
- CALLBACK_ENUM = lltype.Ptr(lltype.FuncType([llmemory.Address]*3,
+ CALLBACK_ENUM = lltype.Ptr(lltype.FuncType([llmemory.Address]*2,
lltype.Void))
def _freeze_(self):
More information about the pypy-commit
mailing list