Bug 1725584 - Support getting the urgent threshold parameter r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 13 Aug 2021 13:58:24 +0000
changeset 588831 b2ef4a880c6b57bcf92884b484a83743192dfd72
parent 588830 bba88f3be2ff7d8d294414650c0cd10e7d4873e2
child 588832 22f5751c8d43fd2e8f872970b8b9e3412d389e8f
push id38704
push usernerli@mozilla.com
push dateFri, 13 Aug 2021 21:52:47 +0000
treeherdermozilla-central@df4b218d495a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1725584
milestone93.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 1725584 - Support getting the urgent threshold parameter r=sfink Differential Revision: https://phabricator.services.mozilla.com/D122599
js/src/builtin/TestingFunctions.cpp
js/src/gc/GC.cpp
js/src/gc/Scheduling.h
js/src/jit-test/tests/gc/gcparam.js
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -681,16 +681,17 @@ static bool MinorGC(JSContext* cx, unsig
   _("nurseryFreeThresholdForIdleCollectionPercent",                        \
     JSGC_NURSERY_FREE_THRESHOLD_FOR_IDLE_COLLECTION_PERCENT, true)         \
   _("nurseryTimeoutForIdleCollectionMS",                                   \
     JSGC_NURSERY_TIMEOUT_FOR_IDLE_COLLECTION_MS, true)                     \
   _("pretenureThreshold", JSGC_PRETENURE_THRESHOLD, true)                  \
   _("pretenureGroupThreshold", JSGC_PRETENURE_GROUP_THRESHOLD, true)       \
   _("zoneAllocDelayKB", JSGC_ZONE_ALLOC_DELAY_KB, true)                    \
   _("mallocThresholdBase", JSGC_MALLOC_THRESHOLD_BASE, true)               \
+  _("urgentThreshold", JSGC_URGENT_THRESHOLD_BYTES, true)                  \
   _("chunkBytes", JSGC_CHUNK_BYTES, false)                                 \
   _("helperThreadRatio", JSGC_HELPER_THREAD_RATIO, true)                   \
   _("maxHelperThreads", JSGC_MAX_HELPER_THREADS, true)                     \
   _("helperThreadCount", JSGC_HELPER_THREAD_COUNT, false)                  \
   _("systemPageSizeKB", JSGC_SYSTEM_PAGE_SIZE_KB, false)
 
 static const struct ParamInfo {
   const char* name;
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -1883,16 +1883,18 @@ uint32_t GCRuntime::getParameter(JSGCPar
     case JSGC_STOP_PRETENURE_STRING_THRESHOLD:
       return uint32_t(tunables.stopPretenureStringThreshold() * 100);
     case JSGC_MIN_LAST_DITCH_GC_PERIOD:
       return tunables.minLastDitchGCPeriod().ToSeconds();
     case JSGC_ZONE_ALLOC_DELAY_KB:
       return tunables.zoneAllocDelayBytes() / 1024;
     case JSGC_MALLOC_THRESHOLD_BASE:
       return tunables.mallocThresholdBase() / 1024 / 1024;
+    case JSGC_URGENT_THRESHOLD_BYTES:
+      return tunables.urgentThresholdBytes() / 1024 / 1024;
     case JSGC_CHUNK_BYTES:
       return ChunkSize;
     case JSGC_HELPER_THREAD_RATIO:
       MOZ_ASSERT(helperThreadRatio > 0.0);
       return uint32_t(helperThreadRatio * 100.0);
     case JSGC_MAX_HELPER_THREADS:
       MOZ_ASSERT(maxHelperThreads <= UINT32_MAX);
       return maxHelperThreads;
--- a/js/src/gc/Scheduling.h
+++ b/js/src/gc/Scheduling.h
@@ -387,17 +387,17 @@ static const double LowFrequencyHeapGrow
 static const uint32_t MinEmptyChunkCount = 1;
 
 /* JSGC_MAX_EMPTY_CHUNK_COUNT */
 static const uint32_t MaxEmptyChunkCount = 30;
 
 /* JSGC_SLICE_TIME_BUDGET_MS */
 static const int64_t DefaultTimeBudgetMS = 0;  // Unlimited by default.
 
-/* JSGC_INCREMENTAL_ENABLED */
+/* JSGC_INCREMENTAL_GC_ENABLED */
 static const bool IncrementalGCEnabled = false;
 
 /* JSGC_PER_ZONE_GC_ENABLED */
 static const bool PerZoneGCEnabled = false;
 
 /* JSGC_COMPACTING_ENABLED */
 static const bool CompactingEnabled = true;
 
--- a/js/src/jit-test/tests/gc/gcparam.js
+++ b/js/src/jit-test/tests/gc/gcparam.js
@@ -47,12 +47,13 @@ testChangeParam("highFrequencyLargeHeapG
 testChangeParam("lowFrequencyHeapGrowth");
 testChangeParam("allocationThreshold");
 testChangeParam("smallHeapIncrementalLimit");
 testChangeParam("largeHeapIncrementalLimit");
 testChangeParam("minEmptyChunkCount");
 testChangeParam("maxEmptyChunkCount");
 testChangeParam("compactingEnabled");
 testChangeParam("mallocThresholdBase");
+testChangeParam("urgentThreshold");
 testChangeParam("nurseryTimeoutForIdleCollectionMS");
 
 testMBParamValue("smallHeapSizeMax");
 testMBParamValue("largeHeapSizeMin");