Bug 1401804 - Fix IsMarkedBlack check used in gray marking asserts r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 22 Sep 2017 13:09:44 +0100
changeset 669141 56083ad02b19e622ae3a141b62e3cdcb58dd09df
parent 669140 029c7b6eee9921c386484ef666946db49c976fc0
child 669142 a414ed3ef9e596556f88b94fd76a470bee9cd2fd
push id81223
push usergpascutto@mozilla.com
push dateFri, 22 Sep 2017 15:21:17 +0000
reviewerssfink
bugs1401804
milestone58.0a1
Bug 1401804 - Fix IsMarkedBlack check used in gray marking asserts r=sfink
js/src/gc/Barrier.cpp
--- a/js/src/gc/Barrier.cpp
+++ b/js/src/gc/Barrier.cpp
@@ -28,25 +28,18 @@ RuntimeFromActiveCooperatingThreadIsHeap
     return JS::CurrentThreadIsHeapMajorCollecting();
 }
 
 #ifdef DEBUG
 
 bool
 IsMarkedBlack(JSObject* obj)
 {
-    // Note: we assume conservatively that Nursery things will be live.
-    if (!obj->isTenured())
-        return true;
-
-    gc::TenuredCell& tenured = obj->asTenured();
-    if (tenured.isMarkedAny() || tenured.arena()->allocatedDuringIncremental)
-        return true;
-
-    return false;
+    return obj->isMarkedBlack() ||
+           (obj->isTenured() && obj->asTenured().arena()->allocatedDuringIncremental);
 }
 
 bool
 HeapSlot::preconditionForSet(NativeObject* owner, Kind kind, uint32_t slot) const
 {
     if (kind == Slot)
         return &owner->getSlotRef(slot) == this;