Bug 811176 - Shrinking GCs should clean up everything (r=terrence,a=blocking-basecamp)

This commit is contained in:
Bill McCloskey 2012-11-13 17:14:53 -08:00
Родитель 5f44ac9555
Коммит 4c2e6bbed5
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -4556,7 +4556,7 @@ IsDeterministicGCReason(gcreason::Reason reason)
#endif
static bool
ShouldCleanUpEverything(JSRuntime *rt, gcreason::Reason reason)
ShouldCleanUpEverything(JSRuntime *rt, gcreason::Reason reason, JSGCInvocationKind gckind)
{
// During shutdown, we must clean everything up, for the sake of leak
// detection. When a runtime has no contexts, or we're doing a GC before a
@ -4567,7 +4567,8 @@ ShouldCleanUpEverything(JSRuntime *rt, gcreason::Reason reason)
// we need to clear everything away.
return !rt->hasContexts() ||
reason == gcreason::SHUTDOWN_CC ||
reason == gcreason::DEBUG_MODE_GC;
reason == gcreason::DEBUG_MODE_GC ||
gckind == GC_SHRINK;
}
static void
@ -4635,7 +4636,7 @@ Collect(JSRuntime *rt, bool incremental, int64_t budget,
collectedCount++;
}
rt->gcShouldCleanUpEverything = ShouldCleanUpEverything(rt, reason);
rt->gcShouldCleanUpEverything = ShouldCleanUpEverything(rt, reason, gckind);
gcstats::AutoGCSlice agc(rt->gcStats, collectedCount, compartmentCount, reason);