From 85d2874b260e2b12a46e7fe028375bc3c905d564 Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Sun, 6 May 2012 16:36:21 -0700 Subject: [PATCH] Bug 749698 - Setup compartment to collect when gcPoke set (r=igor) --- js/src/jsgc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 2f89233c3da..a4ab8c0363b 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -3688,10 +3688,8 @@ Collect(JSRuntime *rt, bool incremental, int64_t budget, callback(rt, JSGC_BEGIN); } - { - rt->gcPoke = false; - GCCycle(rt, incremental, budget, gckind); - } + rt->gcPoke = false; + GCCycle(rt, incremental, budget, gckind); if (rt->gcIncrementalState == NO_INCREMENTAL) { gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_GC_END); @@ -3699,6 +3697,10 @@ Collect(JSRuntime *rt, bool incremental, int64_t budget, callback(rt, JSGC_END); } + /* Need to re-schedule all compartments for GC. */ + if (!rt->hasContexts() && rt->gcPoke) + PrepareForFullGC(rt); + /* * On shutdown, iterate until finalizers or the JSGC_END callback * stop creating garbage.