Bug 1821671 - Part 2: Add pref for setting the maximum number of marking threads to use r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D207288
This commit is contained in:
Jon Coppeard 2024-04-16 14:33:15 +00:00
Родитель 8d433aa181
Коммит 77af3c2f55
5 изменённых файлов: 17 добавлений и 1 удалений

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

@ -2138,6 +2138,11 @@ void nsJSContext::EnsureStatics() {
"javascript.options.mem.gc_parallel_marking_threshold_mb",
(void*)JSGC_PARALLEL_MARKING_THRESHOLD_MB);
Preferences::RegisterCallbackAndCall(
SetMemoryPrefChangedCallbackInt,
"javascript.options.mem.gc_max_parallel_marking_threads",
(void*)JSGC_MAX_MARKING_THREADS);
Preferences::RegisterCallbackAndCall(
SetMemoryGCSliceTimePrefChangedCallback,
"javascript.options.mem.gc_incremental_slice_ms");

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

@ -372,6 +372,7 @@ void LoadJSGCMemoryOptions(const char* aPrefName, void* /* aClosure */) {
PREF("gc_parallel_marking", JSGC_PARALLEL_MARKING_ENABLED),
PREF("gc_parallel_marking_threshold_mb",
JSGC_PARALLEL_MARKING_THRESHOLD_MB),
PREF("gc_max_parallel_marking_threads", JSGC_MAX_MARKING_THREADS),
#ifdef NIGHTLY_BUILD
PREF("gc_experimental_semispace_nursery", JSGC_SEMISPACE_NURSERY_ENABLED),
#endif
@ -454,6 +455,7 @@ void LoadJSGCMemoryOptions(const char* aPrefName, void* /* aClosure */) {
case JSGC_MAX_EMPTY_CHUNK_COUNT:
case JSGC_HEAP_GROWTH_FACTOR:
case JSGC_PARALLEL_MARKING_THRESHOLD_MB:
case JSGC_MAX_MARKING_THREADS:
UpdateCommonJSGCMemoryOption(rts, pref->fullName, pref->key);
break;
default:

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

@ -469,7 +469,7 @@ typedef enum JSGCParamKey {
* helper threads and can be found by getting the JSGC_MARKING_THREAD_COUNT
* parameter.
*
* Pref: None.
* Pref: javascript.options.mem.gc_max_parallel_marking_threads
* Default: 2.
*/
JSGC_MAX_MARKING_THREADS = 52,

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

@ -983,6 +983,9 @@ pref("javascript.options.mem.gc_parallel_marking_threshold_mb", 16);
pref("javascript.options.mem.gc_parallel_marking_threshold_mb", 16);
#endif
// JSGC_MAX_MARKING_THREADS
pref("javascript.options.mem.gc_max_parallel_marking_threads", 2);
// JSGC_HIGH_FREQUENCY_TIME_LIMIT
pref("javascript.options.mem.gc_high_frequency_time_limit_ms", 1000);

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

@ -2092,6 +2092,12 @@ gc:
setPref:
branch: user
pref: "javascript.options.mem.gc_parallel_marking_threshold_mb"
gc_max_parallel_marking_threads:
description: The maximum number of threads to use for parallel marking, if enabled.
type: int
setPref:
branch: user
pref: "javascript.options.mem.gc_max_parallel_marking_threads"
gc_per_zone:
description: Whether per-zone GC is enabled. If not, all zones are collected every time.
type: boolean