From 1a21b526928b0c5815aa3910499ac980714fa25b Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 3 Dec 2020 13:56:36 +0000 Subject: Issue #1624 - Make ion inlining optimizations a pref. This also adds it to JS_SetGlobalJitCompilerOption() --- js/src/jit/JitOptions.cpp | 2 +- js/src/jsapi.cpp | 3 +++ js/src/jsapi.h | 1 + js/xpconnect/src/XPCJSContext.cpp | 5 +++++ 4 files changed, 10 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/src/jit/JitOptions.cpp b/js/src/jit/JitOptions.cpp index 7521a9fae..daae3d53b 100644 --- a/js/src/jit/JitOptions.cpp +++ b/js/src/jit/JitOptions.cpp @@ -96,7 +96,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 dab4c25a4..e9f86bde1 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -6607,6 +6607,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 f8203ee1f..1eecdbf74 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -5905,6 +5905,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 5dcc71e82..9bc69c957 100644 --- a/js/xpconnect/src/XPCJSContext.cpp +++ b/js/xpconnect/src/XPCJSContext.cpp @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -1428,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 @@ -1458,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() -- cgit v1.2.3