summaryrefslogtreecommitdiff
path: root/test/wasm2js/global_i64.2asm.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-04-24 15:27:05 -0700
committerGitHub <noreply@github.com>2019-04-24 15:27:05 -0700
commitc3ed0f176b36a502ef2e1fd915550a808b8d8f0b (patch)
tree6abff96331025a74e18cfa4f173a997d3c800559 /test/wasm2js/global_i64.2asm.js
parentbc0a605e8864324d40aafbd00e8de0e50240ce26 (diff)
downloadbinaryen-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/global_i64.2asm.js')
-rw-r--r--test/wasm2js/global_i64.2asm.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/wasm2js/global_i64.2asm.js b/test/wasm2js/global_i64.2asm.js
index 1d5497869..bdd72a121 100644
--- a/test/wasm2js/global_i64.2asm.js
+++ b/test/wasm2js/global_i64.2asm.js
@@ -21,17 +21,16 @@ function asmFunc(global, env, buffer) {
var abort = env.abort;
var nan = global.NaN;
var infinity = global.Infinity;
- var f = 2882400175;
+ var f = -1412567121;
var f$hi = 305419896;
function call($0, $0$hi) {
- $0 = $0 | 0;
- $0$hi = $0$hi | 0;
+
}
function $1() {
var i64toi32_i32$0 = 0;
i64toi32_i32$0 = f$hi;
- call(f | 0, i64toi32_i32$0 | 0);
+ call(f, i64toi32_i32$0);
i64toi32_i32$0 = 287454020;
f = 1432778632;
f$hi = i64toi32_i32$0;