Bug 1401804 - Fix IsMarkedBlack check used in gray marking asserts r=sfink a=sylvestre
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 22 Sep 2017 13:09:44 +0100
changeset 434218 acd879464984d82b5510009773b1aa48ce7381ff
parent 434217 c282aab44b8ce72df14ecdf70845a7f201584e4f
child 434219 04a56a700b172dd7a3e2b2123bd4a3afaf3e2113
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink, sylvestre
bugs1401804
milestone57.0
Bug 1401804 - Fix IsMarkedBlack check used in gray marking asserts r=sfink a=sylvestre
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;