diff options
author | Alon Zakai <azakai@google.com> | 2019-04-24 15:27:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-24 15:27:05 -0700 |
commit | c3ed0f176b36a502ef2e1fd915550a808b8d8f0b (patch) | |
tree | 6abff96331025a74e18cfa4f173a997d3c800559 /test/wasm2js/br_table_temp.2asm.js | |
parent | bc0a605e8864324d40aafbd00e8de0e50240ce26 (diff) | |
download | binaryen-c3ed0f176b36a502ef2e1fd915550a808b8d8f0b.tar.gz binaryen-c3ed0f176b36a502ef2e1fd915550a808b8d8f0b.tar.bz2 binaryen-c3ed0f176b36a502ef2e1fd915550a808b8d8f0b.zip |
wasm2js: more js optimization (#2050)
* Emit ints as signed, so -1 isn't a big unsigned number.
* x - -c (where c is a constant) is larger than x + c in js (but not wasm)
* +(+x) => +x
* Avoid unnecessary coercions on calls, return, load, etc. - we just need coercions when entering or exiting "wasm" (not internally), and on actual operations that need them.
Diffstat (limited to 'test/wasm2js/br_table_temp.2asm.js')
-rw-r--r-- | test/wasm2js/br_table_temp.2asm.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/wasm2js/br_table_temp.2asm.js b/test/wasm2js/br_table_temp.2asm.js index cd240c2b3..106bef338 100644 --- a/test/wasm2js/br_table_temp.2asm.js +++ b/test/wasm2js/br_table_temp.2asm.js @@ -49540,7 +49540,7 @@ function asmFunc(global, env, buffer) { fake_return_waka123 : { dummy(); $1_1 = 4; - switch (4294967295 | 0) { + switch (-1 | 0) { case 0: break fake_return_waka123; case 1: @@ -49757,7 +49757,7 @@ function asmFunc(global, env, buffer) { $0 = $0 | 0; $1_1 = $1_1 | 0; $2_1 = $2_1 | 0; - return 4294967295 | 0; + return -1 | 0; } function $38() { @@ -50182,7 +50182,7 @@ function asmFunc(global, env, buffer) { } function legalstub$7() { - return +(+Math_fround($7())); + return +$7(); } var FUNCTION_TABLE = []; |