зеркало из https://github.com/mozilla/gecko-dev.git
Bug 700822: Add javascript.options.jit_hardening pref, default enabled. (r=dmandelin)
This commit is contained in:
Родитель
595d492eed
Коммит
a4908dc54a
|
@ -418,6 +418,7 @@ user_pref("javascript.options.showInConsole", true);
|
|||
user_pref("devtools.errorconsole.enabled", true);
|
||||
user_pref("layout.debug.enable_data_xbl", true);
|
||||
user_pref("browser.EULA.override", true);
|
||||
user_pref("javascript.options.jit_hardening", true);
|
||||
user_pref("gfx.color_management.force_srgb", true);
|
||||
user_pref("network.manage-offline-status", false);
|
||||
user_pref("test.mousescroll", true);
|
||||
|
|
|
@ -937,6 +937,7 @@ static const char js_methodjit_always_str[] = JS_OPTIONS_DOT_STR "methodjit_al
|
|||
static const char js_typeinfer_str[] = JS_OPTIONS_DOT_STR "typeinference";
|
||||
static const char js_pccounts_content_str[] = JS_OPTIONS_DOT_STR "pccounts.content";
|
||||
static const char js_pccounts_chrome_str[] = JS_OPTIONS_DOT_STR "pccounts.chrome";
|
||||
static const char js_jit_hardening_str[] = JS_OPTIONS_DOT_STR "jit_hardening";
|
||||
static const char js_memlog_option_str[] = JS_OPTIONS_DOT_STR "mem.log";
|
||||
|
||||
int
|
||||
|
@ -973,6 +974,7 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
|||
js_pccounts_content_str);
|
||||
bool useMethodJITAlways = Preferences::GetBool(js_methodjit_always_str);
|
||||
bool useTypeInference = !chromeWindow && Preferences::GetBool(js_typeinfer_str);
|
||||
bool useHardening = Preferences::GetBool(js_jit_hardening_str);
|
||||
nsCOMPtr<nsIXULRuntime> xr = do_GetService(XULRUNTIME_SERVICE_CONTRACTID);
|
||||
if (xr) {
|
||||
bool safeMode = false;
|
||||
|
@ -984,6 +986,7 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
|||
usePCCounts = false;
|
||||
useTypeInference = false;
|
||||
useMethodJITAlways = true;
|
||||
useHardening = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1012,6 +1015,11 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
|||
else
|
||||
newDefaultJSOptions &= ~JSOPTION_METHODJIT_ALWAYS;
|
||||
|
||||
if (useHardening)
|
||||
newDefaultJSOptions &= ~JSOPTION_SOFTEN;
|
||||
else
|
||||
newDefaultJSOptions |= JSOPTION_SOFTEN;
|
||||
|
||||
if (useTypeInference)
|
||||
newDefaultJSOptions |= JSOPTION_TYPE_INFERENCE;
|
||||
else
|
||||
|
|
|
@ -2177,11 +2177,12 @@ JS_StringToVersion(const char *string);
|
|||
#define JSOPTION_PCCOUNT JS_BIT(17) /* Collect per-op execution counts */
|
||||
|
||||
#define JSOPTION_TYPE_INFERENCE JS_BIT(18) /* Perform type inference. */
|
||||
#define JSOPTION_SOFTEN JS_BIT(19) /* Disable JIT hardening. */
|
||||
|
||||
/* Options which reflect compile-time properties of scripts. */
|
||||
#define JSCOMPILEOPTION_MASK (JSOPTION_XML)
|
||||
|
||||
#define JSRUNOPTION_MASK (JS_BITMASK(19) & ~JSCOMPILEOPTION_MASK)
|
||||
#define JSRUNOPTION_MASK (JS_BITMASK(20) & ~JSCOMPILEOPTION_MASK)
|
||||
#define JSALLOPTION_MASK (JSCOMPILEOPTION_MASK | JSRUNOPTION_MASK)
|
||||
|
||||
extern JS_PUBLIC_API(uint32)
|
||||
|
|
|
@ -1127,6 +1127,7 @@ struct JSContext
|
|||
bool hasStrictOption() const { return hasRunOption(JSOPTION_STRICT); }
|
||||
bool hasWErrorOption() const { return hasRunOption(JSOPTION_WERROR); }
|
||||
bool hasAtLineOption() const { return hasRunOption(JSOPTION_ATLINE); }
|
||||
bool hasJITHardeningOption() const { return !hasRunOption(JSOPTION_SOFTEN); }
|
||||
|
||||
js::LifoAlloc &tempLifoAlloc() { return JS_THREAD_DATA(this)->tempLifoAlloc; }
|
||||
inline js::LifoAlloc &typeLifoAlloc();
|
||||
|
|
|
@ -635,6 +635,7 @@ pref("javascript.options.jitprofiling.chrome", true);
|
|||
pref("javascript.options.pccounts.content", false);
|
||||
pref("javascript.options.pccounts.chrome", false);
|
||||
pref("javascript.options.methodjit_always", false);
|
||||
pref("javascript.options.jit_hardening", true);
|
||||
pref("javascript.options.typeinference", true);
|
||||
// This preference limits the memory usage of javascript.
|
||||
// If you want to change these values for your device,
|
||||
|
|
Загрузка…
Ссылка в новой задаче