Commits

Armin Rigo  committed 53913ed

Fix: for debugging check we verify that ebp points to a JITFRAME here;
but it may actually point to an already-forwarded object at this point.

  • Participants
  • Parent commits 152ee9d
  • Branches jitframe-on-heap

Comments (0)

Files changed (3)

File rpython/memory/gc/minimark.py

     def get_forwarding_address(self, obj):
         return llmemory.cast_adr_to_ptr(obj, FORWARDSTUBPTR).forw
 
+    def get_possibly_forwarded_type_id(self, obj):
+        if self.is_in_nursery(obj) and self.is_forwarded(obj):
+            obj = self.get_forwarding_address(obj)
+        return self.get_type_id(obj)
+
     def get_total_memory_used(self):
         """Return the total memory used, not counting any object in the
         nursery: only objects in the ArenaCollection or raw-malloced.

File rpython/memory/gc/semispace.py

     def visit_external_object(self, obj):
         pass    # hook for the HybridGC
 
+    def get_possibly_forwarded_type_id(self, obj):
+        tid = self.header(obj).tid
+        if self.is_forwarded(obj) and not (tid & GCFLAG_EXTERNAL):
+            obj = self.get_forwarding_address(obj)
+        return self.get_type_id(obj)
+
     def set_forwarding_address(self, obj, newobj, objsize):
         # To mark an object as forwarded, we set the GCFLAG_FORWARDED and
         # overwrite the object with a FORWARDSTUB.  Doing so is a bit

File rpython/memory/gctransform/asmgcroot.py

             # to a JITFRAME object.
             from rpython.jit.backend.llsupport.jitframe import STACK_DEPTH_OFS
             
-            tid = self.gc.get_type_id(ebp_in_caller)
+            tid = self.gc.get_possibly_forwarded_type_id(ebp_in_caller)
             ll_assert(rffi.cast(lltype.Signed, tid) ==
                       rffi.cast(lltype.Signed, self.frame_tid),
                       "found a stack frame that does not belong "