Bug 1029648 - Enable dynamic heap growth in shell and enforce parameter invariant r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 03 Jul 2014 10:29:37 +0100
changeset 192179 cad7de31731e5a51a158201172438a418f70b834
parent 192178 41da9bcec12e83e9c50c606d43801ad80cfe09fc
child 192180 1591985577f296873c605b5d07405dd215cd224a
push idunknown
push userunknown
push dateunknown
reviewersterrence
bugs1029648
milestone33.0a1
Bug 1029648 - Enable dynamic heap growth in shell and enforce parameter invariant r=terrence
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1096,17 +1096,17 @@ GCRuntime::GCRuntime(JSRuntime *rt) :
     allocThreshold(30 * 1024 * 1024),
     highFrequencyGC(false),
     highFrequencyTimeThreshold(1000),
     highFrequencyLowLimitBytes(100 * 1024 * 1024),
     highFrequencyHighLimitBytes(500 * 1024 * 1024),
     highFrequencyHeapGrowthMax(3.0),
     highFrequencyHeapGrowthMin(1.5),
     lowFrequencyHeapGrowth(1.5),
-    dynamicHeapGrowth(false),
+    dynamicHeapGrowth(true),
     dynamicMarkSlice(false),
     decommitThreshold(32 * 1024 * 1024),
     cleanUpEverything(false),
     grayBitsValid(false),
     isNeeded(0),
     number(0),
     startNumber(0),
     isFull(false),
@@ -1382,19 +1382,23 @@ GCRuntime::setParameter(JSGCParamKey key
       case JSGC_MARK_STACK_LIMIT:
         setMarkStackLimit(value);
         break;
       case JSGC_HIGH_FREQUENCY_TIME_LIMIT:
         highFrequencyTimeThreshold = value;
         break;
       case JSGC_HIGH_FREQUENCY_LOW_LIMIT:
         highFrequencyLowLimitBytes = value * 1024 * 1024;
+        if (highFrequencyLowLimitBytes >= highFrequencyHighLimitBytes)
+            highFrequencyHighLimitBytes = highFrequencyLowLimitBytes + 1;
         break;
       case JSGC_HIGH_FREQUENCY_HIGH_LIMIT:
         highFrequencyHighLimitBytes = value * 1024 * 1024;
+        if (highFrequencyLowLimitBytes >= highFrequencyHighLimitBytes)
+            highFrequencyLowLimitBytes = highFrequencyHighLimitBytes - 1;
         break;
       case JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX:
         highFrequencyHeapGrowthMax = value / 100.0;
         MOZ_ASSERT(highFrequencyHeapGrowthMax / 0.85 > 1.0);
         break;
       case JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN:
         highFrequencyHeapGrowthMin = value / 100.0;
         MOZ_ASSERT(highFrequencyHeapGrowthMin / 0.85 > 1.0);