Bug 1359049 - Improve gray marking assertions to cover object private GC pointers r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 26 Apr 2017 14:15:32 +0100
changeset 403190 d5fc098d4088acaf3fcfa57b547f4f54e2aa69be
parent 403189 b06d30abb3581884f6c698ed772258295bec8379
child 403191 2538c8b58798e77742cb8ca86677350d806d3bc6
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1359049
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359049 - Improve gray marking assertions to cover object private GC pointers r=sfink
js/src/gc/Verifier.cpp
js/src/vm/NativeObject.h
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -652,17 +652,18 @@ CheckGrayMarkingTracer::checkCell(Cell* 
         return;
 
     TenuredCell* tenuredCell = &cell->asTenured();
     TenuredCell* tenuredParent = &parent->asTenured();
     if (tenuredParent->isMarked(BLACK) && !tenuredParent->isMarked(GRAY) &&
         tenuredCell->isMarked(GRAY))
     {
         failures++;
-        fprintf(stderr, "Found black to gray edge %p\n", cell);
+        fprintf(stderr, "Found black to gray edge to %s %p\n",
+                GCTraceKindToAscii(cell->getTraceKind()), cell);
         dumpCellPath();
     }
 }
 
 bool
 CheckGrayMarkingTracer::check(AutoLockForExclusiveAccess& lock)
 {
     if (!traceHeap(lock))
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -1220,16 +1220,18 @@ class NativeObject : public ShapedObject
     }
     void setPrivate(void* data) {
         void** pprivate = &privateRef(numFixedSlots());
         privateWriteBarrierPre(pprivate);
         *pprivate = data;
     }
 
     void setPrivateGCThing(gc::Cell* cell) {
+        MOZ_ASSERT_IF(IsMarkedBlack(this),
+                      !JS::GCThingIsMarkedGray(JS::GCCellPtr(cell, cell->getTraceKind())));
         void** pprivate = &privateRef(numFixedSlots());
         privateWriteBarrierPre(pprivate);
         *pprivate = reinterpret_cast<void*>(cell);
         privateWriteBarrierPost(pprivate);
     }
 
     void setPrivateUnbarriered(void* data) {
         void** pprivate = &privateRef(numFixedSlots());