diff options
author | Nathan Froyd <froydnj@gmail.com> | 2018-03-01 17:05:36 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2018-03-01 14:05:36 -0800 |
commit | 363c2c7abd68847b4b226764160e2d3431dc3b54 (patch) | |
tree | df8337f6fbb18aa816eb20b3deec958425862bfe /test/wasm2asm.traps.js | |
parent | 142bd78059afd225c404ea1caedd0114699f7bc7 (diff) | |
download | binaryen-363c2c7abd68847b4b226764160e2d3431dc3b54.tar.gz binaryen-363c2c7abd68847b4b226764160e2d3431dc3b54.tar.bz2 binaryen-363c2c7abd68847b4b226764160e2d3431dc3b54.zip |
eliminate multiple return statements for wasm2asm functions (#1448)
This change eliminates one issue that prevents asm.js validation of the
generated code, see #1443.
Diffstat (limited to 'test/wasm2asm.traps.js')
-rw-r--r-- | test/wasm2asm.traps.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/wasm2asm.traps.js b/test/wasm2asm.traps.js index f7bb948c6..7e79ac70b 100644 --- a/test/wasm2asm.traps.js +++ b/test/wasm2asm.traps.js @@ -19,17 +19,15 @@ function asmFunc(global, env, buffer) { function $1(x, y) { x = x | 0; y = y | 0; - var $2 = 0, $3 = 0, $4 = 0, wasm2asm_i32$0 = 0; + var $2 = 0, $3 = 0, $4 = 0; return x + y | 0 | 0; - return wasm2asm_i32$0 | 0; } function $2(x, y) { x = x | 0; y = y | 0; - var $2 = 0, $3 = 0, $4 = 0, wasm2asm_i32$0 = 0; + var $2 = 0, $3 = 0, $4 = 0; return (x | 0) / (y | 0) | 0 | 0; - return wasm2asm_i32$0 | 0; } function __wasm_ctz_i32(x) { @@ -59,17 +57,15 @@ function asmFunc(global, env, buffer) { function __wasm_rotl_i32(x, k) { x = x | 0; k = k | 0; - var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, wasm2asm_i32$0 = 0; + var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0; return ((4294967295 >>> (k & 31 | 0) | 0) & x | 0) << (k & 31 | 0) | 0 | (((4294967295 << (32 - (k & 31 | 0) | 0) | 0) & x | 0) >>> (32 - (k & 31 | 0) | 0) | 0) | 0 | 0; - return wasm2asm_i32$0 | 0; } function __wasm_rotr_i32(x, k) { x = x | 0; k = k | 0; - var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, wasm2asm_i32$0 = 0; + var $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0; return ((4294967295 << (k & 31 | 0) | 0) & x | 0) >>> (k & 31 | 0) | 0 | (((4294967295 >>> (32 - (k & 31 | 0) | 0) | 0) & x | 0) << (32 - (k & 31 | 0) | 0) | 0) | 0 | 0; - return wasm2asm_i32$0 | 0; } return { |