diff options
author | Daniel Wirtz <dcode@dcode.io> | 2018-02-21 23:22:11 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2018-02-21 14:22:11 -0800 |
commit | 3f5ee87d262080265b65a3789392b399c91f30ad (patch) | |
tree | 131b31b939cb6f0608e470fcb6d933cb9bb5016c /test/wasm2asm.traps.js | |
parent | 5578bb58402fde2bb2c932bfa08ab71045854a41 (diff) | |
download | binaryen-3f5ee87d262080265b65a3789392b399c91f30ad.tar.gz binaryen-3f5ee87d262080265b65a3789392b399c91f30ad.tar.bz2 binaryen-3f5ee87d262080265b65a3789392b399c91f30ad.zip |
Improve name mangling of asm.js identifiers (#1433)
Also refactors mangling to its own file so it can be reused by generators and consumers, i.e., where it is important to know that an import must be named 'switch_' where it otherwise would be 'switch'.
* Update tests and JS dist files
Diffstat (limited to 'test/wasm2asm.traps.js')
-rw-r--r-- | test/wasm2asm.traps.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/test/wasm2asm.traps.js b/test/wasm2asm.traps.js index 52824341e..f7bb948c6 100644 --- a/test/wasm2asm.traps.js +++ b/test/wasm2asm.traps.js @@ -12,40 +12,40 @@ function asmFunc(global, env, buffer) { var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; var Math_clz32 = global.Math.clz32; - function $$0() { + function $0() { } - function $$1(x, y) { + function $1(x, y) { x = x | 0; y = y | 0; - var $$2 = 0, $$3 = 0, $$4 = 0, wasm2asm_i32$0 = 0; + var $2 = 0, $3 = 0, $4 = 0, wasm2asm_i32$0 = 0; return x + y | 0 | 0; return wasm2asm_i32$0 | 0; } - function $$2(x, y) { + function $2(x, y) { x = x | 0; y = y | 0; - var $$2 = 0, $$3 = 0, $$4 = 0, wasm2asm_i32$0 = 0; + var $2 = 0, $3 = 0, $4 = 0, wasm2asm_i32$0 = 0; return (x | 0) / (y | 0) | 0 | 0; return wasm2asm_i32$0 | 0; } function __wasm_ctz_i32(x) { x = x | 0; - var $$1 = 0, $$2 = 0, $$3 = 0, $$4 = 0, $$5 = 0, $$6 = 0, $$7 = 0, $$8 = 0, $$9 = 0, $$10 = 0; - if ((x | 0) == (0 | 0)) $$9 = 32; else $$9 = 31 - Math_clz32(x ^ (x - 1 | 0) | 0) | 0; - return $$9 | 0; + var $1 = 0, $2 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0; + if ((x | 0) == (0 | 0)) $9 = 32; else $9 = 31 - Math_clz32(x ^ (x - 1 | 0) | 0) | 0; + return $9 | 0; } function __wasm_popcnt_i32(x) { x = x | 0; - var count = 0, $$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; + var count = 0, $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; count = 0; b : { l : do { - $$5 = count; + $5 = count; if ((x | 0) == (0 | 0)) break b; x = x & (x - 1 | 0) | 0; count = count + 1 | 0; @@ -53,13 +53,13 @@ function asmFunc(global, env, buffer) { break l; } while (1); }; - return $$5 | 0; + return $5 | 0; } 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, wasm2asm_i32$0 = 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; } @@ -67,15 +67,15 @@ function asmFunc(global, env, buffer) { 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, wasm2asm_i32$0 = 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 { - empty: $$0, - add: $$1, - div_s: $$2 + empty: $0, + add: $1, + div_s: $2 }; } |