From c3ed0f176b36a502ef2e1fd915550a808b8d8f0b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 24 Apr 2019 15:27:05 -0700 Subject: 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. --- test/wasm2js/nested-selects.2asm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/wasm2js/nested-selects.2asm.js') diff --git a/test/wasm2js/nested-selects.2asm.js b/test/wasm2js/nested-selects.2asm.js index ac5b7a488..b0fd8fed0 100644 --- a/test/wasm2js/nested-selects.2asm.js +++ b/test/wasm2js/nested-selects.2asm.js @@ -24,7 +24,7 @@ function asmFunc(global, env, buffer) { function $1($0) { $0 = $0 | 0; var wasm2js_i32$0 = 0, wasm2js_i32$1 = 0, wasm2js_i32$2 = 0, wasm2js_i32$3 = 0, wasm2js_i32$4 = 0, wasm2js_i32$5 = 0; - return (wasm2js_i32$0 = 4294967295, wasm2js_i32$1 = (wasm2js_i32$3 = 1, wasm2js_i32$4 = 0, wasm2js_i32$5 = ($0 | 0) > (0 | 0), wasm2js_i32$5 ? wasm2js_i32$3 : wasm2js_i32$4), wasm2js_i32$2 = ($0 | 0) < (0 | 0), wasm2js_i32$2 ? wasm2js_i32$0 : wasm2js_i32$1) | 0; + return (wasm2js_i32$0 = -1, wasm2js_i32$1 = (wasm2js_i32$3 = 1, wasm2js_i32$4 = 0, wasm2js_i32$5 = ($0 | 0) > (0 | 0), wasm2js_i32$5 ? wasm2js_i32$3 : wasm2js_i32$4), wasm2js_i32$2 = ($0 | 0) < (0 | 0), wasm2js_i32$2 ? wasm2js_i32$0 : wasm2js_i32$1) | 0; } var FUNCTION_TABLE = []; -- cgit v1.2.3