diff options
Diffstat (limited to 'test/wasm2js')
30 files changed, 146 insertions, 147 deletions
diff --git a/test/wasm2js/atomics_32.2asm.js b/test/wasm2js/atomics_32.2asm.js index 1fdd8916e..a97bf17ed 100644 --- a/test/wasm2js/atomics_32.2asm.js +++ b/test/wasm2js/atomics_32.2asm.js @@ -110,7 +110,7 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { + function test() { var i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0; Atomics.compareExchange(HEAP8, 1024, 1, 2) | 0; Atomics.compareExchange(HEAP16, 1024 >> 1, 1, 2) | 0; @@ -147,7 +147,7 @@ function asmFunc(imports) { } return { - "test": $0 + "test": test }; } diff --git a/test/wasm2js/atomics_32.2asm.js.opt b/test/wasm2js/atomics_32.2asm.js.opt index 0d7ab96f6..deb8ce561 100644 --- a/test/wasm2js/atomics_32.2asm.js.opt +++ b/test/wasm2js/atomics_32.2asm.js.opt @@ -110,7 +110,7 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { + function test() { Atomics.compareExchange(HEAP8, 1024, 1, 2) | 0; Atomics.compareExchange(HEAP16, 512, 1, 2) | 0; Atomics.compareExchange(HEAP32, 256, 1, 2) | 0; @@ -143,7 +143,7 @@ function asmFunc(imports) { } return { - "test": $0 + "test": test }; } diff --git a/test/wasm2js/atomics_32.wast b/test/wasm2js/atomics_32.wast index a4e19052d..eeec93376 100644 --- a/test/wasm2js/atomics_32.wast +++ b/test/wasm2js/atomics_32.wast @@ -2,7 +2,7 @@ (memory (shared 256 256)) (data "hello,") (data "world!") - (func "test" + (func $test (export "test") (local $x i32) (local $y i64) (local.set $x (i32.atomic.rmw8.cmpxchg_u (i32.const 1024) (i32.const 1) (i32.const 2))) diff --git a/test/wasm2js/br_table_hoisting.2asm.js b/test/wasm2js/br_table_hoisting.2asm.js index c814955aa..73652c3bc 100644 --- a/test/wasm2js/br_table_hoisting.2asm.js +++ b/test/wasm2js/br_table_hoisting.2asm.js @@ -15,7 +15,7 @@ function asmFunc(imports) { zed($0 | 0); } - function $1(x) { + function foo1(x) { x = x | 0; a : { b : { @@ -44,7 +44,7 @@ function asmFunc(imports) { zed(-10 | 0); } - function $2(x) { + function foo2(x) { x = x | 0; a : { b : { @@ -81,7 +81,7 @@ function asmFunc(imports) { zed(-10 | 0); } - function $3(x) { + function foo3(x) { x = x | 0; a : { b : { @@ -121,7 +121,7 @@ function asmFunc(imports) { zed(-10 | 0); } - function $4(x) { + function foo4(x) { x = x | 0; a : { b : { @@ -167,10 +167,10 @@ function asmFunc(imports) { } return { - "foo1": $1, - "foo2": $2, - "foo3": $3, - "foo4": $4 + "foo1": foo1, + "foo2": foo2, + "foo3": foo3, + "foo4": foo4 }; } diff --git a/test/wasm2js/br_table_hoisting.2asm.js.opt b/test/wasm2js/br_table_hoisting.2asm.js.opt index 767b126ab..c4d825421 100644 --- a/test/wasm2js/br_table_hoisting.2asm.js.opt +++ b/test/wasm2js/br_table_hoisting.2asm.js.opt @@ -14,7 +14,7 @@ function asmFunc(imports) { zed($0); } - function $1($0) { + function foo1($0) { $0 = $0 | 0; a : { b : { @@ -42,7 +42,7 @@ function asmFunc(imports) { zed(-10); } - function $2($0) { + function foo2($0) { $0 = $0 | 0; a : { b : { @@ -77,7 +77,7 @@ function asmFunc(imports) { zed(-10); } - function $3($0) { + function foo3($0) { $0 = $0 | 0; a : { b : { @@ -115,7 +115,7 @@ function asmFunc(imports) { zed(-10); } - function $4($0) { + function foo4($0) { $0 = $0 | 0; a : { b : { @@ -157,10 +157,10 @@ function asmFunc(imports) { } return { - "foo1": $1, - "foo2": $2, - "foo3": $3, - "foo4": $4 + "foo1": foo1, + "foo2": foo2, + "foo3": foo3, + "foo4": foo4 }; } diff --git a/test/wasm2js/br_table_hoisting.wast b/test/wasm2js/br_table_hoisting.wast index 95afab728..c72abc61e 100644 --- a/test/wasm2js/br_table_hoisting.wast +++ b/test/wasm2js/br_table_hoisting.wast @@ -2,7 +2,7 @@ (func $zed (param i32) (call $zed (local.get 0)) ) - (func "foo1" (param $x i32) + (func $foo1 (export "foo1") (param $x i32) (block $a (block $b (block $c @@ -29,7 +29,7 @@ (call $zed (i32.const -9)) (call $zed (i32.const -10)) ) - (func "foo2" (param $x i32) + (func $foo2 (export "foo2") (param $x i32) (block $a (block $b (block $c @@ -56,7 +56,7 @@ (call $zed (i32.const -9)) (call $zed (i32.const -10)) ) - (func "foo3" (param $x i32) + (func $foo3 (export "foo3") (param $x i32) (block $a (block $b (block $c @@ -83,7 +83,7 @@ (call $zed (i32.const -9)) (call $zed (i32.const -10)) ) - (func "foo4" (param $x i32) + (func $foo4 (export "foo4") (param $x i32) (block $a (block $b (block $c @@ -112,4 +112,3 @@ (call $zed (i32.const -10)) ) ) - diff --git a/test/wasm2js/br_table_to_loop.2asm.js b/test/wasm2js/br_table_to_loop.2asm.js index a0844d936..939e60bf6 100644 --- a/test/wasm2js/br_table_to_loop.2asm.js +++ b/test/wasm2js/br_table_to_loop.2asm.js @@ -10,7 +10,7 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { + function exp1() { block : { loop : while (1) switch (1 | 0) { case 1: @@ -21,7 +21,7 @@ function asmFunc(imports) { } } - function $1() { + function exp2() { block : { loop : while (1) switch (1 | 0) { case 1: @@ -33,8 +33,8 @@ function asmFunc(imports) { } return { - "exp1": $0, - "exp2": $1 + "exp1": exp1, + "exp2": exp2 }; } diff --git a/test/wasm2js/br_table_to_loop.2asm.js.opt b/test/wasm2js/br_table_to_loop.2asm.js.opt index 4c9f97311..7215e2676 100644 --- a/test/wasm2js/br_table_to_loop.2asm.js.opt +++ b/test/wasm2js/br_table_to_loop.2asm.js.opt @@ -10,17 +10,17 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { + function exp1() { while (1) continue; } - function $1() { + function exp2() { } return { - "exp1": $0, - "exp2": $1 + "exp1": exp1, + "exp2": exp2 }; } diff --git a/test/wasm2js/br_table_to_loop.wast b/test/wasm2js/br_table_to_loop.wast index a74d5ffe0..add8f3eeb 100644 --- a/test/wasm2js/br_table_to_loop.wast +++ b/test/wasm2js/br_table_to_loop.wast @@ -1,5 +1,5 @@ (module - (func "exp1" + (func $exp1 (export "exp1") (block $block ;; An infinite loop. When optimizing, wasm2js enables ignore-implicit-traps ;; and so it can simplify this. @@ -8,7 +8,7 @@ ) ) ) - (func "exp2" + (func $exp2 (export "exp2") (block $block ;; A loop that never executes. This can be optimized into a nop. (loop $loop diff --git a/test/wasm2js/deterministic.2asm.js b/test/wasm2js/deterministic.2asm.js index fff96b5a4..33cb04a84 100644 --- a/test/wasm2js/deterministic.2asm.js +++ b/test/wasm2js/deterministic.2asm.js @@ -25,7 +25,7 @@ function asmFunc(imports) { var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; var global$0 = -44; - function $0() { + function foo() { if ((global$0 >>> 0) / ((HEAP32[0 >> 2] | 0) >>> 0) | 0) { wasm2js_trap() } @@ -38,7 +38,7 @@ function asmFunc(imports) { } return { - "foo": $0 + "foo": foo }; } diff --git a/test/wasm2js/deterministic.2asm.js.opt b/test/wasm2js/deterministic.2asm.js.opt index a05554b1a..12ebdd859 100644 --- a/test/wasm2js/deterministic.2asm.js.opt +++ b/test/wasm2js/deterministic.2asm.js.opt @@ -24,7 +24,7 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { + function foo() { if (4294967252 / HEAPU32[0] | 0) { wasm2js_trap() } @@ -37,7 +37,7 @@ function asmFunc(imports) { } return { - "foo": $0 + "foo": foo }; } diff --git a/test/wasm2js/deterministic.wast b/test/wasm2js/deterministic.wast index d1f39ba06..67caefbad 100644 --- a/test/wasm2js/deterministic.wast +++ b/test/wasm2js/deterministic.wast @@ -1,7 +1,7 @@ (module (global $global$0 (mut i32) (i32.const -44)) (import "env" "memory" (memory $0 1 1)) - (func "foo" (result i32) + (func $foo (export "foo") (result i32) (if (i32.div_u (global.get $global$0) diff --git a/test/wasm2js/dot_import.2asm.js b/test/wasm2js/dot_import.2asm.js index a35eabe95..ddbec432b 100644 --- a/test/wasm2js/dot_import.2asm.js +++ b/test/wasm2js/dot_import.2asm.js @@ -13,12 +13,12 @@ function asmFunc(imports) { var Math_sqrt = Math.sqrt; var mod_ule = imports["mod.ule"]; var base = mod_ule["ba.se"]; - function $0() { + function exported() { base(); } return { - "exported": $0 + "exported": exported }; } diff --git a/test/wasm2js/dot_import.2asm.js.opt b/test/wasm2js/dot_import.2asm.js.opt index a35eabe95..ddbec432b 100644 --- a/test/wasm2js/dot_import.2asm.js.opt +++ b/test/wasm2js/dot_import.2asm.js.opt @@ -13,12 +13,12 @@ function asmFunc(imports) { var Math_sqrt = Math.sqrt; var mod_ule = imports["mod.ule"]; var base = mod_ule["ba.se"]; - function $0() { + function exported() { base(); } return { - "exported": $0 + "exported": exported }; } diff --git a/test/wasm2js/dot_import.wast b/test/wasm2js/dot_import.wast index 46c843fde..4da6478ee 100644 --- a/test/wasm2js/dot_import.wast +++ b/test/wasm2js/dot_import.wast @@ -1,6 +1,6 @@ (module (import "mod.ule" "ba.se" (func $base)) - (func "exported" + (func $exported (export "exported") (call $base) ) ) diff --git a/test/wasm2js/global_i64.2asm.js b/test/wasm2js/global_i64.2asm.js index 37c8b15fa..cccd5de1c 100644 --- a/test/wasm2js/global_i64.2asm.js +++ b/test/wasm2js/global_i64.2asm.js @@ -17,7 +17,7 @@ function asmFunc(imports) { $0$hi = $0$hi | 0; } - function $1() { + function exp() { var i64toi32_i32$0 = 0; i64toi32_i32$0 = f$hi; call(f | 0, i64toi32_i32$0 | 0); @@ -27,7 +27,7 @@ function asmFunc(imports) { } return { - "exp": $1 + "exp": exp }; } diff --git a/test/wasm2js/global_i64.2asm.js.opt b/test/wasm2js/global_i64.2asm.js.opt index e28ae7293..f6cc9d911 100644 --- a/test/wasm2js/global_i64.2asm.js.opt +++ b/test/wasm2js/global_i64.2asm.js.opt @@ -10,12 +10,12 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $1() { + function exp() { } return { - "exp": $1 + "exp": exp }; } diff --git a/test/wasm2js/global_i64.wast b/test/wasm2js/global_i64.wast index 6ed163d79..71a125bf6 100644 --- a/test/wasm2js/global_i64.wast +++ b/test/wasm2js/global_i64.wast @@ -1,7 +1,7 @@ (module (global $f (mut i64) (i64.const 0x12345678ABCDEFAF)) (func $call (param i64)) - (func "exp" + (func $exp (export "exp") (call $call (global.get $f)) (global.set $f (i64.const 0x1122334455667788)) ) diff --git a/test/wasm2js/indirect-select.2asm.js b/test/wasm2js/indirect-select.2asm.js index a515e1556..b17259274 100644 --- a/test/wasm2js/indirect-select.2asm.js +++ b/test/wasm2js/indirect-select.2asm.js @@ -13,19 +13,19 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0(x) { + function foo_true(x) { x = x | 0; return FUNCTION_TABLE[(x ? 1 : 0) | 0]() | 0 | 0; } - function $1(x) { + function foo_false(x) { x = x | 0; return FUNCTION_TABLE[(x ? 0 : 1) | 0]() | 0 | 0; } return { - "foo_true": $0, - "foo_false": $1 + "foo_true": foo_true, + "foo_false": foo_false }; } diff --git a/test/wasm2js/indirect-select.2asm.js.opt b/test/wasm2js/indirect-select.2asm.js.opt index 9b79e3a63..2d1792a53 100644 --- a/test/wasm2js/indirect-select.2asm.js.opt +++ b/test/wasm2js/indirect-select.2asm.js.opt @@ -13,19 +13,19 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0($0_1) { - $0_1 = $0_1 | 0; - return FUNCTION_TABLE[!!$0_1 | 0]() | 0; + function foo_true($0) { + $0 = $0 | 0; + return FUNCTION_TABLE[!!$0 | 0]() | 0; } - function $1($0_1) { - $0_1 = $0_1 | 0; - return FUNCTION_TABLE[!$0_1 | 0]() | 0; + function foo_false($0) { + $0 = $0 | 0; + return FUNCTION_TABLE[!$0 | 0]() | 0; } return { - "foo_true": $0, - "foo_false": $1 + "foo_true": foo_true, + "foo_false": foo_false }; } diff --git a/test/wasm2js/indirect-select.wast b/test/wasm2js/indirect-select.wast index fc6f4c470..a493ec14c 100644 --- a/test/wasm2js/indirect-select.wast +++ b/test/wasm2js/indirect-select.wast @@ -1,7 +1,7 @@ (module (type $none_=>_i32 (func (result i32))) (import "env" "table" (table $timport 6 funcref)) - (func "foo-true" (param $x i32) (result i32) + (func $foo-true (export "foo-true") (param $x i32) (result i32) (call_indirect (type $none_=>_i32) (select (i32.const 1) @@ -10,7 +10,7 @@ ) ) ) - (func "foo-false" (param $x i32) (result i32) + (func $foo-false (export "foo-false") (param $x i32) (result i32) (call_indirect (type $none_=>_i32) (select (i32.const 0) diff --git a/test/wasm2js/minified-memory.2asm.js b/test/wasm2js/minified-memory.2asm.js index 3e7b29b89..1d3e8c942 100644 --- a/test/wasm2js/minified-memory.2asm.js +++ b/test/wasm2js/minified-memory.2asm.js @@ -22,7 +22,7 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { + function foo() { return HEAP32[0 >> 2] | 0 | 0; } @@ -53,7 +53,7 @@ function asmFunc(imports) { } return { - "foo": $0 + "foo": foo }; } diff --git a/test/wasm2js/minified-memory.2asm.js.opt b/test/wasm2js/minified-memory.2asm.js.opt index 9c5f51f88..6d1dfa47d 100644 --- a/test/wasm2js/minified-memory.2asm.js.opt +++ b/test/wasm2js/minified-memory.2asm.js.opt @@ -22,7 +22,7 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { + function foo() { return HEAP32[0]; } @@ -53,7 +53,7 @@ function asmFunc(imports) { } return { - "foo": $0 + "foo": foo }; } diff --git a/test/wasm2js/minified-memory.wast b/test/wasm2js/minified-memory.wast index 0fc1e3018..fb3725aaa 100644 --- a/test/wasm2js/minified-memory.wast +++ b/test/wasm2js/minified-memory.wast @@ -1,6 +1,6 @@ (module (import "env" "a" (memory $0 1)) - (func "foo" (result i32) + (func $foo (export "foo") (result i32) (i32.load (i32.const 0)) ) ) diff --git a/test/wasm2js/reinterpret_scratch.2asm.js b/test/wasm2js/reinterpret_scratch.2asm.js index ef5307733..547206072 100644 --- a/test/wasm2js/reinterpret_scratch.2asm.js +++ b/test/wasm2js/reinterpret_scratch.2asm.js @@ -38,11 +38,11 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { - var i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, $0_1 = Math_fround(0); + function foo() { + var i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, $0 = Math_fround(0); wasm2js_scratch_store_f64(+(305419896.0)); i64toi32_i32$0 = wasm2js_scratch_load_i32(1 | 0) | 0; - i64toi32_i32$1 = (wasm2js_scratch_store_f32($0_1), wasm2js_scratch_load_i32(2)); + i64toi32_i32$1 = (wasm2js_scratch_store_f32($0), wasm2js_scratch_load_i32(2)); HEAP32[i64toi32_i32$1 >> 2] = wasm2js_scratch_load_i32(0 | 0) | 0; HEAP32[(i64toi32_i32$1 + 4 | 0) >> 2] = i64toi32_i32$0; return HEAP32[0 >> 2] | 0 | 0; @@ -54,7 +54,7 @@ function asmFunc(imports) { } return { - "foo": $0 + "foo": foo }; } diff --git a/test/wasm2js/reinterpret_scratch.2asm.js.opt b/test/wasm2js/reinterpret_scratch.2asm.js.opt index d1e018442..bc077cdce 100644 --- a/test/wasm2js/reinterpret_scratch.2asm.js.opt +++ b/test/wasm2js/reinterpret_scratch.2asm.js.opt @@ -34,12 +34,12 @@ function asmFunc(imports) { var Math_ceil = Math.ceil; var Math_trunc = Math.trunc; var Math_sqrt = Math.sqrt; - function $0() { - var $0_1 = 0; + function foo() { + var $0 = 0; wasm2js_scratch_store_f64(305419896.0); - $0_1 = wasm2js_scratch_load_i32(1) | 0; + $0 = wasm2js_scratch_load_i32(1) | 0; HEAP32[0] = wasm2js_scratch_load_i32(0); - HEAP32[1] = $0_1; + HEAP32[1] = $0; return HEAP32[0]; } @@ -49,7 +49,7 @@ function asmFunc(imports) { } return { - "foo": $0 + "foo": foo }; } diff --git a/test/wasm2js/reinterpret_scratch.wast b/test/wasm2js/reinterpret_scratch.wast index bfaf68380..4741a6940 100644 --- a/test/wasm2js/reinterpret_scratch.wast +++ b/test/wasm2js/reinterpret_scratch.wast @@ -1,6 +1,6 @@ (module (memory $0 1 1) - (func "foo" (result i32) + (func $foo (export "foo") (result i32) (local $0 f32) (i64.store align=4 (i32.reinterpret_f32 ;; i32 0 diff --git a/test/wasm2js/sign_ext.2asm.js b/test/wasm2js/sign_ext.2asm.js index 4ce98c880..220b2753d 100644 --- a/test/wasm2js/sign_ext.2asm.js +++ b/test/wasm2js/sign_ext.2asm.js @@ -14,17 +14,17 @@ function asmFunc(imports) { var env = imports.env; var setTempRet0 = env.setTempRet0; var i64toi32_i32$HIGH_BITS = 0; - function $0(x) { + function test8(x) { x = x | 0; return x << 24 >> 24 | 0; } - function $1(x) { + function test16(x) { x = x | 0; return x << 16 >> 16 | 0; } - function $2(x, x$hi) { + function test8_i64(x, x$hi) { x = x | 0; x$hi = x$hi | 0; var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0; @@ -34,7 +34,7 @@ function asmFunc(imports) { return i64toi32_i32$2 | 0; } - function $3(x, x$hi) { + function test16_i64(x, x$hi) { x = x | 0; x$hi = x$hi | 0; var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0; @@ -44,7 +44,7 @@ function asmFunc(imports) { return i64toi32_i32$2 | 0; } - function $4(x, x$hi) { + function test32_i64(x, x$hi) { x = x | 0; x$hi = x$hi | 0; var i64toi32_i32$2 = 0, i64toi32_i32$1 = 0; @@ -54,15 +54,15 @@ function asmFunc(imports) { return i64toi32_i32$2 | 0; } - function legalstub$2($0_1, $1_1) { - $0_1 = $0_1 | 0; - $1_1 = $1_1 | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4_1 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + function legalstub$test8_i64($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2 = 0, $2$hi = 0; i64toi32_i32$0 = 0; - $4_1 = $0_1; + $4 = $0; $4$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; - i64toi32_i32$2 = $1_1; + i64toi32_i32$2 = $1; i64toi32_i32$1 = 0; i64toi32_i32$3 = 32; i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; @@ -75,13 +75,13 @@ function asmFunc(imports) { } $7$hi = i64toi32_i32$1; i64toi32_i32$1 = $4$hi; - i64toi32_i32$0 = $4_1; + i64toi32_i32$0 = $4; i64toi32_i32$2 = $7$hi; i64toi32_i32$3 = $12; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - i64toi32_i32$2 = $2(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$2 = test8_i64(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; - $2_1 = i64toi32_i32$2; + $2 = i64toi32_i32$2; $2$hi = i64toi32_i32$0; i64toi32_i32$1 = i64toi32_i32$2; i64toi32_i32$2 = 0; @@ -96,18 +96,18 @@ function asmFunc(imports) { } setTempRet0($13 | 0); i64toi32_i32$2 = $2$hi; - return $2_1 | 0; + return $2 | 0; } - function legalstub$3($0_1, $1_1) { - $0_1 = $0_1 | 0; - $1_1 = $1_1 | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4_1 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + function legalstub$test16_i64($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2 = 0, $2$hi = 0; i64toi32_i32$0 = 0; - $4_1 = $0_1; + $4 = $0; $4$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; - i64toi32_i32$2 = $1_1; + i64toi32_i32$2 = $1; i64toi32_i32$1 = 0; i64toi32_i32$3 = 32; i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; @@ -120,13 +120,13 @@ function asmFunc(imports) { } $7$hi = i64toi32_i32$1; i64toi32_i32$1 = $4$hi; - i64toi32_i32$0 = $4_1; + i64toi32_i32$0 = $4; i64toi32_i32$2 = $7$hi; i64toi32_i32$3 = $12; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - i64toi32_i32$2 = $3(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$2 = test16_i64(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; - $2_1 = i64toi32_i32$2; + $2 = i64toi32_i32$2; $2$hi = i64toi32_i32$0; i64toi32_i32$1 = i64toi32_i32$2; i64toi32_i32$2 = 0; @@ -141,18 +141,18 @@ function asmFunc(imports) { } setTempRet0($13 | 0); i64toi32_i32$2 = $2$hi; - return $2_1 | 0; + return $2 | 0; } - function legalstub$4($0_1, $1_1) { - $0_1 = $0_1 | 0; - $1_1 = $1_1 | 0; - var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4_1 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + function legalstub$test32_i64($0, $1) { + $0 = $0 | 0; + $1 = $1 | 0; + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4 = 0, $4$hi = 0, $7$hi = 0, $2 = 0, $2$hi = 0; i64toi32_i32$0 = 0; - $4_1 = $0_1; + $4 = $0; $4$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; - i64toi32_i32$2 = $1_1; + i64toi32_i32$2 = $1; i64toi32_i32$1 = 0; i64toi32_i32$3 = 32; i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; @@ -165,13 +165,13 @@ function asmFunc(imports) { } $7$hi = i64toi32_i32$1; i64toi32_i32$1 = $4$hi; - i64toi32_i32$0 = $4_1; + i64toi32_i32$0 = $4; i64toi32_i32$2 = $7$hi; i64toi32_i32$3 = $12; i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - i64toi32_i32$2 = $4(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$2 = test32_i64(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; - $2_1 = i64toi32_i32$2; + $2 = i64toi32_i32$2; $2$hi = i64toi32_i32$0; i64toi32_i32$1 = i64toi32_i32$2; i64toi32_i32$2 = 0; @@ -186,15 +186,15 @@ function asmFunc(imports) { } setTempRet0($13 | 0); i64toi32_i32$2 = $2$hi; - return $2_1 | 0; + return $2 | 0; } return { - "test8": $0, - "test16": $1, - "test8_i64": legalstub$2, - "test16_i64": legalstub$3, - "test32_i64": legalstub$4 + "test8": test8, + "test16": test16, + "test8_i64": legalstub$test8_i64, + "test16_i64": legalstub$test16_i64, + "test32_i64": legalstub$test32_i64 }; } diff --git a/test/wasm2js/sign_ext.2asm.js.opt b/test/wasm2js/sign_ext.2asm.js.opt index 41f79ecc5..650b1c320 100644 --- a/test/wasm2js/sign_ext.2asm.js.opt +++ b/test/wasm2js/sign_ext.2asm.js.opt @@ -14,42 +14,42 @@ function asmFunc(imports) { var env = imports.env; var setTempRet0 = env.setTempRet0; var i64toi32_i32$HIGH_BITS = 0; - function $0($0_1) { - $0_1 = $0_1 | 0; - return $0_1 << 24 >> 24; + function test8($0) { + $0 = $0 | 0; + return $0 << 24 >> 24; } - function $1($0_1) { - $0_1 = $0_1 | 0; - return $0_1 << 16 >> 16; + function test16($0) { + $0 = $0 | 0; + return $0 << 16 >> 16; } - function legalstub$2($0_1, $1_1) { - $0_1 = $0_1 << 24 >> 24; - i64toi32_i32$HIGH_BITS = $0_1 >> 31; + function legalstub$test8_i64($0, $1) { + $0 = $0 << 24 >> 24; + i64toi32_i32$HIGH_BITS = $0 >> 31; setTempRet0(i64toi32_i32$HIGH_BITS | 0); - return $0_1; + return $0; } - function legalstub$3($0_1, $1_1) { - $0_1 = $0_1 << 16 >> 16; - i64toi32_i32$HIGH_BITS = $0_1 >> 31; + function legalstub$test16_i64($0, $1) { + $0 = $0 << 16 >> 16; + i64toi32_i32$HIGH_BITS = $0 >> 31; setTempRet0(i64toi32_i32$HIGH_BITS | 0); - return $0_1; + return $0; } - function legalstub$4($0_1, $1_1) { - i64toi32_i32$HIGH_BITS = $0_1 >> 31; + function legalstub$test32_i64($0, $1) { + i64toi32_i32$HIGH_BITS = $0 >> 31; setTempRet0(i64toi32_i32$HIGH_BITS | 0); - return $0_1; + return $0; } return { - "test8": $0, - "test16": $1, - "test8_i64": legalstub$2, - "test16_i64": legalstub$3, - "test32_i64": legalstub$4 + "test8": test8, + "test16": test16, + "test8_i64": legalstub$test8_i64, + "test16_i64": legalstub$test16_i64, + "test32_i64": legalstub$test32_i64 }; } diff --git a/test/wasm2js/sign_ext.wast b/test/wasm2js/sign_ext.wast index 825502a3f..6a3f91515 100644 --- a/test/wasm2js/sign_ext.wast +++ b/test/wasm2js/sign_ext.wast @@ -1,17 +1,17 @@ (module - (func "test8" (param $x i32) (result i32) + (func $test8 (export "test8") (param $x i32) (result i32) (i32.extend8_s (local.get $x)) ) - (func "test16" (param $x i32) (result i32) + (func $test16 (export "test16") (param $x i32) (result i32) (i32.extend16_s (local.get $x)) ) - (func "test8_i64" (param $x i64) (result i64) + (func $test8_i64 (export "test8_i64") (param $x i64) (result i64) (i64.extend8_s (local.get $x)) ) - (func "test16_i64" (param $x i64) (result i64) + (func $test16_i64 (export "test16_i64") (param $x i64) (result i64) (i64.extend16_s (local.get $x)) ) - (func "test32_i64" (param $x i64) (result i64) + (func $test32_i64 (export "test32_i64") (param $x i64) (result i64) (i64.extend32_s (local.get $x)) ) ) |