Bug 1341096 - Make JS::IsIncrementalBarrierNeeded return true while sweeping incrementally r=sfink a=abillings a=gchang
authorJon Coppeard <jcoppeard@mozilla.com>
Tue, 21 Mar 2017 10:24:11 +0000
changeset 379192 2f76881b7ba245bb4cfaa4e2c63fa2a040ccce46
parent 379191 137343d3973c4187fcc3c5aa0786dc9890c7b3b7
child 379193 2bbf316c5d61239405d741d66424549ff06e94ab
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink, abillings, gchang
bugs1341096
milestone53.0
Bug 1341096 - Make JS::IsIncrementalBarrierNeeded return true while sweeping incrementally r=sfink a=abillings a=gchang
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -7377,17 +7377,21 @@ JS_PUBLIC_API(bool)
 JS::IsIncrementalGCInProgress(JSContext* cx)
 {
     return cx->gc.isIncrementalGCInProgress() && !cx->gc.isVerifyPreBarriersEnabled();
 }
 
 JS_PUBLIC_API(bool)
 JS::IsIncrementalBarrierNeeded(JSContext* cx)
 {
-    return cx->gc.state() == gc::State::Mark && !cx->isHeapBusy();
+    if (cx->isHeapBusy())
+        return false;
+
+    auto state = cx->gc.state();
+    return state != gc::State::NotActive && state <= gc::State::Sweep;
 }
 
 struct IncrementalReferenceBarrierFunctor {
     template <typename T> void operator()(T* t) { T::writeBarrierPre(t); }
 };
 
 JS_PUBLIC_API(void)
 JS::IncrementalReferenceBarrier(GCCellPtr thing)