From 363c2c7abd68847b4b226764160e2d3431dc3b54 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Thu, 1 Mar 2018 17:05:36 -0500 Subject: eliminate multiple return statements for wasm2asm functions (#1448) This change eliminates one issue that prevents asm.js validation of the generated code, see #1443. --- test/binaryen.js/emit_asmjs.js.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'test/binaryen.js') diff --git a/test/binaryen.js/emit_asmjs.js.txt b/test/binaryen.js/emit_asmjs.js.txt index 1dc266145..fc5f7aa32 100644 --- a/test/binaryen.js/emit_asmjs.js.txt +++ b/test/binaryen.js/emit_asmjs.js.txt @@ -14,9 +14,8 @@ function asmFunc(global, env, buffer) { var Math_clz32 = global.Math.clz32; function main($0) { $0 = $0 | 0; - var $1 = 0, wasm2asm_i32$0 = 0; + var $1 = 0; return $0 | 0; - return wasm2asm_i32$0 | 0; } function __wasm_ctz_i32(x) { @@ -46,17 +45,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 { -- cgit v1.2.3