Bug 1714532 - do not yield during an incremental GC that was turned nonincremental by gray root buffering failure r=jonco
authorSteve Fink <sfink@mozilla.com>
Wed, 09 Jun 2021 16:46:05 +0000
changeset 582518 c10a52874ea2370e60c3f04cd079f002d3780497
parent 582517 d8047aff3ea541126752adf78d09b447bc6ac91d
child 582519 f7a108e738eedbb97eb84f28bffa518e1c7484a6
push id144649
push usersfink@mozilla.com
push dateWed, 09 Jun 2021 19:07:58 +0000
treeherderautoland@c10a52874ea2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1714532
milestone91.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 1714532 - do not yield during an incremental GC that was turned nonincremental by gray root buffering failure r=jonco Differential Revision: https://phabricator.services.mozilla.com/D117337
js/src/gc/GC.cpp
js/src/tests/non262/regress/regress-1714532-oom-gc-yield.js
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -7062,17 +7062,17 @@ void GCRuntime::incrementalSlice(SliceBu
       if (isIncremental && !hasValidGrayRootsBuffer()) {
         budget = SliceBudget::unlimited();
         isIncremental = false;
         stats().nonincremental(GCAbortReason::GrayRootBufferingFailed);
       }
 
       incrementalState = State::Mark;
 
-      if (useZeal && hasZealMode(ZealMode::YieldBeforeMarking)) {
+      if (useZeal && hasZealMode(ZealMode::YieldBeforeMarking) && isIncremental) {
         break;
       }
 
       [[fallthrough]];
 
     case State::Mark:
       if (mightSweepInThisSlice(budget.isUnlimited())) {
         // Trace wrapper rooters before marking if we might start sweeping in
new file mode 100644
--- /dev/null
+++ b/js/src/tests/non262/regress/regress-1714532-oom-gc-yield.js
@@ -0,0 +1,9 @@
+// |reftest| skip-if(!this.hasOwnProperty("oomTest"))
+
+oomTest(function() {
+    grayRoot();
+    gczeal(8);
+    gcslice(this);
+});
+
+this.reportCompare && reportCompare(true, true, 'An OOM while gray buffering should not leave the GC half-done');