Bug 837628 - Add baseline JIT browser prefs. r=djvj

This commit is contained in:
Jan de Mooij 2013-02-05 11:11:26 +01:00
parent 9bb5b098b5
commit def61568bd
2 changed files with 13 additions and 0 deletions

View File

@ -964,6 +964,8 @@ static const char js_memlog_option_str[] = JS_OPTIONS_DOT_STR "mem.log";
static const char js_memnotify_option_str[] = JS_OPTIONS_DOT_STR "mem.notify";
static const char js_disable_explicit_compartment_gc[] =
JS_OPTIONS_DOT_STR "mem.disable_explicit_compartment_gc";
static const char js_baselinejit_content_str[] = JS_OPTIONS_DOT_STR "baselinejit.content";
static const char js_baselinejit_chrome_str[] = JS_OPTIONS_DOT_STR "baselinejit.chrome";
static const char js_ion_content_str[] = JS_OPTIONS_DOT_STR "ion.content";
static const char js_ion_parallel_compilation_str[] = JS_OPTIONS_DOT_STR "ion.parallel_compilation";
@ -1004,6 +1006,9 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
bool useMethodJITAlways = Preferences::GetBool(js_methodjit_always_str);
bool useTypeInference = !chromeWindow && contentWindow && Preferences::GetBool(js_typeinfer_str);
bool useHardening = Preferences::GetBool(js_jit_hardening_str);
bool useBaselineJIT = Preferences::GetBool(chromeWindow || !contentWindow ?
js_baselinejit_chrome_str :
js_baselinejit_content_str);
bool useIon = Preferences::GetBool(js_ion_content_str);
bool parallelIonCompilation = Preferences::GetBool(js_ion_parallel_compilation_str);
nsCOMPtr<nsIXULRuntime> xr = do_GetService(XULRUNTIME_SERVICE_CONTRACTID);
@ -1016,6 +1021,7 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
useTypeInference = false;
useMethodJITAlways = true;
useHardening = false;
useBaselineJIT = false;
useIon = false;
}
}
@ -1040,6 +1046,11 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
else
newDefaultJSOptions &= ~JSOPTION_TYPE_INFERENCE;
if (useBaselineJIT)
newDefaultJSOptions |= JSOPTION_BASELINE;
else
newDefaultJSOptions &= ~JSOPTION_BASELINE;
if (useIon)
newDefaultJSOptions |= JSOPTION_ION;
else

View File

@ -735,6 +735,8 @@ pref("javascript.options.strict.debug", true);
#endif
pref("javascript.options.methodjit.content", true);
pref("javascript.options.methodjit.chrome", true);
pref("javascript.options.baselinejit.content", true);
pref("javascript.options.baselinejit.chrome", false);
pref("javascript.options.ion.content", true);
pref("javascript.options.ion.parallel_compilation", true);
pref("javascript.options.pccounts.content", false);