Add a pref and control mechanism for GGC and disable it.

Tests show nothing but regressions using GGC, even in Mozilla's own microbench for GC.
Real-time flippable, if needed.
This commit is contained in:
wolfbeast
2016-07-29 17:58:00 +02:00
committed by roytam1
parent f9aba83ef9
commit 1659ac189a
4 changed files with 21 additions and 0 deletions
+5
View File
@@ -2337,6 +2337,7 @@ SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
{
bool enableCompartmentGC = Preferences::GetBool("javascript.options.mem.gc_per_compartment");
bool enableIncrementalGC = Preferences::GetBool("javascript.options.mem.gc_incremental");
bool enableGenerationalGC = Preferences::GetBool("javascript.options.mem.gc_generational");
JSGCMode mode;
if (enableIncrementalGC) {
mode = JSGC_MODE_INCREMENTAL;
@@ -2346,6 +2347,7 @@ SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
mode = JSGC_MODE_GLOBAL;
}
JS_SetGCParameter(sRuntime, JSGC_MODE, mode);
JS_SetGGCMode(sRuntime, enableGenerationalGC);
}
static void
@@ -2626,6 +2628,9 @@ nsJSContext::EnsureStatics()
Preferences::RegisterCallbackAndCall(SetMemoryGCSliceTimePrefChangedCallback,
"javascript.options.mem.gc_incremental_slice_ms");
Preferences::RegisterCallbackAndCall(SetMemoryGCModePrefChangedCallback,
"javascript.options.mem.gc_generational");
Preferences::RegisterCallbackAndCall(SetMemoryGCCompactingPrefChangedCallback,
"javascript.options.mem.gc_compacting");