Bug 767230 - Don't trigger a GC in MaybeGC when we are still sweeping in the background. r=billm
authorGregor Wagner <anygregor@gmail.com>
Thu, 21 Jun 2012 18:44:46 -0700
changeset 97353 5cb6edb530d4c7e2fa31900c3ac104b67c2a9034
parent 97352 1675a6451849923b21edce6facb6f36bc517e41a
child 97354 cce693a7edcac5d116d0137b4fe291e3765627a5
push id10999
push usergwagner@mozilla.com
push dateFri, 22 Jun 2012 01:45:20 +0000
treeherdermozilla-inbound@5cb6edb530d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs767230
milestone16.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 767230 - Don't trigger a GC in MaybeGC when we are still sweeping in the background. r=billm
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2488,17 +2488,18 @@ MaybeGC(JSContext *cx)
     if (rt->gcIsNeeded) {
         GCSlice(rt, GC_NORMAL, gcreason::MAYBEGC);
         return;
     }
 
     JSCompartment *comp = cx->compartment;
     if (comp->gcBytes > 8192 &&
         comp->gcBytes >= 3 * (comp->gcTriggerBytes / 4) &&
-        rt->gcIncrementalState == NO_INCREMENTAL)
+        rt->gcIncrementalState == NO_INCREMENTAL &&
+        !rt->gcHelperThread.sweeping())
     {
         PrepareCompartmentForGC(comp);
         GCSlice(rt, GC_NORMAL, gcreason::MAYBEGC);
         return;
     }
 
     if (comp->gcMallocAndFreeBytes > comp->gcTriggerMallocAndFreeBytes) {
         PrepareCompartmentForGC(comp);