diff --git a/js/public/WasmFeatures.h b/js/public/WasmFeatures.h index 11ab267fb967b..d4744dadad645 100644 --- a/js/public/WasmFeatures.h +++ b/js/public/WasmFeatures.h @@ -99,15 +99,6 @@ /* flag force enable */ false, \ /* flag fuzz enable */ true, \ /* preference name */ extended_const) \ - FEATURE( \ - /* capitalized name */ Exceptions, \ - /* lower case name */ exceptions, \ - /* compile predicate */ true, \ - /* compiler predicate */ AnyCompilerAvailable(cx), \ - /* flag predicate */ true, \ - /* flag force enable */ WasmExnRefFlag(cx), \ - /* flag fuzz enable */ true, \ - /* preference name */ exceptions) \ FEATURE( \ /* capitalized name */ ExnRef, \ /* lower case name */ exnref, \ diff --git a/js/src/jit-test/etc/wasm/generate-spectests/config.toml b/js/src/jit-test/etc/wasm/generate-spectests/config.toml index 379ffe3478b6a..a1def83b91987 100644 --- a/js/src/jit-test/etc/wasm/generate-spectests/config.toml +++ b/js/src/jit-test/etc/wasm/generate-spectests/config.toml @@ -43,7 +43,7 @@ url = "https://github.com/WebAssembly/exception-handling" branch = "main" parent = "spec" # Skip in jit-test when it's not enabled -directive = "; --setpref=wasm_exceptions=true; --setpref=wasm_exnref=true; skip-if: !wasmExceptionsEnabled()" +directive = "; --setpref=wasm_exnref=true; skip-if: !wasmExnRefEnabled()" excluded_tests = [ # harness doesn't support exnref, because JS-API globals can't use it "ref_null.wast.js" diff --git a/js/src/jit-test/lib/wasm-binary.js b/js/src/jit-test/lib/wasm-binary.js index 36c1a91cc1e50..93451b6a80818 100644 --- a/js/src/jit-test/lib/wasm-binary.js +++ b/js/src/jit-test/lib/wasm-binary.js @@ -159,7 +159,7 @@ const MozPrefix = 0xff; const definedOpcodes = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, - ...(wasmExceptionsEnabled() ? [0x06, 0x07, 0x08, 0x09] : []), + 0x06, 0x07, 0x08, 0x09, ...(wasmExnRefEnabled() ? [0x0a] : []), 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, @@ -167,7 +167,7 @@ const definedOpcodes = ...(wasmFunctionReferencesEnabled() ? [0x14] : []), ...(wasmTailCallsEnabled() && wasmFunctionReferencesEnabled() ? [0x15] : []), - ...(wasmExceptionsEnabled() ? [0x18, 0x19] : []), + 0x18, 0x19, 0x1a, 0x1b, 0x1c, ...(wasmExnRefEnabled() ? [0x1f] : []), 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, diff --git a/js/src/jit-test/tests/wasm/exceptions/directives.txt b/js/src/jit-test/tests/wasm/exceptions/directives.txt index 8a92544d13c27..c9c2613039bca 100644 --- a/js/src/jit-test/tests/wasm/exceptions/directives.txt +++ b/js/src/jit-test/tests/wasm/exceptions/directives.txt @@ -1 +1 @@ -|jit-test| test-also=--setpref=wasm_exnref=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; include:wasm.js; skip-if: !wasmExceptionsEnabled() +|jit-test| test-also=--setpref=wasm_exnref=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; include:wasm.js diff --git a/js/src/jit-test/tests/wasm/features.js b/js/src/jit-test/tests/wasm/features.js index f3d07d87a8a26..261437d691f5d 100644 --- a/js/src/jit-test/tests/wasm/features.js +++ b/js/src/jit-test/tests/wasm/features.js @@ -1,4 +1,4 @@ -// |jit-test| test-also=--setpref=wasm_extended_const=true; test-also=--setpref=wasm_exceptions=true; +// |jit-test| test-also=--setpref=wasm_extended_const=true; // Test that if a feature is 'experimental' then we must be in a nightly build, // and if a feature is 'released' then it must be enabled on release and beta. @@ -67,11 +67,6 @@ for (let [name, enabled, test] of releasedFeaturesMaybeDisabledAnyway) { let releasedFeatures = [ ['threads', wasmThreadsEnabled(), `(module (memory 1 1 shared))`], - [ - 'exceptions', - wasmExceptionsEnabled(), - `(module (type (func)) (tag (type 0)))` - ], [ 'extended-const', wasmExtendedConstEnabled(), diff --git a/js/src/jit-test/tests/wasm/spec/exception-handling/directives.txt b/js/src/jit-test/tests/wasm/spec/exception-handling/directives.txt index c28bcbc626e23..77f41279088a9 100644 --- a/js/src/jit-test/tests/wasm/spec/exception-handling/directives.txt +++ b/js/src/jit-test/tests/wasm/spec/exception-handling/directives.txt @@ -1 +1 @@ -|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_exceptions=true; --setpref=wasm_exnref=true; skip-if: !wasmExceptionsEnabled() \ No newline at end of file +|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_exnref=true; skip-if: !wasmExnRefEnabled() \ No newline at end of file diff --git a/js/src/jit-test/tests/wasm/tail-calls/exceptions.js b/js/src/jit-test/tests/wasm/tail-calls/exceptions.js index 49898107d1618..c4c774a4f352f 100644 --- a/js/src/jit-test/tests/wasm/tail-calls/exceptions.js +++ b/js/src/jit-test/tests/wasm/tail-calls/exceptions.js @@ -1,5 +1,3 @@ -// |jit-test| --setpref=wasm_exceptions=true; skip-if: !wasmExceptionsEnabled() - // Simple test with return_call. var ins = wasmEvalText(`(module (tag $exn) diff --git a/js/src/jit-test/tests/wasm/tail-calls/litmus3.js b/js/src/jit-test/tests/wasm/tail-calls/litmus3.js index bdd0918717029..4fe367fb29218 100644 --- a/js/src/jit-test/tests/wasm/tail-calls/litmus3.js +++ b/js/src/jit-test/tests/wasm/tail-calls/litmus3.js @@ -1,4 +1,4 @@ -// |jit-test| skip-if: !wasmTailCallsEnabled() || !wasmExceptionsEnabled() +// |jit-test| skip-if: !wasmTailCallsEnabled() // Mutually recursive functions implement a multi-entry loop using tail calls, // with exception handling. diff --git a/js/src/jit-test/tests/wasm/tail-calls/litmus4.js b/js/src/jit-test/tests/wasm/tail-calls/litmus4.js index c16f712aacbc2..6562f766869fb 100644 --- a/js/src/jit-test/tests/wasm/tail-calls/litmus4.js +++ b/js/src/jit-test/tests/wasm/tail-calls/litmus4.js @@ -1,4 +1,4 @@ -// |jit-test| skip-if: !wasmTailCallsEnabled() || !wasmExceptionsEnabled() +// |jit-test| skip-if: !wasmTailCallsEnabled() // Mutually recursive functions implement a multi-entry loop using indirect tail // calls, with exception handling. diff --git a/js/src/jit-test/tests/wasm/tail-calls/litmus8.js b/js/src/jit-test/tests/wasm/tail-calls/litmus8.js index 4602664488841..126367a0a0a54 100644 --- a/js/src/jit-test/tests/wasm/tail-calls/litmus8.js +++ b/js/src/jit-test/tests/wasm/tail-calls/litmus8.js @@ -1,4 +1,4 @@ -// |jit-test| skip-if: !wasmTailCallsEnabled() || !wasmExceptionsEnabled() +// |jit-test| skip-if: !wasmTailCallsEnabled() // Tail-call litmus test with multiple results // diff --git a/js/src/jit-test/tests/wasm/tail-calls/litmus9.js b/js/src/jit-test/tests/wasm/tail-calls/litmus9.js index 3bbde27111fa1..513e5c058e6d9 100644 --- a/js/src/jit-test/tests/wasm/tail-calls/litmus9.js +++ b/js/src/jit-test/tests/wasm/tail-calls/litmus9.js @@ -1,4 +1,4 @@ -// |jit-test| skip-if: !wasmTailCallsEnabled() || !wasmExceptionsEnabled() +// |jit-test| skip-if: !wasmTailCallsEnabled() // Tail-call litmus test with multiple results // diff --git a/js/src/wasm/WasmBaselineCompile.cpp b/js/src/wasm/WasmBaselineCompile.cpp index 196e49f76e001..f70bf7b91d874 100644 --- a/js/src/wasm/WasmBaselineCompile.cpp +++ b/js/src/wasm/WasmBaselineCompile.cpp @@ -9989,36 +9989,18 @@ bool BaseCompiler::emitBody() { case uint16_t(Op::Else): CHECK_NEXT(emitElse()); case uint16_t(Op::Try): - if (!moduleEnv_.exceptionsEnabled()) { - return iter_.unrecognizedOpcode(&op); - } CHECK_NEXT(emitTry()); case uint16_t(Op::Catch): - if (!moduleEnv_.exceptionsEnabled()) { - return iter_.unrecognizedOpcode(&op); - } CHECK_NEXT(emitCatch()); case uint16_t(Op::CatchAll): - if (!moduleEnv_.exceptionsEnabled()) { - return iter_.unrecognizedOpcode(&op); - } CHECK_NEXT(emitCatchAll()); case uint16_t(Op::Delegate): - if (!moduleEnv_.exceptionsEnabled()) { - return iter_.unrecognizedOpcode(&op); - } CHECK(emitDelegate()); iter_.popDelegate(); NEXT(); case uint16_t(Op::Throw): - if (!moduleEnv_.exceptionsEnabled()) { - return iter_.unrecognizedOpcode(&op); - } CHECK_NEXT(emitThrow()); case uint16_t(Op::Rethrow): - if (!moduleEnv_.exceptionsEnabled()) { - return iter_.unrecognizedOpcode(&op); - } CHECK_NEXT(emitRethrow()); case uint16_t(Op::ThrowRef): if (!moduleEnv_.exnrefEnabled()) { diff --git a/js/src/wasm/WasmIonCompile.cpp b/js/src/wasm/WasmIonCompile.cpp index f2fcac8850099..977ce93eaec10 100644 --- a/js/src/wasm/WasmIonCompile.cpp +++ b/js/src/wasm/WasmIonCompile.cpp @@ -8012,37 +8012,19 @@ static bool EmitBodyExprs(FunctionCompiler& f) { case uint16_t(Op::Else): CHECK(EmitElse(f)); case uint16_t(Op::Try): - if (!f.moduleEnv().exceptionsEnabled()) { - return f.iter().unrecognizedOpcode(&op); - } CHECK(EmitTry(f)); case uint16_t(Op::Catch): - if (!f.moduleEnv().exceptionsEnabled()) { - return f.iter().unrecognizedOpcode(&op); - } CHECK(EmitCatch(f)); case uint16_t(Op::CatchAll): - if (!f.moduleEnv().exceptionsEnabled()) { - return f.iter().unrecognizedOpcode(&op); - } CHECK(EmitCatchAll(f)); case uint16_t(Op::Delegate): - if (!f.moduleEnv().exceptionsEnabled()) { - return f.iter().unrecognizedOpcode(&op); - } if (!EmitDelegate(f)) { return false; } break; case uint16_t(Op::Throw): - if (!f.moduleEnv().exceptionsEnabled()) { - return f.iter().unrecognizedOpcode(&op); - } CHECK(EmitThrow(f)); case uint16_t(Op::Rethrow): - if (!f.moduleEnv().exceptionsEnabled()) { - return f.iter().unrecognizedOpcode(&op); - } CHECK(EmitRethrow(f)); case uint16_t(Op::ThrowRef): if (!f.moduleEnv().exnrefEnabled()) { diff --git a/js/src/wasm/WasmJS.cpp b/js/src/wasm/WasmJS.cpp index 6cc9528415241..f023a4dc0d77f 100644 --- a/js/src/wasm/WasmJS.cpp +++ b/js/src/wasm/WasmJS.cpp @@ -5351,15 +5351,13 @@ static bool WebAssemblyClassFinish(JSContext* cx, HandleObject object, } } - if (ExceptionsAvailable(cx)) { - constexpr NameAndProtoKey exceptionEntries[] = { - {"Tag", JSProto_WasmTag}, - {"Exception", JSProto_WasmException}, - }; - for (const auto& entry : exceptionEntries) { - if (!WebAssemblyDefineConstructor(cx, wasm, entry, &ctorValue, &id)) { - return false; - } + constexpr NameAndProtoKey exceptionEntries[] = { + {"Tag", JSProto_WasmTag}, + {"Exception", JSProto_WasmException}, + }; + for (const auto& entry : exceptionEntries) { + if (!WebAssemblyDefineConstructor(cx, wasm, entry, &ctorValue, &id)) { + return false; } } diff --git a/js/src/wasm/WasmValidate.cpp b/js/src/wasm/WasmValidate.cpp index e964c11d04dee..461614652afcc 100644 --- a/js/src/wasm/WasmValidate.cpp +++ b/js/src/wasm/WasmValidate.cpp @@ -1285,31 +1285,19 @@ static bool DecodeFunctionBodyExprs(const ModuleEnvironment& env, CHECK(iter.readRefIsNull(¬hing)); } case uint16_t(Op::Try): - if (!env.exceptionsEnabled()) { - return iter.unrecognizedOpcode(&op); - } CHECK(iter.readTry(&unusedType)); case uint16_t(Op::Catch): { - if (!env.exceptionsEnabled()) { - return iter.unrecognizedOpcode(&op); - } LabelKind unusedKind; uint32_t unusedIndex; CHECK(iter.readCatch(&unusedKind, &unusedIndex, &unusedType, &unusedType, ¬hings)); } case uint16_t(Op::CatchAll): { - if (!env.exceptionsEnabled()) { - return iter.unrecognizedOpcode(&op); - } LabelKind unusedKind; CHECK(iter.readCatchAll(&unusedKind, &unusedType, &unusedType, ¬hings)); } case uint16_t(Op::Delegate): { - if (!env.exceptionsEnabled()) { - return iter.unrecognizedOpcode(&op); - } uint32_t unusedDepth; if (!iter.readDelegate(&unusedDepth, &unusedType, ¬hings)) { return false; @@ -1318,16 +1306,10 @@ static bool DecodeFunctionBodyExprs(const ModuleEnvironment& env, break; } case uint16_t(Op::Throw): { - if (!env.exceptionsEnabled()) { - return iter.unrecognizedOpcode(&op); - } uint32_t unusedIndex; CHECK(iter.readThrow(&unusedIndex, ¬hings)); } case uint16_t(Op::Rethrow): { - if (!env.exceptionsEnabled()) { - return iter.unrecognizedOpcode(&op); - } uint32_t unusedDepth; CHECK(iter.readRethrow(&unusedDepth)); } @@ -2479,10 +2461,6 @@ static bool DecodeTagSection(Decoder& d, ModuleEnvironment* env) { return true; } - if (!env->exceptionsEnabled()) { - return d.fail("exceptions not enabled"); - } - uint32_t numDefs; if (!d.readVarU32(&numDefs)) { return d.fail("expected number of tags"); diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 32fcc74f4c398..3c0d04809bb14 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -7711,12 +7711,6 @@ mirror: always set_spidermonkey_pref: startup -- name: javascript.options.wasm_exceptions - type: bool - value: true - mirror: always - set_spidermonkey_pref: startup - - name: javascript.options.wasm_exnref type: bool value: @IS_EARLY_BETA_OR_EARLIER@