Bug 1509441: Unify wasm compilation switches under the --wasm-compiler umbrella; r=lth
authorBenjamin Bouvier <benj@benj.me>
Wed, 23 Jan 2019 12:33:01 +0100
changeset 515298 48dc14f79fb0a51ca796257a4179fe6f16b71b14
parent 515297 85c33286abbfb2229abeb6cd3240fa24f8048b0f
child 515299 677eda6bdaf96eab98a43cfe4e4ab47d53f9e29c
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1509441
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509441: Unify wasm compilation switches under the --wasm-compiler umbrella; r=lth
dom/workers/RuntimeService.cpp
js/src/builtin/TestingFunctions.cpp
js/src/jit-test/jit_test.py
js/src/jit-test/tests/debug/bug1330339.js
js/src/jit-test/tests/debug/bug1330489-sps.js
js/src/jit-test/tests/debug/bug1330489.js
js/src/jit-test/tests/debug/bug1330491.js
js/src/jit-test/tests/debug/bug1331064.js
js/src/jit-test/tests/debug/bug1331592.js
js/src/jit-test/tests/debug/bug1332493.js
js/src/jit-test/tests/debug/bug1343579.js
js/src/jit-test/tests/debug/wasm-06-onEnterFrame-null.js
js/src/jit-test/tests/debug/wasm-06-onPop-null.js
js/src/jit-test/tests/debug/wasm-06.js
js/src/jit-test/tests/debug/wasm-07.js
js/src/jit-test/tests/debug/wasm-08.js
js/src/jit-test/tests/debug/wasm-09.js
js/src/jit-test/tests/debug/wasm-10.js
js/src/jit-test/tests/debug/wasm-11.js
js/src/jit-test/tests/debug/wasm-12.js
js/src/jit-test/tests/debug/wasm-13.js
js/src/jit-test/tests/debug/wasm-breakpoint.js
js/src/jit-test/tests/debug/wasm-get-return.js
js/src/jit-test/tests/debug/wasm-getAllColumnOffsets.js
js/src/jit-test/tests/debug/wasm-jseval.js
js/src/jit-test/tests/debug/wasm-responseurls.js
js/src/jit-test/tests/debug/wasm-sourceMappingURL.js
js/src/jit-test/tests/debug/wasm-step.js
js/src/jit-test/tests/wasm/bench/directives.txt
js/src/jit-test/tests/wasm/directives.txt
js/src/jit-test/tests/wasm/regress/directives.txt
js/src/jit-test/tests/wasm/spec/directives.txt
js/src/jit-test/tests/wasm/timeout/directives.txt
js/src/jsapi.h
js/src/shell/fuzz-flags.txt
js/src/shell/js.cpp
js/src/tests/lib/jittests.py
js/src/tests/lib/tests.py
js/src/wasm/Makefile
js/src/wasm/WasmCompile.cpp
js/src/wasm/WasmJS.cpp
js/xpconnect/src/XPCJSContext.cpp
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -278,17 +278,17 @@ void LoadContextOptions(const char* aPre
   // Context options.
   JS::ContextOptions contextOptions;
   contextOptions.setAsmJS(GetWorkerPref<bool>(NS_LITERAL_CSTRING("asmjs")))
       .setWasm(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm")))
       .setWasmBaseline(
           GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_baselinejit")))
       .setWasmIon(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_ionjit")))
 #ifdef ENABLE_WASM_CRANELIFT
-      .setWasmForceCranelift(
+      .setWasmCranelift(
           GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_cranelift")))
 #endif
 #ifdef ENABLE_WASM_REFTYPES
       .setWasmGc(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_gc")))
 #endif
       .setWasmVerbose(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_verbose")))
       .setThrowOnAsmJSValidationFailure(GetWorkerPref<bool>(
           NS_LITERAL_CSTRING("throw_on_asmjs_validation_failure")))
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -641,30 +641,30 @@ static bool WasmCachingIsSupported(JSCon
   args.rval().setBoolean(wasm::HasCachingSupport(cx));
   return true;
 }
 
 static bool WasmThreadsSupported(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
   bool isSupported = wasm::HasSupport(cx);
 #ifdef ENABLE_WASM_CRANELIFT
-  if (cx->options().wasmForceCranelift()) {
+  if (cx->options().wasmCranelift()) {
     isSupported = false;
   }
 #endif
   args.rval().setBoolean(isSupported);
   return true;
 }
 
 static bool WasmBulkMemSupported(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 #ifdef ENABLE_WASM_BULKMEM_OPS
   bool isSupported = true;
 #  ifdef ENABLE_WASM_CRANELIFT
-  if (cx->options().wasmForceCranelift()) {
+  if (cx->options().wasmCranelift()) {
     isSupported = false;
   }
 #  endif
 #else
   bool isSupported = false;
 #endif
   args.rval().setBoolean(isSupported);
   return true;
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -220,17 +220,17 @@ def main(argv):
     # wasm-baseline run when requesting --jitflags=interp, but the test
     # contains test-also-noasmjs.)
     test_flags = get_jitflags(options.jitflags)
     options.asmjs_enabled = True
     options.wasm_enabled = True
     if all(['--no-asmjs' in flags for flags in test_flags]):
         options.asmjs_enabled = False
         options.wasm_enabled = False
-    if all(['--no-wasm' in flags for flags in test_flags]):
+    if all(['--wasm-compiler=none' in flags for flags in test_flags]):
         options.asmjs_enabled = False
         options.wasm_enabled = False
 
     if test_args:
         read_all = False
         for arg in test_args:
             test_list += jittests.find_tests(arg, run_binast=options.run_binast)
 
--- a/js/src/jit-test/tests/debug/bug1330339.js
+++ b/js/src/jit-test/tests/debug/bug1330339.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; error: TestComplete
+// |jit-test| test-also-wasm-compiler-ion; error: TestComplete
 
 if (!wasmDebuggingIsSupported())
      throw "TestComplete";
 
 let module = new WebAssembly.Module(wasmTextToBinary(`
     (module
         (import "global" "func")
         (func (export "test")
--- a/js/src/jit-test/tests/debug/bug1330489-sps.js
+++ b/js/src/jit-test/tests/debug/bug1330489-sps.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; error: TestComplete
+// |jit-test| test-also-wasm-compiler-ion; error: TestComplete
 
 load(libdir + "asserts.js");
 
 if (!wasmDebuggingIsSupported())
     throw "TestComplete";
 
 // Single-step profiling currently only works in the ARM simulator
 if (!getBuildConfiguration()["arm-simulator"])
--- a/js/src/jit-test/tests/debug/bug1330489.js
+++ b/js/src/jit-test/tests/debug/bug1330489.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; error: TestComplete
+// |jit-test| test-also-wasm-compiler-ion; error: TestComplete
 
 load(libdir + "asserts.js");
 
 if (!wasmDebuggingIsSupported())
     throw "TestComplete";
 
 var g = newGlobal({newCompartment: true});
 g.parent = this;
--- a/js/src/jit-test/tests/debug/bug1330491.js
+++ b/js/src/jit-test/tests/debug/bug1330491.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; error: TestComplete
+// |jit-test| test-also-wasm-compiler-ion; error: TestComplete
 
 if (!wasmDebuggingIsSupported())
      throw "TestComplete";
 
 (function createShortLivedDebugger() {
     var g = newGlobal({newCompartment: true});
     g.debuggeeGlobal = this;
     g.eval("(" + function () {
--- a/js/src/jit-test/tests/debug/bug1331064.js
+++ b/js/src/jit-test/tests/debug/bug1331064.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
 
 load(libdir + "asserts.js");
 
 var g = newGlobal();
 g.parent = this;
 g.eval("new Debugger(parent).onExceptionUnwind = function () {  some_error; };");
 
 var module = new WebAssembly.Module(wasmTextToBinary(`
--- a/js/src/jit-test/tests/debug/bug1331592.js
+++ b/js/src/jit-test/tests/debug/bug1331592.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; error: TestComplete
+// |jit-test| test-also-wasm-compiler-ion; error: TestComplete
 
 if (!wasmDebuggingIsSupported())
      throw "TestComplete";
 
 var module = new WebAssembly.Module(wasmTextToBinary(`
     (module
         (import "global" "func" (result i32))
         (func (export "func_0") (result i32)
--- a/js/src/jit-test/tests/debug/bug1332493.js
+++ b/js/src/jit-test/tests/debug/bug1332493.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
 // Checking in debug frame is initialized properly during stack overflow.
 
 var dbg;
 (function () { dbg = new (newGlobal().Debugger)(this); })();
 
 var m = new WebAssembly.Module(wasmTextToBinary(`(module
     (import "a" "b" (result f64))
     ;; function that allocated large space for locals on the stack
--- a/js/src/jit-test/tests/debug/bug1343579.js
+++ b/js/src/jit-test/tests/debug/bug1343579.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 // Checking if Debugger.Script.isInCatchScope return false for wasm.
 
 load(libdir + "wasm.js");
 
 var results;
 wasmRunWithDebugger(
     '(module (memory 1) ' +
     '(func $func0 i32.const 1000000 i32.load drop) ' +
--- a/js/src/jit-test/tests/debug/wasm-06-onEnterFrame-null.js
+++ b/js/src/jit-test/tests/debug/wasm-06-onEnterFrame-null.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
 // Checking resumption values for 'null' at onEnterFrame.
 
 load(libdir + "asserts.js");
 
 var g = newGlobal('');
 var dbg = new Debugger();
 dbg.addDebuggee(g);
 sandbox.eval(`
--- a/js/src/jit-test/tests/debug/wasm-06-onPop-null.js
+++ b/js/src/jit-test/tests/debug/wasm-06-onPop-null.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; exitstatus: 3; skip-if: !wasmDebuggingIsSupported()
 // Checking resumption values for 'null' at frame's onPop.
 
 load(libdir + "asserts.js");
 
 var g = newGlobal('');
 var dbg = new Debugger();
 dbg.addDebuggee(g);
 sandbox.eval(`
--- a/js/src/jit-test/tests/debug/wasm-06.js
+++ b/js/src/jit-test/tests/debug/wasm-06.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; error: TestComplete; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; error: TestComplete; skip-if: !wasmDebuggingIsSupported()
 // Tests that wasm module scripts raises onEnterFrame and onLeaveFrame events.
 
 load(libdir + "asserts.js");
 
 function runWasmWithDebugger(wast, lib, init, done) {
     let g = newGlobal({newCompartment: true});
     let dbg = new Debugger(g);
 
--- a/js/src/jit-test/tests/debug/wasm-07.js
+++ b/js/src/jit-test/tests/debug/wasm-07.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 
 // Checking existence of all frame.offset references during onEnterFrame,
 // onLeaveFrame and onStep events in the source code, and that we can
 // potentially resolve offset back to the line/column.
 
 load(libdir + "wasm.js");
 
 var offsets;
--- a/js/src/jit-test/tests/debug/wasm-08.js
+++ b/js/src/jit-test/tests/debug/wasm-08.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 // Checking if we destroying work registers by breakpoint/step handler.
 
 load(libdir + "wasm.js");
 
 // Running the following code compiled from C snippet:
 //
 //     signed func0(signed n) {
 //         double a = 1; float b = 0; signed c = 1; long long d = 1;
--- a/js/src/jit-test/tests/debug/wasm-09.js
+++ b/js/src/jit-test/tests/debug/wasm-09.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 // Tests debugEnabled state of wasm when allowUnobservedAsmJS == true.
 
 load(libdir + "asserts.js");
 
 // Checking that there are no offsets are present in a wasm instance script for
 // which debug mode was not enabled.
 function getWasmScriptWithoutAllowUnobservedAsmJS(wast) {
     var sandbox = newGlobal({newCompartment: true});
--- a/js/src/jit-test/tests/debug/wasm-10.js
+++ b/js/src/jit-test/tests/debug/wasm-10.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 // Tests that wasm module scripts has inspectable locals.
 
 load(libdir + "wasm.js");
 load(libdir + 'eqArrayHelper.js');
 
 function monitorLocalValues(wast, lib, expected) {
     function setupFrame(frame) {
         var locals = {};
--- a/js/src/jit-test/tests/debug/wasm-11.js
+++ b/js/src/jit-test/tests/debug/wasm-11.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 
 // Test single-stepping where the TLS register can be evicted by a non-trivial
 // function body.
 
 var g = newGlobal({newCompartment: true});
 g.parent = this;
 g.eval(`
     var dbg = new Debugger(parent);
--- a/js/src/jit-test/tests/debug/wasm-12.js
+++ b/js/src/jit-test/tests/debug/wasm-12.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 
 // Tests that wasm module scripts have special URLs.
 
 var g = newGlobal({newCompartment: true});
 var dbg = new Debugger(g);
 g.eval(`
 function initWasm(s) { return new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(s))); }
 o1 = initWasm('(module (func) (export "" 0))');
--- a/js/src/jit-test/tests/debug/wasm-13.js
+++ b/js/src/jit-test/tests/debug/wasm-13.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline
+// |jit-test| test-also-wasm-compiler-ion
 // Tests that wasm module scripts has inspectable globals and memory.
 
 load(libdir + "wasm.js");
 load(libdir + 'eqArrayHelper.js');
 
 function monitorGlobalValues(wast, lib, expected) {
     function setupFrame(frame) {
         var globals = {};
--- a/js/src/jit-test/tests/debug/wasm-breakpoint.js
+++ b/js/src/jit-test/tests/debug/wasm-breakpoint.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 // Tests that wasm module scripts handles basic breakpoint operations.
 
 load(libdir + "wasm.js");
 
 function runTest(wast, initFunc, doneFunc) {
     let g = newGlobal({newCompartment: true});
     let dbg = new Debugger(g);
 
--- a/js/src/jit-test/tests/debug/wasm-get-return.js
+++ b/js/src/jit-test/tests/debug/wasm-get-return.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 // Tests that wasm frame opPop event can access function resumption value.
 
 load(libdir + "wasm.js");
 load(libdir + 'eqArrayHelper.js');
 
 function monitorFrameOnPopReturns(wast, expected) {
     var values = [];
     wasmRunWithDebugger(
--- a/js/src/jit-test/tests/debug/wasm-getAllColumnOffsets.js
+++ b/js/src/jit-test/tests/debug/wasm-getAllColumnOffsets.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 
 // Tests that wasm module scripts have column and line to bytecode offset
 // information when source text is generated.
 
 load(libdir + "asserts.js");
 
 // Checking if experimental format generates internal source map to binary file
 // by querying debugger scripts getAllColumnOffsets.
--- a/js/src/jit-test/tests/debug/wasm-jseval.js
+++ b/js/src/jit-test/tests/debug/wasm-jseval.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline
+// |jit-test| test-also-wasm-compiler-ion
 // Tests that JS can be evaluated on wasm module scripts frames.
 
 load(libdir + "wasm.js");
 
 wasmRunWithDebugger(
     '(module (memory 1 1)\
      (global (mut f64) (f64.const 0.5))\
      (global f32 (f32.const 3.5))\
--- a/js/src/jit-test/tests/debug/wasm-responseurls.js
+++ b/js/src/jit-test/tests/debug/wasm-responseurls.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 // Tests that wasm module can accept URL and sourceMapURL from response
 // when instantiateStreaming is used.
 
 ignoreUnhandledRejections();
 
 try {
     WebAssembly.compileStreaming();
 } catch (err) {
--- a/js/src/jit-test/tests/debug/wasm-sourceMappingURL.js
+++ b/js/src/jit-test/tests/debug/wasm-sourceMappingURL.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 
 // Tests that wasm module sourceMappingURL section is parsed.
 
 load(libdir + "asserts.js");
 load(libdir + "wasm-binary.js");
 
 var g = newGlobal({newCompartment: true});
 var dbg = new Debugger(g);
--- a/js/src/jit-test/tests/debug/wasm-step.js
+++ b/js/src/jit-test/tests/debug/wasm-step.js
@@ -1,9 +1,9 @@
-// |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
+// |jit-test| test-also-wasm-compiler-ion; skip-if: !wasmDebuggingIsSupported()
 
 // Tests that wasm module scripts raises onEnterFrame and onLeaveFrame events.
 
 load(libdir + "wasm.js");
 
 // Checking if we stop at every wasm instruction during step.
 var onEnterFrameCalled, onLeaveFrameCalled, onStepCalled;
 wasmRunWithDebugger(
--- a/js/src/jit-test/tests/wasm/bench/directives.txt
+++ b/js/src/jit-test/tests/wasm/bench/directives.txt
@@ -1,1 +1,1 @@
-|jit-test| test-also-no-wasm-baseline; test-also-no-wasm-ion; test-also-wasm-tiering; include:wasm.js
+|jit-test| test-also-wasm-compiler-ion; test-also-wasm-compiler-baseline; test-also-wasm-tiering; include:wasm.js
--- a/js/src/jit-test/tests/wasm/directives.txt
+++ b/js/src/jit-test/tests/wasm/directives.txt
@@ -1,1 +1,1 @@
-|jit-test| test-also-no-wasm-baseline; test-also-no-wasm-ion; test-also-wasm-tiering; include:wasm.js
+|jit-test| test-also-wasm-compiler-ion; test-also-wasm-compiler-baseline; test-also-wasm-tiering; include:wasm.js
--- a/js/src/jit-test/tests/wasm/regress/directives.txt
+++ b/js/src/jit-test/tests/wasm/regress/directives.txt
@@ -1,1 +1,1 @@
-|jit-test| test-also-no-wasm-baseline; test-also-no-wasm-ion; test-also-wasm-tiering; include:wasm.js
+|jit-test| test-also-wasm-compiler-ion; test-also-wasm-compiler-baseline; test-also-wasm-tiering; include:wasm.js
--- a/js/src/jit-test/tests/wasm/spec/directives.txt
+++ b/js/src/jit-test/tests/wasm/spec/directives.txt
@@ -1,1 +1,1 @@
-|jit-test| test-also-no-wasm-baseline; test-also-no-wasm-ion; test-also-wasm-tiering; include:wasm-testharness.js
+|jit-test| test-also-wasm-compiler-ion; test-also-wasm-compiler-baseline; test-also-wasm-tiering; include:wasm-testharness.js
--- a/js/src/jit-test/tests/wasm/timeout/directives.txt
+++ b/js/src/jit-test/tests/wasm/timeout/directives.txt
@@ -1,2 +1,2 @@
-|jit-test| test-also-no-wasm-baseline; test-also-no-wasm-ion; test-also-wasm-tiering
+|jit-test| test-also-wasm-compiler-ion; test-also-wasm-compiler-baseline; test-also-wasm-tiering
 
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -391,17 +391,17 @@ class JS_PUBLIC_API ContextOptions {
       : baseline_(true),
         ion_(true),
         asmJS_(true),
         wasm_(true),
         wasmVerbose_(false),
         wasmBaseline_(true),
         wasmIon_(true),
 #ifdef ENABLE_WASM_CRANELIFT
-        wasmForceCranelift_(false),
+        wasmCranelift_(false),
 #endif
 #ifdef ENABLE_WASM_REFTYPES
         wasmGc_(false),
 #endif
         testWasmAwaitTier2_(false),
         throwOnAsmJSValidationFailure_(false),
         nativeRegExp_(true),
         asyncStack_(true),
@@ -471,19 +471,19 @@ class JS_PUBLIC_API ContextOptions {
 
   bool wasmIon() const { return wasmIon_; }
   ContextOptions& setWasmIon(bool flag) {
     wasmIon_ = flag;
     return *this;
   }
 
 #ifdef ENABLE_WASM_CRANELIFT
-  bool wasmForceCranelift() const { return wasmForceCranelift_; }
-  ContextOptions& setWasmForceCranelift(bool flag) {
-    wasmForceCranelift_ = flag;
+  bool wasmCranelift() const { return wasmCranelift_; }
+  ContextOptions& setWasmCranelift(bool flag) {
+    wasmCranelift_ = flag;
     return *this;
   }
 #endif
 
   bool testWasmAwaitTier2() const { return testWasmAwaitTier2_; }
   ContextOptions& setTestWasmAwaitTier2(bool flag) {
     testWasmAwaitTier2_ = flag;
     return *this;
@@ -590,17 +590,17 @@ class JS_PUBLIC_API ContextOptions {
   bool baseline_ : 1;
   bool ion_ : 1;
   bool asmJS_ : 1;
   bool wasm_ : 1;
   bool wasmVerbose_ : 1;
   bool wasmBaseline_ : 1;
   bool wasmIon_ : 1;
 #ifdef ENABLE_WASM_CRANELIFT
-  bool wasmForceCranelift_ : 1;
+  bool wasmCranelift_ : 1;
 #endif
 #ifdef ENABLE_WASM_REFTYPES
   bool wasmGc_ : 1;
 #endif
   bool testWasmAwaitTier2_ : 1;
   bool throwOnAsmJSValidationFailure_ : 1;
   bool nativeRegExp_ : 1;
   bool asyncStack_ : 1;
--- a/js/src/shell/fuzz-flags.txt
+++ b/js/src/shell/fuzz-flags.txt
@@ -46,18 +46,18 @@
 # --gc-zeal=2
 # --gc-zeal=10
 --no-cgc
 --no-ggc
 --no-incremental-gc
 
 # wasm flags
 --wasm-gc
---no-wasm-baseline
---no-wasm-ion
+--wasm-compiler=ion
+--wasm-compiler=baseline
 --test-wasm-await-tier2
 
 # CPU instruction set-related
 --enable-avx
 --no-avx
 --no-sse3
 --no-sse4
 
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -486,19 +486,17 @@ static bool offthreadCompilation = false
 static bool enableBaseline = false;
 static bool enableIon = false;
 static bool enableAsmJS = false;
 static bool enableWasm = false;
 static bool enableNativeRegExp = false;
 static bool enableSharedMemory = SHARED_MEMORY_DEFAULT;
 static bool enableWasmBaseline = false;
 static bool enableWasmIon = false;
-#ifdef ENABLE_WASM_CRANELIFT
-static bool wasmForceCranelift = false;
-#endif
+static bool enableWasmCranelift = false;
 #ifdef ENABLE_WASM_REFTYPES
 static bool enableWasmGc = false;
 #endif
 static bool enableWasmVerbose = false;
 static bool enableTestWasmAwaitTier2 = false;
 static bool enableAsyncStacks = false;
 static bool enableStreams = false;
 #ifdef ENABLE_BIGINT
@@ -10179,32 +10177,55 @@ static MOZ_MUST_USE bool ProcessArgs(JSC
 
   return true;
 }
 
 static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
   enableBaseline = !op.getBoolOption("no-baseline");
   enableIon = !op.getBoolOption("no-ion");
   enableAsmJS = !op.getBoolOption("no-asmjs");
-  enableWasm = !op.getBoolOption("no-wasm");
   enableNativeRegExp = !op.getBoolOption("no-native-regexp");
-  enableWasmBaseline = !op.getBoolOption("no-wasm-baseline");
-  enableWasmIon = !op.getBoolOption("no-wasm-ion");
-#ifdef ENABLE_WASM_CRANELIFT
-  wasmForceCranelift = op.getBoolOption("wasm-force-cranelift");
-#endif
+
+  // Default values for wasm.
+  enableWasm = true;
+  enableWasmBaseline = true;
+  enableWasmIon = true;
+  if (const char* str = op.getStringOption("wasm-compiler")) {
+    if (strcmp(str, "none") == 0) {
+      enableWasm = false;
+    } else if (strcmp(str, "baseline") == 0) {
+      // Baseline is enabled by default.
+      enableWasmIon = false;
+    } else if (strcmp(str, "ion") == 0) {
+      // Ion is enabled by default.
+      enableWasmBaseline = false;
+    } else if (strcmp(str, "cranelift") == 0) {
+      enableWasmBaseline = false;
+      enableWasmIon = false;
+      enableWasmCranelift = true;
+    } else if (strcmp(str, "baseline+ion") == 0) {
+      // Default.
+    } else if (strcmp(str, "baseline+cranelift") == 0) {
+      // Baseline is enabled by default.
+      enableWasmIon = false;
+      enableWasmCranelift = true;
+    } else {
+      return OptionFailure("wasm-compiler", str);
+    }
+  }
+
 #ifdef ENABLE_WASM_REFTYPES
   enableWasmGc = op.getBoolOption("wasm-gc");
 #  ifdef ENABLE_WASM_CRANELIFT
-  if (enableWasmGc && wasmForceCranelift) {
+  if (enableWasmGc && enableWasmCranelift) {
     fprintf(stderr,
-            "Do not combine --wasm-gc and --wasm-force-cranelift, they are "
+            "Do not combine --wasm-gc and --wasm-compiler=cranelift, they are "
             "incompatible.\n");
   }
-  enableWasmGc = enableWasmGc && !wasmForceCranelift;
+  enableWasmGc = enableWasmGc && !enableWasmCranelift;
 #  endif
 #endif
   enableWasmVerbose = op.getBoolOption("wasm-verbose");
   enableTestWasmAwaitTier2 = op.getBoolOption("test-wasm-await-tier2");
   enableAsyncStacks = !op.getBoolOption("no-async-stacks");
   enableStreams = !op.getBoolOption("no-streams");
 #ifdef ENABLE_BIGINT
   enableBigInt = !op.getBoolOption("no-bigint");
@@ -10213,17 +10234,17 @@ static bool SetContextOptions(JSContext*
   JS::ContextOptionsRef(cx)
       .setBaseline(enableBaseline)
       .setIon(enableIon)
       .setAsmJS(enableAsmJS)
       .setWasm(enableWasm)
       .setWasmBaseline(enableWasmBaseline)
       .setWasmIon(enableWasmIon)
 #ifdef ENABLE_WASM_CRANELIFT
-      .setWasmForceCranelift(wasmForceCranelift)
+      .setWasmCranelift(enableWasmCranelift)
 #endif
 #ifdef ENABLE_WASM_REFTYPES
       .setWasmGc(enableWasmGc)
 #endif
       .setWasmVerbose(enableWasmVerbose)
       .setTestWasmAwaitTier2(enableTestWasmAwaitTier2)
       .setNativeRegExp(enableNativeRegExp)
       .setAsyncStack(enableAsyncStacks);
@@ -10530,17 +10551,17 @@ static void SetWorkerContextOptions(JSCo
   JS::ContextOptionsRef(cx)
       .setBaseline(enableBaseline)
       .setIon(enableIon)
       .setAsmJS(enableAsmJS)
       .setWasm(enableWasm)
       .setWasmBaseline(enableWasmBaseline)
       .setWasmIon(enableWasmIon)
 #ifdef ENABLE_WASM_CRANELIFT
-      .setWasmForceCranelift(wasmForceCranelift)
+      .setWasmCranelift(enableWasmCranelift)
 #endif
 #ifdef ENABLE_WASM_REFTYPES
       .setWasmGc(enableWasmGc)
 #endif
       .setWasmVerbose(enableWasmVerbose)
       .setTestWasmAwaitTier2(enableTestWasmAwaitTier2)
       .setNativeRegExp(enableNativeRegExp);
 
@@ -10927,26 +10948,22 @@ int main(int argc, char** argv, char** e
           "default is the actual number of CPUs. The total number of "
           "background helper threads is the CPU count plus some constant.",
           -1) ||
       !op.addIntOption('\0', "thread-count", "COUNT", "Alias for --cpu-count.",
                        -1) ||
       !op.addBoolOption('\0', "ion", "Enable IonMonkey (default)") ||
       !op.addBoolOption('\0', "no-ion", "Disable IonMonkey") ||
       !op.addBoolOption('\0', "no-asmjs", "Disable asm.js compilation") ||
-      !op.addBoolOption('\0', "no-wasm", "Disable WebAssembly compilation") ||
-      !op.addBoolOption('\0', "no-wasm-baseline",
-                        "Disable wasm baseline compiler") ||
-      !op.addBoolOption('\0', "no-wasm-ion", "Disable wasm ion compiler")
-#ifdef ENABLE_WASM_CRANELIFT
-      || !op.addBoolOption('\0', "wasm-force-cranelift",
-                           "Enable wasm Cranelift compiler")
-#endif
-      || !op.addBoolOption('\0', "wasm-verbose",
-                           "Enable WebAssembly verbose logging") ||
+      !op.addStringOption(
+          '\0', "wasm-compiler", "[option]",
+          "Choose to enable a subset of the wasm compilers (valid options are "
+          "none/baseline/ion/cranelift/baseline+ion/baseline+cranelift)") ||
+      !op.addBoolOption('\0', "wasm-verbose",
+                        "Enable WebAssembly verbose logging") ||
       !op.addBoolOption('\0', "test-wasm-await-tier2",
                         "Forcibly activate tiering and block "
                         "instantiation on completion of tier2")
 #ifdef ENABLE_WASM_REFTYPES
       || !op.addBoolOption('\0', "wasm-gc", "Enable wasm GC features")
 #else
       || !op.addBoolOption('\0', "wasm-gc", "No-op")
 #endif
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -299,22 +299,22 @@ class JitTest:
                         test.allow_overrecursed = True
                     elif name == 'valgrind':
                         test.valgrind = options.valgrind
                     elif name == 'tz-pacific':
                         test.tz_pacific = True
                     elif name == 'test-also-noasmjs':
                         if options.asmjs_enabled:
                             test.test_also.append(['--no-asmjs'])
-                    elif name == 'test-also-no-wasm-baseline':
+                    elif name == 'test-also-wasm-compiler-ion':
                         if options.wasm_enabled:
-                            test.test_also.append(['--no-wasm-baseline'])
-                    elif name == 'test-also-no-wasm-ion':
+                            test.test_also.append(['--wasm-compiler=ion'])
+                    elif name == 'test-also-wasm-compiler-baseline':
                         if options.wasm_enabled:
-                            test.test_also.append(['--no-wasm-ion'])
+                            test.test_also.append(['--wasm-compiler=baseline'])
                     elif name == 'test-also-wasm-tiering':
                         if options.wasm_enabled:
                             test.test_also.append(['--test-wasm-await-tier2'])
                     elif name.startswith('test-also='):
                         test.test_also.append([name[len('test-also='):]])
                     elif name.startswith('test-join='):
                         test.test_join.append([name[len('test-join='):]])
                     elif name == 'module':
--- a/js/src/tests/lib/tests.py
+++ b/js/src/tests/lib/tests.py
@@ -38,17 +38,17 @@ JITFLAGS = {
         ['--ion-eager', '--ion-check-range-analysis', '--ion-extra-checks', '--no-sse3'],
         ['--no-baseline', '--no-ion'],
     ],
     'baseline': [
         ['--no-ion'],
     ],
     # Interpreter-only, for tools that cannot handle binary code generation.
     'interp': [
-        ['--no-baseline', '--no-asmjs', '--no-wasm', '--no-native-regexp']
+        ['--no-baseline', '--no-asmjs', '--wasm-compiler=none', '--no-native-regexp']
     ],
     'none': [
         []  # no flags, normal baseline and ion
     ]
 }
 
 
 def get_jitflags(variant, **kwargs):
--- a/js/src/wasm/Makefile
+++ b/js/src/wasm/Makefile
@@ -18,17 +18,17 @@ help:
 
 update:
 	[ -d ./spec ] || git clone https://github.com/webassembly/spec ./spec
 	(cd ./spec/interpreter && make)
 	./spec/test/build.py \
 		--use-sync \
 		--js ../jit-test/tests/wasm/spec \
 		--html ../../../testing/web-platform/mozilla/tests/wasm
-	echo "|jit-test| test-also-no-wasm-baseline; test-also-no-wasm-ion; test-also-wasm-tiering; include:wasm-testharness.js" > ../jit-test/tests/wasm/spec/directives.txt
+	echo "|jit-test| test-also-wasm-compiler-ion; test-also-wasm-compiler-baseline; test-also-wasm-tiering; include:wasm-testharness.js" > ../jit-test/tests/wasm/spec/directives.txt
 	echo "|jit-test| skip-if:true" > ../jit-test/tests/wasm/spec/harness/directives.txt
 
 run:
 	@[ -z $(MOZCONFIG) ] && echo "You need to define the MOZCONFIG env variable first."
 	@[ -z $(MOZCONFIG) ] || ../../../mach wpt /_mozilla/wasm
 
 expectations:
 	@[ -z $(MOZCONFIG) ] && echo "You need to define the MOZCONFIG env variable first." || true
--- a/js/src/wasm/WasmCompile.cpp
+++ b/js/src/wasm/WasmCompile.cpp
@@ -72,17 +72,17 @@ uint32_t wasm::ObservedCPUFeatures() {
 #endif
 }
 
 CompileArgs::CompileArgs(JSContext* cx, ScriptedCaller&& scriptedCaller)
     : scriptedCaller(std::move(scriptedCaller)) {
   baselineEnabled = cx->options().wasmBaseline();
   ionEnabled = cx->options().wasmIon();
 #ifdef ENABLE_WASM_CRANELIFT
-  craneliftEnabled = cx->options().wasmForceCranelift();
+  craneliftEnabled = cx->options().wasmCranelift();
 #else
   craneliftEnabled = false;
 #endif
 
   // Debug information such as source view or debug traps will require
   // additional memory and permanently stay in baseline code, so we try to
   // only enable it when a developer actually cares: when the debugger tab
   // is open.
--- a/js/src/wasm/WasmJS.cpp
+++ b/js/src/wasm/WasmJS.cpp
@@ -54,17 +54,17 @@ using namespace js::wasm;
 using mozilla::CheckedInt;
 using mozilla::Nothing;
 using mozilla::RangedPtr;
 
 extern mozilla::Atomic<bool> fuzzingSafe;
 
 bool wasm::HasReftypesSupport(JSContext* cx) {
 #ifdef ENABLE_WASM_CRANELIFT
-  if (cx->options().wasmForceCranelift()) {
+  if (cx->options().wasmCranelift()) {
     return false;
   }
 #endif
 #ifdef ENABLE_WASM_REFTYPES
   return cx->options().wasmGc() && cx->options().wasmBaseline();
 #else
   return false;
 #endif
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -860,17 +860,17 @@ static void ReloadPrefsCallback(const ch
   JS::ContextOptionsRef(cx)
       .setBaseline(useBaseline)
       .setIon(useIon)
       .setAsmJS(useAsmJS)
       .setWasm(useWasm)
       .setWasmIon(useWasmIon)
       .setWasmBaseline(useWasmBaseline)
 #ifdef ENABLE_WASM_CRANELIFT
-      .setWasmForceCranelift(useWasmCranelift)
+      .setWasmCranelift(useWasmCranelift)
 #endif
 #ifdef ENABLE_WASM_REFTYPES
       .setWasmGc(useWasmGc)
 #endif
       .setWasmVerbose(useWasmVerbose)
       .setThrowOnAsmJSValidationFailure(throwOnAsmJSValidationFailure)
       .setNativeRegExp(useNativeRegExp)
       .setAsyncStack(useAsyncStack)