diff --git a/CHANGELOG.md b/CHANGELOG.md index 17cdcc7261b..8bc3bdba01b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,9 @@ * Optimized ABI performance for `Option<{i32,u32,isize,usize,f32,*const T,*mut T}>`. [#4183](https://github.com/rustwasm/wasm-bindgen/pull/4183) +* Reference type proposal transformations are not applied by default when detecting it in the Wasm module for the bundler target because currently `webpack` doesn't support it. + [#4235](https://github.com/rustwasm/wasm-bindgen/pull/4235) + ### Fixed * Fixed methods with `self: &Self` consuming the object. diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs index 0602beb5d2b..b4f3f9c5b12 100755 --- a/crates/cli-support/src/lib.rs +++ b/crates/cli-support/src/lib.rs @@ -324,7 +324,10 @@ impl Bindgen { }; // Enable reference type transformations if the module is already using it. - if let Ok(true) = wasm_bindgen_wasm_conventions::target_feature(&module, "reference-types") + // Currently `webpack` does not support reference types. + if !matches!(self.mode, OutputMode::Bundler { .. }) + && wasm_bindgen_wasm_conventions::target_feature(&module, "reference-types").ok() + == Some(true) { self.externref = true; } diff --git a/crates/cli/tests/reference/add.wat b/crates/cli/tests/reference/add.wat index 62ab9c0876b..ea9d635ecc4 100644 --- a/crates/cli/tests/reference/add.wat +++ b/crates/cli/tests/reference/add.wat @@ -6,6 +6,6 @@ (export "memory" (memory 0)) (export "add_u32" (func $add_u32)) (export "add_i32" (func $add_i32)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/anyref-empty.wat b/crates/cli/tests/reference/anyref-empty.wat index 2ff9975bfff..1044fd51d5e 100644 --- a/crates/cli/tests/reference/anyref-empty.wat +++ b/crates/cli/tests/reference/anyref-empty.wat @@ -6,6 +6,6 @@ (export "memory" (memory 0)) (export "__wbindgen_export_0" (table 0)) (export "__wbindgen_start" (func 0)) - (@custom "target_features" (after export) "\03+\0fmutable-globals+\08sign-ext+\0freference-types") + (@custom "target_features" (after export) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/anyref-import-catch.js b/crates/cli/tests/reference/anyref-import-catch.js index f8e28d8db96..b9a96c382b8 100644 --- a/crates/cli/tests/reference/anyref-import-catch.js +++ b/crates/cli/tests/reference/anyref-import-catch.js @@ -39,15 +39,6 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } -let cachedDataViewMemory0 = null; - -function getDataViewMemory0() { - if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { - cachedDataViewMemory0 = new DataView(wasm.memory.buffer); - } - return cachedDataViewMemory0; -} - function takeFromExternrefTable0(idx) { const value = wasm.__wbindgen_export_2.get(idx); wasm.__externref_table_dealloc(idx); @@ -55,16 +46,9 @@ function takeFromExternrefTable0(idx) { } export function exported() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.exported(retptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - if (r1) { - throw takeFromExternrefTable0(r0); - } - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); + const ret = wasm.exported(); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); } } diff --git a/crates/cli/tests/reference/anyref-import-catch.wat b/crates/cli/tests/reference/anyref-import-catch.wat index 7338f544d0a..c0bd0b51b81 100644 --- a/crates/cli/tests/reference/anyref-import-catch.wat +++ b/crates/cli/tests/reference/anyref-import-catch.wat @@ -1,24 +1,22 @@ (module $reference_test.wasm (type (;0;) (func)) (type (;1;) (func (result i32))) - (type (;2;) (func (param i32))) - (type (;3;) (func (param i32) (result i32))) + (type (;2;) (func (result i32 i32))) + (type (;3;) (func (param i32))) (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) - (func $exported (;1;) (type 2) (param i32)) - (func $__externref_table_dealloc (;2;) (type 2) (param i32)) - (func $__externref_table_alloc (;3;) (type 1) (result i32)) - (func $__wbindgen_exn_store (;4;) (type 2) (param i32)) - (func $__wbindgen_add_to_stack_pointer (;5;) (type 3) (param i32) (result i32)) + (func $__externref_table_dealloc (;1;) (type 3) (param i32)) + (func $__externref_table_alloc (;2;) (type 1) (result i32)) + (func $__wbindgen_exn_store (;3;) (type 3) (param i32)) + (func $"exported multivalue shim" (;4;) (type 2) (result i32 i32)) (table (;0;) 128 externref) (memory (;0;) 17) (export "memory" (memory 0)) - (export "exported" (func $exported)) + (export "exported" (func $"exported multivalue shim")) (export "__wbindgen_exn_store" (func $__wbindgen_exn_store)) (export "__externref_table_alloc" (func $__externref_table_alloc)) (export "__wbindgen_export_2" (table 0)) - (export "__wbindgen_add_to_stack_pointer" (func $__wbindgen_add_to_stack_pointer)) (export "__externref_table_dealloc" (func $__externref_table_dealloc)) (export "__wbindgen_start" (func 0)) - (@custom "target_features" (after code) "\03+\0fmutable-globals+\08sign-ext+\0freference-types") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/anyref-nop.wat b/crates/cli/tests/reference/anyref-nop.wat index 5b10a28d750..cc829fa21e9 100644 --- a/crates/cli/tests/reference/anyref-nop.wat +++ b/crates/cli/tests/reference/anyref-nop.wat @@ -8,6 +8,6 @@ (export "foo" (func $foo)) (export "__wbindgen_export_0" (table 0)) (export "__wbindgen_start" (func 0)) - (@custom "target_features" (after code) "\03+\0fmutable-globals+\08sign-ext+\0freference-types") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/builder.wat b/crates/cli/tests/reference/builder.wat index 47c4a031437..04ee04ef6b5 100644 --- a/crates/cli/tests/reference/builder.wat +++ b/crates/cli/tests/reference/builder.wat @@ -7,6 +7,6 @@ (export "memory" (memory 0)) (export "__wbg_classbuilder_free" (func $__wbg_classbuilder_free)) (export "classbuilder_builder" (func $classbuilder_builder)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/constructor.wat b/crates/cli/tests/reference/constructor.wat index 08eb4887660..27bb6d6781c 100644 --- a/crates/cli/tests/reference/constructor.wat +++ b/crates/cli/tests/reference/constructor.wat @@ -7,6 +7,6 @@ (export "memory" (memory 0)) (export "__wbg_classconstructor_free" (func $__wbg_classconstructor_free)) (export "classconstructor_new" (func $classconstructor_new)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/empty.wat b/crates/cli/tests/reference/empty.wat index b2199f956b4..3cd6ac87a09 100644 --- a/crates/cli/tests/reference/empty.wat +++ b/crates/cli/tests/reference/empty.wat @@ -1,6 +1,6 @@ (module $reference_test.wasm (memory (;0;) 16) (export "memory" (memory 0)) - (@custom "target_features" (after export) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after export) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/enums.wat b/crates/cli/tests/reference/enums.wat index 479c1c3ec89..cc9bb74b586 100644 --- a/crates/cli/tests/reference/enums.wat +++ b/crates/cli/tests/reference/enums.wat @@ -10,6 +10,6 @@ (export "option_enum_echo" (func $option_enum_echo)) (export "get_name" (func $get_name)) (export "option_string_enum_echo" (func $option_string_enum_echo)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/getter-setter.js b/crates/cli/tests/reference/getter-setter.js index 789dfb2787e..6c05b3065a9 100644 --- a/crates/cli/tests/reference/getter-setter.js +++ b/crates/cli/tests/reference/getter-setter.js @@ -24,15 +24,6 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } -let cachedDataViewMemory0 = null; - -function getDataViewMemory0() { - if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { - cachedDataViewMemory0 = new DataView(wasm.memory.buffer); - } - return cachedDataViewMemory0; -} - function isLikeNone(x) { return x === undefined || x === null; } @@ -129,61 +120,40 @@ export class Foo { * @returns {number | undefined} */ get y() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.__wbg_get_foo_y(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.__wbg_get_foo_y(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** * @param {number | undefined} [arg0] */ set y(arg0) { - wasm.__wbg_set_foo_y(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? 0 : arg0); + wasm.__wbg_set_foo_y(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0); } /** * @returns {number | undefined} */ get z() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.foo_z(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.foo_z(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** * @param {number | undefined} [z] */ set z(z) { - wasm.foo_set_z(this.__wbg_ptr, !isLikeNone(z), isLikeNone(z) ? 0 : z); + wasm.foo_set_z(this.__wbg_ptr, isLikeNone(z) ? 0x100000001 : (z) >>> 0); } /** * @returns {number | undefined} */ get lone_getter() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.foo_lone_getter(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.foo_lone_getter(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** * @param {number | undefined} [value] */ set lone_setter(value) { - wasm.foo_set_lone_setter(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); + wasm.foo_set_lone_setter(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); } /** * You will only read numbers. diff --git a/crates/cli/tests/reference/getter-setter.wat b/crates/cli/tests/reference/getter-setter.wat index 9688f99b7f2..3daf51bf7a5 100644 --- a/crates/cli/tests/reference/getter-setter.wat +++ b/crates/cli/tests/reference/getter-setter.wat @@ -2,26 +2,27 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param i32) (result i32))) - (type (;3;) (func (param i32 i32))) - (type (;4;) (func (param i32 i32) (result i32))) - (type (;5;) (func (param i32 i32 i32))) - (type (;6;) (func (param i32 i32 i32 i32) (result i32))) - (func $__wbindgen_realloc (;0;) (type 6) (param i32 i32 i32 i32) (result i32)) - (func $__wbindgen_malloc (;1;) (type 4) (param i32 i32) (result i32)) - (func $__wbg_set_foo_y (;2;) (type 5) (param i32 i32 i32)) - (func $__wbg_get_foo_y (;3;) (type 3) (param i32 i32)) - (func $foo_z (;4;) (type 3) (param i32 i32)) - (func $foo_lone_getter (;5;) (type 3) (param i32 i32)) - (func $foo_set_weird (;6;) (type 5) (param i32 i32 i32)) - (func $foo_set_z (;7;) (type 5) (param i32 i32 i32)) - (func $foo_set_lone_setter (;8;) (type 5) (param i32 i32 i32)) - (func $__wbg_get_foo_x (;9;) (type 2) (param i32) (result i32)) - (func $__wbg_set_foo_x (;10;) (type 3) (param i32 i32)) + (type (;3;) (func (param i32) (result f64))) + (type (;4;) (func (param i32 i32))) + (type (;5;) (func (param i32 i32) (result i32))) + (type (;6;) (func (param i32 i32 i32))) + (type (;7;) (func (param i32 i32 i32 i32) (result i32))) + (type (;8;) (func (param i32 f64))) + (func $__wbindgen_realloc (;0;) (type 7) (param i32 i32 i32 i32) (result i32)) + (func $__wbindgen_malloc (;1;) (type 5) (param i32 i32) (result i32)) + (func $foo_set_weird (;2;) (type 6) (param i32 i32 i32)) + (func $__wbg_set_foo_y (;3;) (type 8) (param i32 f64)) + (func $__wbg_get_foo_y (;4;) (type 3) (param i32) (result f64)) + (func $__wbg_get_foo_x (;5;) (type 2) (param i32) (result i32)) + (func $foo_set_z (;6;) (type 8) (param i32 f64)) + (func $foo_set_lone_setter (;7;) (type 8) (param i32 f64)) + (func $foo_z (;8;) (type 3) (param i32) (result f64)) + (func $foo_lone_getter (;9;) (type 3) (param i32) (result f64)) + (func $__wbg_set_foo_x (;10;) (type 4) (param i32 i32)) (func $foo_weird (;11;) (type 2) (param i32) (result i32)) (func $foo_x_static (;12;) (type 0) (result i32)) - (func $__wbg_foo_free (;13;) (type 3) (param i32 i32)) + (func $__wbg_foo_free (;13;) (type 4) (param i32 i32)) (func $foo_set_x_static (;14;) (type 1) (param i32)) - (func $__wbindgen_add_to_stack_pointer (;15;) (type 2) (param i32) (result i32)) (memory (;0;) 17) (export "memory" (memory 0)) (export "__wbg_foo_free" (func $__wbg_foo_free)) @@ -37,9 +38,8 @@ (export "foo_set_weird" (func $foo_set_weird)) (export "foo_x_static" (func $foo_x_static)) (export "foo_set_x_static" (func $foo_set_x_static)) - (export "__wbindgen_add_to_stack_pointer" (func $__wbindgen_add_to_stack_pointer)) (export "__wbindgen_malloc" (func $__wbindgen_malloc)) (export "__wbindgen_realloc" (func $__wbindgen_realloc)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/import-catch.js b/crates/cli/tests/reference/import-catch.js index 4c4d0284851..3f6f772e0ae 100644 --- a/crates/cli/tests/reference/import-catch.js +++ b/crates/cli/tests/reference/import-catch.js @@ -27,15 +27,6 @@ function handleError(f, args) { } } -let cachedDataViewMemory0 = null; - -function getDataViewMemory0() { - if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { - cachedDataViewMemory0 = new DataView(wasm.memory.buffer); - } - return cachedDataViewMemory0; -} - function getObject(idx) { return heap[idx]; } function dropObject(idx) { @@ -51,16 +42,9 @@ function takeObject(idx) { } export function exported() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.exported(retptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - if (r1) { - throw takeObject(r0); - } - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); + const ret = wasm.exported(); + if (ret[1]) { + throw takeObject(ret[0]); } } diff --git a/crates/cli/tests/reference/import-catch.wat b/crates/cli/tests/reference/import-catch.wat index 2189e238a2e..1645ae59dbc 100644 --- a/crates/cli/tests/reference/import-catch.wat +++ b/crates/cli/tests/reference/import-catch.wat @@ -1,14 +1,12 @@ (module $reference_test.wasm - (type (;0;) (func (param i32))) - (type (;1;) (func (param i32) (result i32))) - (func $exported (;0;) (type 0) (param i32)) - (func $__wbindgen_exn_store (;1;) (type 0) (param i32)) - (func $__wbindgen_add_to_stack_pointer (;2;) (type 1) (param i32) (result i32)) + (type (;0;) (func (result i32 i32))) + (type (;1;) (func (param i32))) + (func $__wbindgen_exn_store (;0;) (type 1) (param i32)) + (func $"exported multivalue shim" (;1;) (type 0) (result i32 i32)) (memory (;0;) 17) (export "memory" (memory 0)) - (export "exported" (func $exported)) + (export "exported" (func $"exported multivalue shim")) (export "__wbindgen_exn_store" (func $__wbindgen_exn_store)) - (export "__wbindgen_add_to_stack_pointer" (func $__wbindgen_add_to_stack_pointer)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/nop.wat b/crates/cli/tests/reference/nop.wat index 211418dd944..1b0d33a23f5 100644 --- a/crates/cli/tests/reference/nop.wat +++ b/crates/cli/tests/reference/nop.wat @@ -4,6 +4,6 @@ (memory (;0;) 17) (export "memory" (memory 0)) (export "nop" (func $nop)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/pointers.wat b/crates/cli/tests/reference/pointers.wat index 5d64739088d..954d8a7ff1c 100644 --- a/crates/cli/tests/reference/pointers.wat +++ b/crates/cli/tests/reference/pointers.wat @@ -6,6 +6,6 @@ (export "memory" (memory 0)) (export "const_pointer" (func $const_pointer)) (export "mut_pointer" (func $mut_pointer)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/raw.wat b/crates/cli/tests/reference/raw.wat index d3589ef5dba..3d459092f0b 100644 --- a/crates/cli/tests/reference/raw.wat +++ b/crates/cli/tests/reference/raw.wat @@ -11,6 +11,6 @@ (export "__wbg_test_free" (func $__wbg_test_free)) (export "test_test1" (func $test_test1)) (export "test_test2" (func $test_test2)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/result-string.js b/crates/cli/tests/reference/result-string.js index caa17738225..ca996f741a9 100644 --- a/crates/cli/tests/reference/result-string.js +++ b/crates/cli/tests/reference/result-string.js @@ -19,15 +19,6 @@ function addHeapObject(obj) { return idx; } -let cachedDataViewMemory0 = null; - -function getDataViewMemory0() { - if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { - cachedDataViewMemory0 = new DataView(wasm.memory.buffer); - } - return cachedDataViewMemory0; -} - function getObject(idx) { return heap[idx]; } function dropObject(idx) { @@ -68,23 +59,17 @@ export function exported() { let deferred2_0; let deferred2_1; try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.exported(retptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); - var ptr1 = r0; - var len1 = r1; - if (r3) { + const ret = wasm.exported(); + var ptr1 = ret[0]; + var len1 = ret[1]; + if (ret[3]) { ptr1 = 0; len1 = 0; - throw takeObject(r2); + throw takeObject(ret[2]); } deferred2_0 = ptr1; deferred2_1 = len1; return getStringFromWasm0(ptr1, len1); } finally { - wasm.__wbindgen_add_to_stack_pointer(16); wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); } } diff --git a/crates/cli/tests/reference/result-string.wat b/crates/cli/tests/reference/result-string.wat index c7f63576bbd..591d80c3bc6 100644 --- a/crates/cli/tests/reference/result-string.wat +++ b/crates/cli/tests/reference/result-string.wat @@ -1,15 +1,12 @@ (module $reference_test.wasm - (type (;0;) (func (param i32))) - (type (;1;) (func (param i32) (result i32))) - (type (;2;) (func (param i32 i32 i32))) - (func $exported (;0;) (type 0) (param i32)) - (func $__wbindgen_free (;1;) (type 2) (param i32 i32 i32)) - (func $__wbindgen_add_to_stack_pointer (;2;) (type 1) (param i32) (result i32)) + (type (;0;) (func (result i32 i32 i32 i32))) + (type (;1;) (func (param i32 i32 i32))) + (func $__wbindgen_free (;0;) (type 1) (param i32 i32 i32)) + (func $"exported multivalue shim" (;1;) (type 0) (result i32 i32 i32 i32)) (memory (;0;) 17) (export "memory" (memory 0)) - (export "exported" (func $exported)) - (export "__wbindgen_add_to_stack_pointer" (func $__wbindgen_add_to_stack_pointer)) + (export "exported" (func $"exported multivalue shim")) (export "__wbindgen_free" (func $__wbindgen_free)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/self-type.wat b/crates/cli/tests/reference/self-type.wat index 546667f8a53..667e060b4c9 100644 --- a/crates/cli/tests/reference/self-type.wat +++ b/crates/cli/tests/reference/self-type.wat @@ -20,6 +20,6 @@ (export "test_self_Self" (func $test_self_Self)) (export "test_self_ref_Self" (func $test_self_ref_Self)) (export "test_self_ref_mut_Self" (func $test_self_ref_mut_Self)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/skip-jsdoc.wat b/crates/cli/tests/reference/skip-jsdoc.wat index 0179e135da5..2b7cadc23ee 100644 --- a/crates/cli/tests/reference/skip-jsdoc.wat +++ b/crates/cli/tests/reference/skip-jsdoc.wat @@ -6,6 +6,6 @@ (export "memory" (memory 0)) (export "docme" (func $docme)) (export "i_has_docs" (func $i_has_docs)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/string-arg.wat b/crates/cli/tests/reference/string-arg.wat index 1ce4e8ca28a..fae75cfbcba 100644 --- a/crates/cli/tests/reference/string-arg.wat +++ b/crates/cli/tests/reference/string-arg.wat @@ -10,6 +10,6 @@ (export "foo" (func $foo)) (export "__wbindgen_malloc" (func $__wbindgen_malloc)) (export "__wbindgen_realloc" (func $__wbindgen_realloc)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") ) diff --git a/crates/cli/tests/reference/web-sys.wat b/crates/cli/tests/reference/web-sys.wat index b4993ed4ac3..06265263889 100644 --- a/crates/cli/tests/reference/web-sys.wat +++ b/crates/cli/tests/reference/web-sys.wat @@ -15,6 +15,6 @@ (export "__wbindgen_exn_store" (func $__wbindgen_exn_store)) (export "__wbindgen_malloc" (func $__wbindgen_malloc)) (export "__wbindgen_realloc" (func $__wbindgen_realloc)) - (@custom "target_features" (after code) "\02+\0fmutable-globals+\08sign-ext") + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") )