Bug 1759217 - wasm: Let exception-handling ride the trains. r=lth

Differential Revision: https://phabricator.services.mozilla.com/D141700
This commit is contained in:
Ryan Hunt 2022-03-23 14:52:50 +00:00
Родитель 238c5f019d
Коммит 7f0395a3a1
12 изменённых файлов: 24 добавлений и 354 удалений

Просмотреть файл

@ -1189,14 +1189,11 @@ set_define(
# ==================================
@depends(milestone.is_nightly, "--enable-cranelift")
def default_wasm_exceptions(is_nightly, cranelift_enabled):
@depends("--enable-cranelift")
def default_wasm_exceptions(cranelift_enabled):
if cranelift_enabled:
return
if not is_nightly:
return
return True

Просмотреть файл

@ -62,20 +62,21 @@ assertErrorMessage(
);
// Test WebAssembly.Tag methods.
{
let params = [
[],
["i32"],
["i32", "i64"],
["f32", "externref"],
["i32", "i64", "f32", "f64"],
];
// TODO: add runtime detection for js-types
// {
// let params = [
// [],
// ["i32"],
// ["i32", "i64"],
// ["f32", "externref"],
// ["i32", "i64", "f32", "f64"],
// ];
for (const arg of params) {
const tag = new WebAssembly.Tag({ parameters: arg });
assertEqArray(tag.type().parameters, arg);
}
}
// for (const arg of params) {
// const tag = new WebAssembly.Tag({ parameters: arg });
// assertEqArray(tag.type().parameters, arg);
// }
// }
// WebAssembly.Exception tests.
assertErrorMessage(

Просмотреть файл

@ -35,11 +35,6 @@ let nightlyOnlyFeatures = [
)
)`
],
[
'exceptions',
wasmExceptionsEnabled(),
`(module (type (func)) (tag (type 0)))`
],
[
'function-references',
wasmFunctionReferencesEnabled(),
@ -83,6 +78,11 @@ for (let [name, enabled, test] of releasedFeaturesMaybeDisabledAnyway) {
let releasedFeatures = [
['threads', wasmThreadsEnabled(), `(module (memory 1 1 shared))`],
[
'exceptions',
wasmExceptionsEnabled(),
`(module (type (func)) (tag (type 0)))`
],
];
for (let [name, enabled, test] of releasedFeatures) {

Просмотреть файл

@ -1929,6 +1929,7 @@ static bool DecodeMemoryTypeAndLimits(Decoder& d, ModuleEnvironment* env) {
}
#ifdef ENABLE_WASM_EXCEPTIONS
# ifdef WASM_PRIVATE_REFTYPES
static bool TagIsJSCompatible(Decoder& d, const ValTypeVector& type) {
for (auto t : type) {
if (t.isTypeIndex()) {
@ -1938,6 +1939,7 @@ static bool TagIsJSCompatible(Decoder& d, const ValTypeVector& type) {
return true;
}
# endif // WASM_PRIVATE_REFTYPES
static bool DecodeTag(Decoder& d, ModuleEnvironment* env, TagKind* tagKind,
uint32_t* funcTypeIndex) {

Просмотреть файл

@ -6783,7 +6783,7 @@
#if defined(ENABLE_WASM_EXCEPTIONS)
- name: javascript.options.wasm_exceptions
type: bool
value: @IS_NIGHTLY_BUILD@
value: true
mirror: always
#endif // defined(ENABLE_WASM_EXCEPTIONS)

Просмотреть файл

@ -1,108 +0,0 @@
[basic.tentative.any.worker.html]
[Wasm function throws argument]
expected:
if release_or_beta: FAIL
[Wasm function throws null]
expected:
if release_or_beta: FAIL
[Wasm function throws integer]
expected:
if release_or_beta: FAIL
[Imported JS function throws]
expected:
if release_or_beta: FAIL
[Imported JS function throws, Wasm catches and rethrows]
expected:
if release_or_beta: FAIL
[basic.tentative.any.serviceworker.html]
[Wasm function throws argument]
expected:
if release_or_beta: FAIL
[Wasm function throws null]
expected:
if release_or_beta: FAIL
[Wasm function throws integer]
expected:
if release_or_beta: FAIL
[Imported JS function throws]
expected:
if release_or_beta: FAIL
[Imported JS function throws, Wasm catches and rethrows]
expected:
if release_or_beta: FAIL
[basic.tentative.any.sharedworker.html]
[Wasm function throws argument]
expected:
if release_or_beta: FAIL
[Wasm function throws null]
expected:
if release_or_beta: FAIL
[Wasm function throws integer]
expected:
if release_or_beta: FAIL
[Imported JS function throws]
expected:
if release_or_beta: FAIL
[Imported JS function throws, Wasm catches and rethrows]
expected:
if release_or_beta: FAIL
[basic.tentative.any.html]
[Wasm function throws argument]
expected:
if release_or_beta: FAIL
[Wasm function throws null]
expected:
if release_or_beta: FAIL
[Wasm function throws integer]
expected:
if release_or_beta: FAIL
[Imported JS function throws]
expected:
if release_or_beta: FAIL
[Imported JS function throws, Wasm catches and rethrows]
expected:
if release_or_beta: FAIL
[basic.tentative.any.js]
[Wasm function throws argument]
expected:
if release_or_beta: FAIL
[Wasm function throws null]
expected:
if release_or_beta: FAIL
[Wasm function throws integer]
expected:
if release_or_beta: FAIL
[Imported JS function throws]
expected:
if release_or_beta: FAIL
[Imported JS function throws, Wasm catches and rethrows]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,52 +0,0 @@
[constructor.tentative.any.worker.html]
[name]
expected:
if release_or_beta: FAIL
[length]
expected:
if release_or_beta: FAIL
[Calling]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[constructor.tentative.any.html]
[name]
expected:
if release_or_beta: FAIL
[length]
expected:
if release_or_beta: FAIL
[Calling]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[constructor.tentative.any.js]
[name]
expected:
if release_or_beta: FAIL
[length]
expected:
if release_or_beta: FAIL
[Calling]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,61 +1,13 @@
[getArg.tentative.any.worker.html]
[Missing arguments]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[Index out of bounds]
expected: FAIL
[Getting out-of-range argument]
expected:
if release_or_beta: FAIL
[getArg]
expected:
if release_or_beta: FAIL
[getArg.tentative.any.html]
[Missing arguments]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[Index out of bounds]
expected: FAIL
[Getting out-of-range argument]
expected:
if release_or_beta: FAIL
[getArg]
expected:
if release_or_beta: FAIL
[getArg.tentative.any.js]
[Missing arguments]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[Index out of bounds]
expected: FAIL
[Getting out-of-range argument]
expected:
if release_or_beta: FAIL
[getArg]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,40 +0,0 @@
[is.tentative.any.html]
[Missing arguments]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[is]
expected:
if release_or_beta: FAIL
[is.tentative.any.worker.html]
[Missing arguments]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[is]
expected:
if release_or_beta: FAIL
[is.tentative.any.js]
[Missing arguments]
expected:
if release_or_beta: FAIL
[Invalid exception argument]
expected:
if release_or_beta: FAIL
[is]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,28 +0,0 @@
[toString.tentative.any.worker.html]
[Object.prototype.toString on an Exception]
expected:
if release_or_beta: FAIL
[@@toStringTag exists on the prototype with the appropriate descriptor]
expected:
if release_or_beta: FAIL
[toString.tentative.any.html]
[Object.prototype.toString on an Exception]
expected:
if release_or_beta: FAIL
[@@toStringTag exists on the prototype with the appropriate descriptor]
expected:
if release_or_beta: FAIL
[toString.tentative.any.js]
[Object.prototype.toString on an Exception]
expected:
if release_or_beta: FAIL
[@@toStringTag exists on the prototype with the appropriate descriptor]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,26 +0,0 @@
[constructor.tentative.any.worker.html]
[name]
expected:
if release_or_beta: FAIL
[length]
expected:
if release_or_beta: FAIL
[constructor.tentative.any.html]
[name]
expected:
if release_or_beta: FAIL
[length]
expected:
if release_or_beta: FAIL
[constructor.tentative.any.js]
[name]
expected:
if release_or_beta: FAIL
[length]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,28 +0,0 @@
[toString.tentative.any.html]
[Object.prototype.toString on a Tag]
expected:
if release_or_beta: FAIL
[@@toStringTag exists on the prototype with the appropriate descriptor]
expected:
if release_or_beta: FAIL
[toString.tentative.any.worker.html]
[Object.prototype.toString on a Tag]
expected:
if release_or_beta: FAIL
[@@toStringTag exists on the prototype with the appropriate descriptor]
expected:
if release_or_beta: FAIL
[toString.tentative.any.js]
[Object.prototype.toString on a Tag]
expected:
if release_or_beta: FAIL
[@@toStringTag exists on the prototype with the appropriate descriptor]
expected:
if release_or_beta: FAIL