Bug 749698 - Setup compartment to collect when gcPoke set (r=igor)

This commit is contained in:
Bill McCloskey 2012-05-06 16:36:21 -07:00
Родитель 2c8dfbd39d
Коммит 85d2874b26
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -3688,10 +3688,8 @@ Collect(JSRuntime *rt, bool incremental, int64_t budget,
callback(rt, JSGC_BEGIN); callback(rt, JSGC_BEGIN);
} }
{
rt->gcPoke = false; rt->gcPoke = false;
GCCycle(rt, incremental, budget, gckind); GCCycle(rt, incremental, budget, gckind);
}
if (rt->gcIncrementalState == NO_INCREMENTAL) { if (rt->gcIncrementalState == NO_INCREMENTAL) {
gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_GC_END); 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); 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 * On shutdown, iterate until finalizers or the JSGC_END callback
* stop creating garbage. * stop creating garbage.