Bug 1509824 - Check success of gray root buffering earlier r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 26 Nov 2018 13:34:01 +0000
changeset 447956 3e274fb14fa0e03a104db8ef001fb1684e9c8ac7
parent 447955 90e20d0a24f524779b2ede07f6302776eec115fa
child 447957 bec065574446df6a0a4ba3235809ae2e0515ea64
push id110103
push userjcoppeard@mozilla.com
push dateMon, 26 Nov 2018 13:36:02 +0000
treeherdermozilla-inbound@d7336bdef207 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1509824
milestone65.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 1509824 - Check success of gray root buffering earlier r=sfink
js/src/gc/GC.cpp
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -7468,38 +7468,38 @@ GCRuntime::incrementalSlice(SliceBudget&
         MOZ_FALLTHROUGH;
 
       case State::MarkRoots:
         if (!beginMarkPhase(reason, session)) {
             incrementalState = State::NotActive;
             return IncrementalResult::Ok;
         }
 
+        /* If we needed delayed marking for gray roots, then collect until done. */
+        if (isIncremental && !hasValidGrayRootsBuffer()) {
+            budget.makeUnlimited();
+            isIncremental = false;
+            stats().nonincremental(AbortReason::GrayRootBufferingFailed);
+        }
+
         if (!destroyingRuntime) {
             pushZealSelectedObjects();
         }
 
         incrementalState = State::Mark;
 
         if (isIncremental && useZeal && hasZealMode(ZealMode::YieldBeforeMarking)) {
             break;
         }
 
         MOZ_FALLTHROUGH;
 
       case State::Mark:
         AutoGCRooter::traceAllWrappers(rt->mainContextFromOwnThread(), &marker);
 
-        // If we needed delayed marking for gray roots, then collect until done.
-        if (isIncremental && !hasValidGrayRootsBuffer()) {
-            budget.makeUnlimited();
-            isIncremental = false;
-            stats().nonincremental(AbortReason::GrayRootBufferingFailed);
-        }
-
         if (markUntilBudgetExhaused(budget, gcstats::PhaseKind::MARK) == NotFinished) {
             break;
         }
 
         MOZ_ASSERT(marker.isDrained());
 
         /*
          * There are a number of reasons why we break out of collection here,