Bug 1139456 - Do not let compaction set the alloc threshold to unreasonably small sizes, r=terrence

--HG--
extra : rebase_source : 2842e2aaaa97b355c61637d421c8a3fb02d70d57
This commit is contained in:
Steve Fink 2015-03-16 15:13:20 -07:00
Родитель 45c8205d96
Коммит cf0a78ef9a
2 изменённых файлов: 3 добавлений и 3 удалений

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

@ -17,12 +17,12 @@ var g = newGlobal();
// Start an off thread compilation that will not run until GC has finished // Start an off thread compilation that will not run until GC has finished
if ("gcstate" in this) if ("gcstate" in this)
assertEq("mark", gcstate()); assertEq(gcstate(), "mark");
g.offThreadCompileScript('23;', {}); g.offThreadCompileScript('23;', {});
// Wait for the compilation to finish, which must finish the GC first // Wait for the compilation to finish, which must finish the GC first
assertEq(23, g.runOffThreadScript()); assertEq(23, g.runOffThreadScript());
if ("gcstate" in this) if ("gcstate" in this)
assertEq("none", gcstate()); assertEq(gcstate(), "none");
print("done"); print("done");

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

@ -1714,7 +1714,7 @@ ZoneHeapThreshold::computeZoneTriggerBytes(double growthFactor, size_t lastBytes
const GCSchedulingTunables &tunables) const GCSchedulingTunables &tunables)
{ {
size_t base = gckind == GC_SHRINK size_t base = gckind == GC_SHRINK
? lastBytes ? Max(lastBytes, tunables.minEmptyChunkCount() * ChunkSize)
: Max(lastBytes, tunables.gcZoneAllocThresholdBase()); : Max(lastBytes, tunables.gcZoneAllocThresholdBase());
double trigger = double(base) * growthFactor; double trigger = double(base) * growthFactor;
return size_t(Min(double(tunables.gcMaxBytes()), trigger)); return size_t(Min(double(tunables.gcMaxBytes()), trigger));