From cf0a78ef9a15d1cd695be345479dbe29c7c3435b Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Mon, 16 Mar 2015 15:13:20 -0700 Subject: [PATCH] Bug 1139456 - Do not let compaction set the alloc threshold to unreasonably small sizes, r=terrence --HG-- extra : rebase_source : 2842e2aaaa97b355c61637d421c8a3fb02d70d57 --- js/src/jit-test/tests/gc/bug-1138390.js | 4 ++-- js/src/jsgc.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/jit-test/tests/gc/bug-1138390.js b/js/src/jit-test/tests/gc/bug-1138390.js index 887897520b60..b0310e278a20 100644 --- a/js/src/jit-test/tests/gc/bug-1138390.js +++ b/js/src/jit-test/tests/gc/bug-1138390.js @@ -17,12 +17,12 @@ var g = newGlobal(); // Start an off thread compilation that will not run until GC has finished if ("gcstate" in this) - assertEq("mark", gcstate()); + assertEq(gcstate(), "mark"); g.offThreadCompileScript('23;', {}); // Wait for the compilation to finish, which must finish the GC first assertEq(23, g.runOffThreadScript()); if ("gcstate" in this) - assertEq("none", gcstate()); + assertEq(gcstate(), "none"); print("done"); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index aa53e1a889d4..ebd773ec21b4 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -1714,7 +1714,7 @@ ZoneHeapThreshold::computeZoneTriggerBytes(double growthFactor, size_t lastBytes const GCSchedulingTunables &tunables) { size_t base = gckind == GC_SHRINK - ? lastBytes + ? Max(lastBytes, tunables.minEmptyChunkCount() * ChunkSize) : Max(lastBytes, tunables.gcZoneAllocThresholdBase()); double trigger = double(base) * growthFactor; return size_t(Min(double(tunables.gcMaxBytes()), trigger));