diff options
author | Alon Zakai <azakai@google.com> | 2019-04-25 17:10:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 17:10:06 -0700 |
commit | 78a4f9ef1afd6c209a5c69a8e7906ffe33575f58 (patch) | |
tree | 0f7443f2ca32ce1a6131a6cc95212de9b5ececb1 /test/wasm2js/func_ptrs.2asm.js | |
parent | 21f014f4bd0ea1086895d8674f1473af222eb416 (diff) | |
download | binaryen-78a4f9ef1afd6c209a5c69a8e7906ffe33575f58.tar.gz binaryen-78a4f9ef1afd6c209a5c69a8e7906ffe33575f58.tar.bz2 binaryen-78a4f9ef1afd6c209a5c69a8e7906ffe33575f58.zip |
wasm2js2: optimize call_indirect and select operands (#2056)
Don't use temp vars to reorder them unless we need to.
Diffstat (limited to 'test/wasm2js/func_ptrs.2asm.js')
-rw-r--r-- | test/wasm2js/func_ptrs.2asm.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/wasm2js/func_ptrs.2asm.js b/test/wasm2js/func_ptrs.2asm.js index b1936241d..708879e51 100644 --- a/test/wasm2js/func_ptrs.2asm.js +++ b/test/wasm2js/func_ptrs.2asm.js @@ -102,14 +102,12 @@ function asmFunc(global, env, buffer) { function $5(i) { i = i | 0; - var wasm2js_i32$0 = 0; - return (wasm2js_i32$0 = i, FUNCTION_TABLE[wasm2js_i32$0]() | 0) | 0; + return FUNCTION_TABLE[i]() | 0; } function $6(i) { i = i | 0; - var wasm2js_i32$0 = 0; - return (wasm2js_i32$0 = i, FUNCTION_TABLE[wasm2js_i32$0]() | 0) | 0; + return FUNCTION_TABLE[i]() | 0; } var FUNCTION_TABLE = [t1, t2, t3, u1, u2, t1, t3]; @@ -156,8 +154,7 @@ function asmFunc(global, env, buffer) { function $2(i) { i = i | 0; - var wasm2js_i32$0 = 0; - return (wasm2js_i32$0 = i, FUNCTION_TABLE[wasm2js_i32$0]() | 0) | 0; + return FUNCTION_TABLE[i]() | 0; } var FUNCTION_TABLE = [t1, t2]; |