mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 907201 - Enable activating TI and IonMonkey for chrome scripts via about:config. r=jandem
--HG-- extra : rebase_source : ee45b0108b4516cff12ecc91014cb566d432a4fa
This commit is contained in:
parent
736bd407f4
commit
b6f4813baa
@ -685,7 +685,8 @@ static const char js_werror_option_str[] = JS_OPTIONS_DOT_STR "werror";
|
||||
static const char js_zeal_option_str[] = JS_OPTIONS_DOT_STR "gczeal";
|
||||
static const char js_zeal_frequency_str[] = JS_OPTIONS_DOT_STR "gczeal.frequency";
|
||||
#endif
|
||||
static const char js_typeinfer_str[] = JS_OPTIONS_DOT_STR "typeinference";
|
||||
static const char js_typeinfer_content_str[] = JS_OPTIONS_DOT_STR "typeinference.content";
|
||||
static const char js_typeinfer_chrome_str[] = JS_OPTIONS_DOT_STR "typeinference.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";
|
||||
static const char js_memnotify_option_str[] = JS_OPTIONS_DOT_STR "mem.notify";
|
||||
@ -694,6 +695,7 @@ static const char js_baselinejit_content_str[] = JS_OPTIONS_DOT_STR "baselinejit
|
||||
static const char js_baselinejit_chrome_str[] = JS_OPTIONS_DOT_STR "baselinejit.chrome";
|
||||
static const char js_baselinejit_eager_str[] = JS_OPTIONS_DOT_STR "baselinejit.unsafe_eager_compilation";
|
||||
static const char js_ion_content_str[] = JS_OPTIONS_DOT_STR "ion.content";
|
||||
static const char js_ion_chrome_str[] = JS_OPTIONS_DOT_STR "ion.chrome";
|
||||
static const char js_ion_eager_str[] = JS_OPTIONS_DOT_STR "ion.unsafe_eager_compilation";
|
||||
static const char js_ion_parallel_compilation_str[] = JS_OPTIONS_DOT_STR "ion.parallel_compilation";
|
||||
|
||||
@ -723,13 +725,17 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
|
||||
nsCOMPtr<nsIDOMWindow> contentWindow(do_QueryInterface(global));
|
||||
nsCOMPtr<nsIDOMChromeWindow> chromeWindow(do_QueryInterface(global));
|
||||
|
||||
bool useTypeInference = !chromeWindow && contentWindow && Preferences::GetBool(js_typeinfer_str);
|
||||
bool useTypeInference = Preferences::GetBool((chromeWindow || !contentWindow) ?
|
||||
js_typeinfer_chrome_str :
|
||||
js_typeinfer_content_str);
|
||||
bool useHardening = Preferences::GetBool(js_jit_hardening_str);
|
||||
bool useBaselineJIT = Preferences::GetBool(chromeWindow || !contentWindow ?
|
||||
bool useBaselineJIT = Preferences::GetBool((chromeWindow || !contentWindow) ?
|
||||
js_baselinejit_chrome_str :
|
||||
js_baselinejit_content_str);
|
||||
bool useBaselineJITEager = Preferences::GetBool(js_baselinejit_eager_str);
|
||||
bool useIon = Preferences::GetBool(js_ion_content_str);
|
||||
bool useIon = Preferences::GetBool((chromeWindow || !contentWindow) ?
|
||||
js_ion_chrome_str :
|
||||
js_ion_content_str);
|
||||
bool useIonEager = Preferences::GetBool(js_ion_eager_str);
|
||||
bool useAsmJS = Preferences::GetBool(js_asmjs_content_str);
|
||||
bool parallelIonCompilation = Preferences::GetBool(js_ion_parallel_compilation_str);
|
||||
|
@ -292,9 +292,6 @@ LoadJSContextOptions(const char* aPrefName, void* /* aClosure */)
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("werror"))) {
|
||||
commonOptions |= JSOPTION_WERROR;
|
||||
}
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("typeinference"))) {
|
||||
commonOptions |= JSOPTION_TYPE_INFERENCE;
|
||||
}
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("asmjs"))) {
|
||||
commonOptions |= JSOPTION_ASMJS;
|
||||
}
|
||||
@ -307,6 +304,9 @@ LoadJSContextOptions(const char* aPrefName, void* /* aClosure */)
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("ion.content"))) {
|
||||
contentOptions |= JSOPTION_ION;
|
||||
}
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("typeinference.content"))) {
|
||||
contentOptions |= JSOPTION_TYPE_INFERENCE;
|
||||
}
|
||||
|
||||
// Chrome options.
|
||||
uint32_t chromeOptions = commonOptions;
|
||||
@ -316,6 +316,9 @@ LoadJSContextOptions(const char* aPrefName, void* /* aClosure */)
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("ion.chrome"))) {
|
||||
chromeOptions |= JSOPTION_ION;
|
||||
}
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("typeinference.chrome"))) {
|
||||
chromeOptions |= JSOPTION_TYPE_INFERENCE;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("strict.debug"))) {
|
||||
chromeOptions |= JSOPTION_EXTRA_WARNINGS;
|
||||
|
@ -822,10 +822,12 @@ pref("javascript.options.strict.debug", true);
|
||||
pref("javascript.options.baselinejit.content", true);
|
||||
pref("javascript.options.baselinejit.chrome", true);
|
||||
pref("javascript.options.ion.content", true);
|
||||
pref("javascript.options.ion.chrome", false);
|
||||
pref("javascript.options.asmjs", true);
|
||||
pref("javascript.options.ion.parallel_compilation", true);
|
||||
pref("javascript.options.jit_hardening", true);
|
||||
pref("javascript.options.typeinference", true);
|
||||
pref("javascript.options.typeinference.content", true);
|
||||
pref("javascript.options.typeinference.chrome", false);
|
||||
// This preference limits the memory usage of javascript.
|
||||
// If you want to change these values for your device,
|
||||
// please find Bug 417052 comment 17 and Bug 456721
|
||||
|
Loading…
Reference in New Issue
Block a user