Commits

Armin Rigo  committed c3d8f6a

Finish the fix.

  • Participants
  • Parent commits 6ee3fa0
  • Branches stm-thread-2

Comments (0)

Files changed (4)

File pypy/rpython/memory/gc/stmgc.py

         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
 
     # ----------

File pypy/rpython/memory/gc/stmtls.py

         # --- 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()
         """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):
         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,

File pypy/translator/stm/src_stm/et.c

   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;

File pypy/translator/stm/stmgcintf.py

                                                  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):