Bug 1678097 - Enable Ion for wasm on ARM64 (phase 1). r=lth.

In Phase 1, both Ion and Cranelift are available, and the default is switched
to Cranelift.  Use --wasm-force-ion or --wasm-compiler=ion at the shell to
select Ion, or make sure javascript.options.wasm_force_ion is true in
about:config.  Phase 1 is appropriate for fuzzing, after the patch set lands
in mozilla-central but before Ion is enabled by default.  The patch for Phase
1 will appear on bug 1678097 and will be very small, and MUST land with the
patch for Phase 0.

Differential Revision: https://phabricator.services.mozilla.com/D101867
This commit is contained in:
Lars T Hansen 2021-03-15 16:44:32 +00:00
parent 9e3f77abca
commit 107c575f8d
4 changed files with 15 additions and 18 deletions

View File

@ -1,3 +1,5 @@
// |jit-test| skip-if: !wasmCompilersPresent().match("ion") || wasmIonDisabledByFeatures(); --wasm-compiler=optimizing
assertEq(wasmCompileMode(), "ion");
// When we land wasm-via-Ion/aarch64 phase 2, this can be changed back to
// testing only for Ion.
assertEq(true, wasmCompileMode() === "ion" || wasmCompileMode() === "cranelift");

View File

@ -592,11 +592,9 @@ bool shell::enableSharedMemory = SHARED_MEMORY_DEFAULT;
bool shell::enableWasmBaseline = false;
bool shell::enableWasmOptimizing = false;
#ifdef JS_CODEGEN_ARM64
// Cranelift->Ion transition. The right value for development is 'true'; when
// we land for phase 1, we flip this to 'false'; when we land for phase 2, we
// remove this flag. Also see the reading of the flag wasm-force-cranelift
// below; that becomes wasm-force-ion for phase 1.
bool shell::forceWasmIon = true;
// Cranelift->Ion transition. The right value for fuzzing-but-not-enabled is
// 'false'; when we land for phase 2, we remove this flag.
bool shell::forceWasmIon = false;
#endif
bool shell::enableWasmReftypes = true;
#ifdef ENABLE_WASM_FUNCTION_REFERENCES
@ -10960,7 +10958,7 @@ static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
} else if (commandLineRequestedWasmCranelift) {
forceWasmIon = false;
} else {
forceWasmIon = !op.getBoolOption("wasm-force-cranelift");
forceWasmIon = op.getBoolOption("wasm-force-ion");
}
#endif
@ -11934,11 +11932,11 @@ int main(int argc, char** argv, char** envp) {
!op.addBoolOption('\0', "wasm-exceptions", "No-op") ||
#endif
#ifdef JS_CODEGEN_ARM64
// Cranelift->Ion transition. This becomes wasm-force-ion at Phase 1 of
// the landing and then disappears at Phase 2. See sundry comments above.
// Cranelift->Ion transition. This disappears at Phase 2 of the landing.
// See sundry comments above.
!op.addBoolOption(
'\0', "wasm-force-cranelift",
"Temporary: Force Cranelift in builds with both Cranelift and Ion") ||
'\0', "wasm-force-ion",
"Temporary: Force Ion in builds with both Cranelift and Ion") ||
#endif
!op.addBoolOption('\0', "no-native-regexp",
"Disable native regexp compilation") ||

View File

@ -938,9 +938,7 @@ static void ReloadPrefsCallback(const char* pref, void* aXpccx) {
bool useWasmOptimizing =
Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_optimizingjit");
#ifdef JS_CODEGEN_ARM64
// Cranelift->Ion transition. When we land for phase 1, the default value in
// the prefs file changes from 'true' to 'false'. When we land for phase 2,
// this goes away.
// Cranelift->Ion transition. When we land for phase 2, this goes away.
bool forceWasmIon = Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_force_ion");
#endif
bool useWasmBaseline =

View File

@ -5459,12 +5459,11 @@
#endif
#if defined(MOZ_AARCH64)
# Cranelift->Ion transition. Temporary switch, the value 'true' is correct for
# SM developers. When we land Phase 1 of the transition, the value of this will
# change to 'false'. When we land Phase 2, this switch will disappear altogether.
# Cranelift->Ion transition. Temporary switch. When we land Phase 2
# of the transition, this switch will disappear altogether.
- name: javascript.options.wasm_force_ion
type: bool
value: true
value: false
mirror: always
#endif