Bug 1514850 - Don't delay checking of cells that are already marked black r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 02 Jan 2019 18:19:01 +0000
changeset 452265 38f962460f285ceb2a3273629aa7156d2260decc
parent 452264 c60f868017bcb1de9a3daa620cccd14b7fe9a728
child 452266 c796403f5a29c375fbeaeaec29f5a83823739cd4
push id110862
push userjcoppeard@mozilla.com
push dateWed, 02 Jan 2019 18:19:26 +0000
treeherdermozilla-inbound@38f962460f28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1514850
milestone66.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 1514850 - Don't delay checking of cells that are already marked black r=sfink
js/src/gc/GC.cpp
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -8970,27 +8970,30 @@ JS_PUBLIC_API void js::gc::detail::Asser
 
   // TODO: I'd like to AssertHeapIsIdle() here, but this ends up getting
   // called during GC and while iterating the heap for memory reporting.
   MOZ_ASSERT(!JS::RuntimeHeapIsCycleCollecting());
 
   auto tc = &cell->asTenured();
   if (tc->zone()->isGCMarkingBlackAndGray()) {
     // We are doing gray marking in the cell's zone. Even if the cell is
-    // currently marked gray it may eventually be marked black. Delay the check
-    // until we finish gray marking.
-    JSRuntime* rt = tc->zone()->runtimeFromMainThread();
-    AutoEnterOOMUnsafeRegion oomUnsafe;
-    if (!rt->gc.cellsToAssertNotGray.ref().append(cell)) {
-      oomUnsafe.crash("Can't append to delayed gray checks list");
+    // currently marked gray it may eventually be marked black. Delay checking
+    // non-black cells until we finish gray marking.
+
+    if (!tc->isMarkedBlack()) {
+      JSRuntime* rt = tc->zone()->runtimeFromMainThread();
+      AutoEnterOOMUnsafeRegion oomUnsafe;
+      if (!rt->gc.cellsToAssertNotGray.ref().append(cell)) {
+        oomUnsafe.crash("Can't append to delayed gray checks list");
+      }
     }
     return;
   }
 
-  MOZ_ASSERT(!detail::CellIsMarkedGray(tc));
+  MOZ_ASSERT(!tc->isMarkedGray());
 }
 
 extern JS_PUBLIC_API bool js::gc::detail::ObjectIsMarkedBlack(
     const JSObject* obj) {
   return obj->isMarkedBlack();
 }
 
 #endif