summaryrefslogtreecommitdiffstats
path: root/dom/base/nsJSEnvironment.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-02 20:44:40 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-02 20:44:40 +0100
commit4bf1a2a1cb61a165c0540208098070222eafdfff (patch)
tree41e81fdf433c32c263cb2fad07f87812e30c747a /dom/base/nsJSEnvironment.cpp
parentc0c702a5e3284e843e680064b4c6a7280242c567 (diff)
parentb80de6fe930792c94c9e64dd3867ffb1d663f16f (diff)
downloadUXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar.gz
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar.lz
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.tar.xz
UXP-4bf1a2a1cb61a165c0540208098070222eafdfff.zip
Merge branch 'ported-moebius'
Diffstat (limited to 'dom/base/nsJSEnvironment.cpp')
-rw-r--r--dom/base/nsJSEnvironment.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index b273d00c9..576f3052a 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2282,6 +2282,7 @@ SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
{
bool enableZoneGC = Preferences::GetBool("javascript.options.mem.gc_per_zone");
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;
@@ -2291,6 +2292,7 @@ SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
mode = JSGC_MODE_GLOBAL;
}
JS_SetGCParameter(sContext, JSGC_MODE, mode);
+ JS_SetGGCMode(sContext, enableGenerationalGC);
}
static void
@@ -2485,6 +2487,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");