Bug 1496699 - Convert some doubles to floats r=sfink
authorPaul Bone <pbone@mozilla.com>
Thu, 04 Oct 2018 19:13:20 +1000
changeset 496386 5aee88f016b05ac1a2239f46db3207af42f45199
parent 496385 224c0fc59fc12565320b507bfdb7b8f80a07d12d
child 496387 2398cc611aba734f6de7000d3429f40efb0517eb
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1496699
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1496699 - Convert some doubles to floats r=sfink The tuning parameters (usually percentages) are approximate anyway, doubles are overkill.
js/src/gc/GC.cpp
js/src/gc/Scheduling.h
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -283,26 +283,26 @@ namespace TuningDefaults {
 
     /* JSGC_ALLOCATION_THRESHOLD */
     static const size_t GCZoneAllocThresholdBase = 30 * 1024 * 1024;
 
     /* JSGC_MAX_MALLOC_BYTES */
     static const size_t MaxMallocBytes = 128 * 1024 * 1024;
 
     /* JSGC_ALLOCATION_THRESHOLD_FACTOR */
-    static const double AllocThresholdFactor = 0.9;
+    static const float AllocThresholdFactor = 0.9f;
 
     /* JSGC_ALLOCATION_THRESHOLD_FACTOR_AVOID_INTERRUPT */
-    static const double AllocThresholdFactorAvoidInterrupt = 0.9;
+    static const float AllocThresholdFactorAvoidInterrupt = 0.9f;
 
     /* no parameter */
-    static const double MallocThresholdGrowFactor = 1.5;
+    static const float MallocThresholdGrowFactor = 1.5f;
 
     /* no parameter */
-    static const double MallocThresholdShrinkFactor = 0.9;
+    static const float MallocThresholdShrinkFactor = 0.9f;
 
     /* no parameter */
     static const size_t MallocThresholdLimit = 1024 * 1024 * 1024;
 
     /* no parameter */
     static const size_t ZoneAllocDelayBytes = 1024 * 1024;
 
     /* JSGC_DYNAMIC_HEAP_GROWTH */
@@ -313,23 +313,23 @@ namespace TuningDefaults {
 
     /* JSGC_HIGH_FREQUENCY_LOW_LIMIT */
     static const uint64_t HighFrequencyLowLimitBytes = 100 * 1024 * 1024;
 
     /* JSGC_HIGH_FREQUENCY_HIGH_LIMIT */
     static const uint64_t HighFrequencyHighLimitBytes = 500 * 1024 * 1024;
 
     /* JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX */
-    static const double HighFrequencyHeapGrowthMax = 3.0;
+    static const float HighFrequencyHeapGrowthMax = 3.0f;
 
     /* JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN */
-    static const double HighFrequencyHeapGrowthMin = 1.5;
+    static const float HighFrequencyHeapGrowthMin = 1.5f;
 
     /* JSGC_LOW_FREQUENCY_HEAP_GROWTH */
-    static const double LowFrequencyHeapGrowth = 1.5;
+    static const float LowFrequencyHeapGrowth = 1.5f;
 
     /* JSGC_DYNAMIC_MARK_SLICE */
     static const bool DynamicMarkSliceEnabled = false;
 
     /* JSGC_MIN_EMPTY_CHUNK_COUNT */
     static const uint32_t MinEmptyChunkCount = 1;
 
     /* JSGC_MAX_EMPTY_CHUNK_COUNT */
@@ -351,34 +351,34 @@ namespace TuningDefaults {
 }}} // namespace js::gc::TuningDefaults
 
 /*
  * We start to incremental collection for a zone when a proportion of its
  * threshold is reached. This is configured by the
  * JSGC_ALLOCATION_THRESHOLD_FACTOR and
  * JSGC_ALLOCATION_THRESHOLD_FACTOR_AVOID_INTERRUPT parameters.
  */
-static const double MinAllocationThresholdFactor = 0.9;
+static const float MinAllocationThresholdFactor = 0.9f;
 
 /*
  * We may start to collect a zone before its trigger threshold is reached if
  * GCRuntime::maybeGC() is called for that zone or we start collecting other
  * zones. These eager threshold factors are not configurable.
  */
-static const double HighFrequencyEagerAllocTriggerFactor = 0.85;
-static const double LowFrequencyEagerAllocTriggerFactor = 0.9;
+static const float HighFrequencyEagerAllocTriggerFactor = 0.85f;
+static const float LowFrequencyEagerAllocTriggerFactor = 0.9f;
 
 /*
  * Don't allow heap growth factors to be set so low that collections could
  * reduce the trigger threshold.
  */
-static const double MinHighFrequencyHeapGrowthFactor =
-    1.0 / Min(HighFrequencyEagerAllocTriggerFactor, MinAllocationThresholdFactor);
-static const double MinLowFrequencyHeapGrowthFactor =
-    1.0 / Min(LowFrequencyEagerAllocTriggerFactor, MinAllocationThresholdFactor);
+static const float MinHighFrequencyHeapGrowthFactor =
+    1.0f / Min(HighFrequencyEagerAllocTriggerFactor, MinAllocationThresholdFactor);
+static const float MinLowFrequencyHeapGrowthFactor =
+    1.0f / Min(LowFrequencyEagerAllocTriggerFactor, MinAllocationThresholdFactor);
 
 /* Increase the IGC marking slice time if we are in highFrequencyGC mode. */
 static const int IGC_MARK_SLICE_MULTIPLIER = 2;
 
 const AllocKind gc::slotsToThingKind[] = {
     /*  0 */ AllocKind::OBJECT0,  AllocKind::OBJECT2,  AllocKind::OBJECT2,  AllocKind::OBJECT4,
     /*  4 */ AllocKind::OBJECT4,  AllocKind::OBJECT8,  AllocKind::OBJECT8,  AllocKind::OBJECT8,
     /*  8 */ AllocKind::OBJECT8,  AllocKind::OBJECT12, AllocKind::OBJECT12, AllocKind::OBJECT12,
@@ -1482,17 +1482,17 @@ GCRuntime::setParameter(JSGCParamKey key
 
     return true;
 }
 
 bool
 GCSchedulingTunables::setParameter(JSGCParamKey key, uint32_t value, const AutoLockGC& lock)
 {
     // Limit heap growth factor to one hundred times size of current heap.
-    const double MaxHeapGrowthFactor = 100;
+    const float MaxHeapGrowthFactor = 100;
 
     switch(key) {
       case JSGC_MAX_BYTES:
         gcMaxBytes_ = value;
         break;
       case JSGC_MAX_NURSERY_BYTES:
         gcMaxNurseryBytes_ = value;
         break;
@@ -1511,59 +1511,59 @@ GCSchedulingTunables::setParameter(JSGCP
         uint64_t newLimit = (uint64_t)value * 1024 * 1024;
         if (newLimit == 0) {
             return false;
         }
         setHighFrequencyHighLimit(newLimit);
         break;
       }
       case JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX: {
-        double newGrowth = value / 100.0;
+        float newGrowth = value / 100.0f;
         if (newGrowth < MinHighFrequencyHeapGrowthFactor || newGrowth > MaxHeapGrowthFactor) {
             return false;
         }
         setHighFrequencyHeapGrowthMax(newGrowth);
         break;
       }
       case JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN: {
-        double newGrowth = value / 100.0;
+        float newGrowth = value / 100.0f;
         if (newGrowth < MinHighFrequencyHeapGrowthFactor || newGrowth > MaxHeapGrowthFactor) {
             return false;
         }
         setHighFrequencyHeapGrowthMin(newGrowth);
         break;
       }
       case JSGC_LOW_FREQUENCY_HEAP_GROWTH: {
-        double newGrowth = value / 100.0;
+        float newGrowth = value / 100.0f;
         if (newGrowth < MinLowFrequencyHeapGrowthFactor || newGrowth > MaxHeapGrowthFactor) {
             return false;
         }
         setLowFrequencyHeapGrowth(newGrowth);
         break;
       }
       case JSGC_DYNAMIC_HEAP_GROWTH:
         dynamicHeapGrowthEnabled_ = value != 0;
         break;
       case JSGC_DYNAMIC_MARK_SLICE:
         dynamicMarkSliceEnabled_ = value != 0;
         break;
       case JSGC_ALLOCATION_THRESHOLD:
         gcZoneAllocThresholdBase_ = value * 1024 * 1024;
         break;
       case JSGC_ALLOCATION_THRESHOLD_FACTOR: {
-        double newFactor = value / 100.0;
-        if (newFactor < MinAllocationThresholdFactor || newFactor > 1.0) {
+        float newFactor = value / 100.0f;
+        if (newFactor < MinAllocationThresholdFactor || newFactor > 1.0f) {
             return false;
         }
         allocThresholdFactor_ = newFactor;
         break;
       }
       case JSGC_ALLOCATION_THRESHOLD_FACTOR_AVOID_INTERRUPT: {
-        double newFactor = value / 100.0;
-        if (newFactor < MinAllocationThresholdFactor || newFactor > 1.0) {
+        float newFactor = value / 100.0f;
+        if (newFactor < MinAllocationThresholdFactor || newFactor > 1.0f) {
             return false;
         }
         allocThresholdFactorAvoidInterrupt_ = newFactor;
         break;
       }
       case JSGC_MIN_EMPTY_CHUNK_COUNT:
         setMinEmptyChunkCount(value);
         break;
@@ -1605,39 +1605,39 @@ GCSchedulingTunables::setHighFrequencyHi
     highFrequencyHighLimitBytes_ = newLimit;
     if (highFrequencyHighLimitBytes_ <= highFrequencyLowLimitBytes_) {
         highFrequencyLowLimitBytes_ = highFrequencyHighLimitBytes_ - 1;
     }
     MOZ_ASSERT(highFrequencyHighLimitBytes_ > highFrequencyLowLimitBytes_);
 }
 
 void
-GCSchedulingTunables::setHighFrequencyHeapGrowthMin(double value)
+GCSchedulingTunables::setHighFrequencyHeapGrowthMin(float value)
 {
     highFrequencyHeapGrowthMin_ = value;
     if (highFrequencyHeapGrowthMin_ > highFrequencyHeapGrowthMax_) {
         highFrequencyHeapGrowthMax_ = highFrequencyHeapGrowthMin_;
     }
     MOZ_ASSERT(highFrequencyHeapGrowthMin_ >= MinHighFrequencyHeapGrowthFactor);
     MOZ_ASSERT(highFrequencyHeapGrowthMin_ <= highFrequencyHeapGrowthMax_);
 }
 
 void
-GCSchedulingTunables::setHighFrequencyHeapGrowthMax(double value)
+GCSchedulingTunables::setHighFrequencyHeapGrowthMax(float value)
 {
     highFrequencyHeapGrowthMax_ = value;
     if (highFrequencyHeapGrowthMax_ < highFrequencyHeapGrowthMin_) {
         highFrequencyHeapGrowthMin_ = highFrequencyHeapGrowthMax_;
     }
     MOZ_ASSERT(highFrequencyHeapGrowthMin_ >= MinHighFrequencyHeapGrowthFactor);
     MOZ_ASSERT(highFrequencyHeapGrowthMin_ <= highFrequencyHeapGrowthMax_);
 }
 
 void
-GCSchedulingTunables::setLowFrequencyHeapGrowth(double value)
+GCSchedulingTunables::setLowFrequencyHeapGrowth(float value)
 {
     lowFrequencyHeapGrowth_ = value;
     MOZ_ASSERT(lowFrequencyHeapGrowth_ >= MinLowFrequencyHeapGrowthFactor);
 }
 
 void
 GCSchedulingTunables::setMinEmptyChunkCount(uint32_t value)
 {
@@ -2047,31 +2047,31 @@ GCRuntime::setMaxMallocBytes(size_t valu
 {
     tunables.setMaxMallocBytes(value);
     mallocCounter.setMax(value, lock);
     for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
         zone->setGCMaxMallocBytes(value, lock);
     }
 }
 
-double
+float
 ZoneHeapThreshold::eagerAllocTrigger(bool highFrequencyGC) const
 {
-    double eagerTriggerFactor = highFrequencyGC ? HighFrequencyEagerAllocTriggerFactor
-                                                : LowFrequencyEagerAllocTriggerFactor;
+    float eagerTriggerFactor = highFrequencyGC ? HighFrequencyEagerAllocTriggerFactor
+                                               : LowFrequencyEagerAllocTriggerFactor;
     return eagerTriggerFactor * gcTriggerBytes();
 }
 
-/* static */ double
+/* static */ float
 ZoneHeapThreshold::computeZoneHeapGrowthFactorForHeapSize(size_t lastBytes,
                                                           const GCSchedulingTunables& tunables,
                                                           const GCSchedulingState& state)
 {
     if (!tunables.isDynamicHeapGrowthEnabled()) {
-        return 3.0;
+        return 3.0f;
     }
 
     // For small zones, our collection heuristics do not matter much: favor
     // something simple in this case.
     if (lastBytes < 1 * 1024 * 1024) {
         return tunables.lowFrequencyHeapGrowth();
     }
 
@@ -2084,51 +2084,51 @@ ZoneHeapThreshold::computeZoneHeapGrowth
     // The heap growth factor depends on the heap size after a GC and the GC
     // frequency. For low frequency GCs (more than 1sec between GCs) we let
     // the heap grow to 150%. For high frequency GCs we let the heap grow
     // depending on the heap size:
     //   lastBytes < highFrequencyLowLimit: 300%
     //   lastBytes > highFrequencyHighLimit: 150%
     //   otherwise: linear interpolation between 300% and 150% based on lastBytes
 
-    double minRatio = tunables.highFrequencyHeapGrowthMin();
-    double maxRatio = tunables.highFrequencyHeapGrowthMax();
-    double lowLimit = tunables.highFrequencyLowLimitBytes();
-    double highLimit = tunables.highFrequencyHighLimitBytes();
+    float minRatio = tunables.highFrequencyHeapGrowthMin();
+    float maxRatio = tunables.highFrequencyHeapGrowthMax();
+    float lowLimit = tunables.highFrequencyLowLimitBytes();
+    float highLimit = tunables.highFrequencyHighLimitBytes();
 
     MOZ_ASSERT(minRatio <= maxRatio);
     MOZ_ASSERT(lowLimit < highLimit);
 
     if (lastBytes <= lowLimit) {
         return maxRatio;
     }
 
     if (lastBytes >= highLimit) {
         return minRatio;
     }
 
-    double factor = maxRatio - ((maxRatio - minRatio) * ((lastBytes - lowLimit) /
+    float factor = maxRatio - ((maxRatio - minRatio) * ((lastBytes - lowLimit) /
                                                          (highLimit - lowLimit)));
 
     MOZ_ASSERT(factor >= minRatio);
     MOZ_ASSERT(factor <= maxRatio);
     return factor;
 }
 
 /* static */ size_t
-ZoneHeapThreshold::computeZoneTriggerBytes(double growthFactor, size_t lastBytes,
+ZoneHeapThreshold::computeZoneTriggerBytes(float growthFactor, size_t lastBytes,
                                            JSGCInvocationKind gckind,
                                            const GCSchedulingTunables& tunables,
                                            const AutoLockGC& lock)
 {
     size_t base = gckind == GC_SHRINK
                 ? Max(lastBytes, tunables.minEmptyChunkCount(lock) * ChunkSize)
                 : Max(lastBytes, tunables.gcZoneAllocThresholdBase());
-    double trigger = double(base) * growthFactor;
-    return size_t(Min(double(tunables.gcMaxBytes()), trigger));
+    float trigger = float(base) * growthFactor;
+    return size_t(Min(float(tunables.gcMaxBytes()), trigger));
 }
 
 void
 ZoneHeapThreshold::updateAfterGC(size_t lastBytes, JSGCInvocationKind gckind,
                                  const GCSchedulingTunables& tunables,
                                  const GCSchedulingState& state, const AutoLockGC& lock)
 {
     gcHeapGrowthFactor_ = computeZoneHeapGrowthFactorForHeapSize(lastBytes, tunables, state);
@@ -2503,30 +2503,30 @@ ArenaList::relocateArenas(Arena* toReloc
 
     check();
 
     return relocated;
 }
 
 // Skip compacting zones unless we can free a certain proportion of their GC
 // heap memory.
-static const double MIN_ZONE_RECLAIM_PERCENT = 2.0;
+static const float MIN_ZONE_RECLAIM_PERCENT = 2.0;
 
 static bool
 ShouldRelocateZone(size_t arenaCount, size_t relocCount, JS::gcreason::Reason reason)
 {
     if (relocCount == 0) {
         return false;
     }
 
     if (IsOOMReason(reason)) {
         return true;
     }
 
-    return (relocCount * 100.0) / arenaCount >= MIN_ZONE_RECLAIM_PERCENT;
+    return (relocCount * 100.0f) / arenaCount >= MIN_ZONE_RECLAIM_PERCENT;
 }
 
 static AllocKinds
 CompactingAllocKinds()
 {
     AllocKinds result;
     for (AllocKind kind : AllAllocKinds()) {
         if (IsCompactingKind(kind)) {
@@ -3550,17 +3550,17 @@ GCRuntime::maybeAllocTriggerZoneGC(Zone*
     if (usedBytes >= thresholdBytes) {
         // The threshold has been surpassed, immediately trigger a GC, which
         // will be done non-incrementally.
         triggerZoneGC(zone, JS::gcreason::ALLOC_TRIGGER, usedBytes, thresholdBytes);
         return;
     }
 
     bool wouldInterruptCollection = isIncrementalGCInProgress() && !zone->isCollecting();
-    double zoneGCThresholdFactor =
+    float zoneGCThresholdFactor =
         wouldInterruptCollection ? tunables.allocThresholdFactorAvoidInterrupt()
                                  : tunables.allocThresholdFactor();
 
     size_t igcThresholdBytes = thresholdBytes * zoneGCThresholdFactor;
 
     if (usedBytes >= igcThresholdBytes) {
         // Reduce the delay to the start of the next incremental slice.
         if (zone->gcDelayBytes < ArenaSize) {
@@ -3636,18 +3636,18 @@ GCRuntime::maybeGC(Zone* zone)
         return;
     }
 #endif
 
     if (gcIfRequested()) {
         return;
     }
 
-    double threshold = zone->threshold.eagerAllocTrigger(schedulingState.inHighFrequencyGCMode());
-    double usedBytes = zone->usage.gcBytes();
+    float threshold = zone->threshold.eagerAllocTrigger(schedulingState.inHighFrequencyGCMode());
+    float usedBytes = zone->usage.gcBytes();
     if (usedBytes > 1024 * 1024 && usedBytes >= threshold &&
         !isIncrementalGCInProgress() && !isBackgroundSweeping())
     {
         stats().recordTrigger(usedBytes, threshold);
         PrepareZoneForGC(zone);
         startGC(GC_NORMAL, JS::gcreason::EAGER_ALLOC_TRIGGER);
     }
 }
@@ -8026,29 +8026,29 @@ GCRuntime::scanZonesBeforeGC()
 // The GC can only clean up scheduledForDestruction realms that were marked live
 // by a barrier (e.g. by RemapWrappers from a navigation event). It is also
 // common to have realms held live because they are part of a cycle in gecko,
 // e.g. involving the HTMLDocument wrapper. In this case, we need to run the
 // CycleCollector in order to remove these edges before the realm can be freed.
 void
 GCRuntime::maybeDoCycleCollection()
 {
-    const static double ExcessiveGrayRealms = 0.8;
+    const static float ExcessiveGrayRealms = 0.8f;
     const static size_t LimitGrayRealms = 200;
 
     size_t realmsTotal = 0;
     size_t realmsGray = 0;
     for (RealmsIter realm(rt); !realm.done(); realm.next()) {
         ++realmsTotal;
         GlobalObject* global = realm->unsafeUnbarrieredMaybeGlobal();
         if (global && global->isMarkedGray()) {
             ++realmsGray;
         }
     }
-    double grayFraction = double(realmsGray) / double(realmsTotal);
+    float grayFraction = float(realmsGray) / float(realmsTotal);
     if (grayFraction > ExcessiveGrayRealms || realmsGray > LimitGrayRealms) {
         callDoCycleCollectionCallback(rt->mainContextFromOwnThread());
     }
 }
 
 void
 GCRuntime::checkCanCallAPI()
 {
--- a/js/src/gc/Scheduling.h
+++ b/js/src/gc/Scheduling.h
@@ -355,24 +355,24 @@ class GCSchedulingTunables
      */
     MainThreadOrGCTaskData<size_t> gcZoneAllocThresholdBase_;
 
     /*
      * JSGC_ALLOCATION_THRESHOLD_FACTOR
      *
      * Fraction of threshold.gcBytes() which triggers an incremental GC.
      */
-    UnprotectedData<double> allocThresholdFactor_;
+    UnprotectedData<float> allocThresholdFactor_;
 
     /*
      * JSGC_ALLOCATION_THRESHOLD_FACTOR_AVOID_INTERRUPT
      *
      * The same except when doing so would interrupt an already running GC.
      */
-    UnprotectedData<double> allocThresholdFactorAvoidInterrupt_;
+    UnprotectedData<float> allocThresholdFactorAvoidInterrupt_;
 
     /*
      * Number of bytes to allocate between incremental slices in GCs triggered
      * by the zone allocation threshold.
      *
      * This value does not have a JSGCParamKey parameter yet.
      */
     UnprotectedData<size_t> zoneAllocDelayBytes_;
@@ -399,26 +399,26 @@ class GCSchedulingTunables
      * JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX
      * JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN
      *
      * When in the |highFrequencyGC| mode, these parameterize the per-zone
      * "HeapGrowthFactor" computation.
      */
     MainThreadData<uint64_t> highFrequencyLowLimitBytes_;
     MainThreadData<uint64_t> highFrequencyHighLimitBytes_;
-    MainThreadData<double> highFrequencyHeapGrowthMax_;
-    MainThreadData<double> highFrequencyHeapGrowthMin_;
+    MainThreadData<float> highFrequencyHeapGrowthMax_;
+    MainThreadData<float> highFrequencyHeapGrowthMin_;
 
     /*
      * JSGC_LOW_FREQUENCY_HEAP_GROWTH
      *
      * When not in |highFrequencyGC| mode, this is the global (stored per-zone)
      * "HeapGrowthFactor".
      */
-    MainThreadData<double> lowFrequencyHeapGrowth_;
+    MainThreadData<float> lowFrequencyHeapGrowth_;
 
     /*
      * JSGC_DYNAMIC_MARK_SLICE
      *
      * Doubles the length of IGC slices when in the |highFrequencyGC| mode.
      */
     MainThreadData<bool> dynamicMarkSliceEnabled_;
 
@@ -466,19 +466,19 @@ class GCSchedulingTunables
     MOZ_MUST_USE bool setParameter(JSGCParamKey key, uint32_t value, const AutoLockGC& lock);
     void resetParameter(JSGCParamKey key, const AutoLockGC& lock);
 
     void setMaxMallocBytes(size_t value);
 
 private:
     void setHighFrequencyLowLimit(uint64_t value);
     void setHighFrequencyHighLimit(uint64_t value);
-    void setHighFrequencyHeapGrowthMin(double value);
-    void setHighFrequencyHeapGrowthMax(double value);
-    void setLowFrequencyHeapGrowth(double value);
+    void setHighFrequencyHeapGrowthMin(float value);
+    void setHighFrequencyHeapGrowthMax(float value);
+    void setLowFrequencyHeapGrowth(float value);
     void setMinEmptyChunkCount(uint32_t value);
     void setMaxEmptyChunkCount(uint32_t value);
 };
 
 class GCSchedulingState
 {
     /*
      * Influences how we schedule and run GC's in several subtle ways. The most
@@ -556,42 +556,42 @@ class MemoryCounter
     void updateOnGCStart();
     void updateOnGCEnd(const GCSchedulingTunables& tunables, const AutoLockGC& lock);
 };
 
 // This class encapsulates the data that determines when we need to do a zone GC.
 class ZoneHeapThreshold
 {
     // The "growth factor" for computing our next thresholds after a GC.
-    GCLockData<double> gcHeapGrowthFactor_;
+    GCLockData<float> gcHeapGrowthFactor_;
 
     // GC trigger threshold for allocations on the GC heap.
     mozilla::Atomic<size_t, mozilla::Relaxed,
                     mozilla::recordreplay::Behavior::DontPreserve> gcTriggerBytes_;
 
   public:
     ZoneHeapThreshold()
-      : gcHeapGrowthFactor_(3.0),
+      : gcHeapGrowthFactor_(3.0f),
         gcTriggerBytes_(0)
     {}
 
-    double gcHeapGrowthFactor() const { return gcHeapGrowthFactor_; }
+    float gcHeapGrowthFactor() const { return gcHeapGrowthFactor_; }
     size_t gcTriggerBytes() const { return gcTriggerBytes_; }
-    double eagerAllocTrigger(bool highFrequencyGC) const;
+    float eagerAllocTrigger(bool highFrequencyGC) const;
 
     void updateAfterGC(size_t lastBytes, JSGCInvocationKind gckind,
                        const GCSchedulingTunables& tunables, const GCSchedulingState& state,
                        const AutoLockGC& lock);
     void updateForRemovedArena(const GCSchedulingTunables& tunables);
 
   private:
-    static double computeZoneHeapGrowthFactorForHeapSize(size_t lastBytes,
-                                                         const GCSchedulingTunables& tunables,
-                                                         const GCSchedulingState& state);
-    static size_t computeZoneTriggerBytes(double growthFactor, size_t lastBytes,
+    static float computeZoneHeapGrowthFactorForHeapSize(size_t lastBytes,
+                                                        const GCSchedulingTunables& tunables,
+                                                        const GCSchedulingState& state);
+    static size_t computeZoneTriggerBytes(float growthFactor, size_t lastBytes,
                                           JSGCInvocationKind gckind,
                                           const GCSchedulingTunables& tunables,
                                           const AutoLockGC& lock);
 };
 
 } // namespace gc
 } // namespace js