diff options
author | Moonchild <moonchild@palemoon.org> | 2020-12-03 13:56:36 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-12-13 18:13:03 +0000 |
commit | bcb46bf65e5d4de038ecc052fe160b1910c1d307 (patch) | |
tree | b2d2f21d2409761ab54690480a9c7b582de3b871 | |
parent | 176f4fe20686a34e315b3b512330e1a310023854 (diff) | |
download | UXP-bcb46bf65e5d4de038ecc052fe160b1910c1d307.tar UXP-bcb46bf65e5d4de038ecc052fe160b1910c1d307.tar.gz UXP-bcb46bf65e5d4de038ecc052fe160b1910c1d307.tar.lz UXP-bcb46bf65e5d4de038ecc052fe160b1910c1d307.tar.xz UXP-bcb46bf65e5d4de038ecc052fe160b1910c1d307.zip |
Issue #1624 - Make ion inlining optimizations a pref.
This also adds it to JS_SetGlobalJitCompilerOption()
-rw-r--r-- | dom/base/nsJSUtils.cpp | 5 | ||||
-rw-r--r-- | js/src/jit/JitOptions.cpp | 2 | ||||
-rw-r--r-- | js/src/jsapi.cpp | 3 | ||||
-rw-r--r-- | js/src/jsapi.h | 1 | ||||
-rw-r--r-- | js/xpconnect/src/XPCJSContext.cpp | 4 | ||||
-rw-r--r-- | modules/libpref/init/all.js | 1 |
6 files changed, 13 insertions, 3 deletions
diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index 2e6e345a3..bc8253930 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -298,10 +298,11 @@ nsJSUtils::CompileModule(JSContext* aCx, NS_ENSURE_TRUE(xpc::Scriptability::Get(aEvaluationGlobal).Allowed(), NS_OK); - if (!JS::CompileModule(aCx, aCompileOptions, aSrcBuf, aModule)) { + bool compileResult = JS::CompileModule(aCx, aCompileOptions, aSrcBuf, aModule); + + if (!compileResult) { return NS_ERROR_FAILURE; } - return NS_OK; } diff --git a/js/src/jit/JitOptions.cpp b/js/src/jit/JitOptions.cpp index 90ef445f0..b9a7c7b27 100644 --- a/js/src/jit/JitOptions.cpp +++ b/js/src/jit/JitOptions.cpp @@ -97,7 +97,7 @@ DefaultJitOptions::DefaultJitOptions() SET_DEFAULT(disableGvn, false); // Toggles whether inlining is globally disabled. - SET_DEFAULT(disableInlining, true); + SET_DEFAULT(disableInlining, false); // Toggles whether loop invariant code motion is globally disabled. SET_DEFAULT(disableLicm, false); diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index cd370e42c..3c1dbfb91 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -6608,6 +6608,9 @@ JS_SetGlobalJitCompilerOption(JSContext* cx, JSJitCompilerOption opt, uint32_t v case JSJITCOMPILER_ION_INTERRUPT_WITHOUT_SIGNAL: jit::JitOptions.ionInterruptWithoutSignals = !!value; break; + case JSJITCOMPILER_ION_INLINING: + jit::JitOptions.disableInlining = !value; + break; default: break; } diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 5cdfd958e..2c221dbe4 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -5906,6 +5906,7 @@ JS_SetOffthreadIonCompilationEnabled(JSContext* cx, bool enabled); Register(ION_GVN_ENABLE, "ion.gvn.enable") \ Register(ION_FORCE_IC, "ion.forceinlineCaches") \ Register(ION_ENABLE, "ion.enable") \ + Register(ION_INLINING, "ion.inlining") \ Register(ION_INTERRUPT_WITHOUT_SIGNAL, "ion.interrupt-without-signals") \ Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \ Register(BASELINE_ENABLE, "baseline.enable") \ diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp index 511bc8a98..9bc69c957 100644 --- a/js/xpconnect/src/XPCJSContext.cpp +++ b/js/xpconnect/src/XPCJSContext.cpp @@ -1429,6 +1429,8 @@ ReloadPrefsCallback(const char* pref, void* data) bool unboxedObjects = Preferences::GetBool(JS_OPTIONS_DOT_STR "unboxed_objects"); + bool inlining = Preferences::GetBool(JS_OPTIONS_DOT_STR "ion.inlining"); + sSharedMemoryEnabled = Preferences::GetBool(JS_OPTIONS_DOT_STR "shared_memory"); #ifdef DEBUG @@ -1459,6 +1461,8 @@ ReloadPrefsCallback(const char* pref, void* data) useIonEager ? 0 : -1); JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_UNBOXED_OBJECTS, unboxedObjects); + JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_ION_INLINING, + inlining); } XPCJSContext::~XPCJSContext() diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 9f1880668..493e0d559 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1275,6 +1275,7 @@ pref("javascript.options.strict.debug", false); pref("javascript.options.unboxed_objects", false); pref("javascript.options.baselinejit", true); pref("javascript.options.ion", true); +pref("javascript.options.ion.inlining", true); pref("javascript.options.asmjs", true); pref("javascript.options.wasm", true); // wasm jit crashes in 32bit builds because of 64bit casts so |