From 1c495c377dc9e3234dcd4fc4527c68359999d934 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 11 Oct 2020 15:50:51 +0300 Subject: [PATCH 1/9] init --- src/module.ts | 6 +- tests/compiler/std/array.optimized.wat | 12 +- .../std/string-casemapping.optimized.wat | 92 +- tests/compiler/std/string.optimized.wat | 369 +- tests/compiler/std/typedarray.optimized.wat | 6533 ++++++++--------- 5 files changed, 3502 insertions(+), 3510 deletions(-) diff --git a/src/module.ts b/src/module.ts index e841e8c8f7..4a33e71204 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1581,9 +1581,6 @@ export class Module { passes.push("merge-locals"); } passes.push("vacuum"); - if (optimizeLevel >= 3 || shrinkLevel >= 1) { - passes.push("code-folding"); - } if (optimizeLevel >= 2 || shrinkLevel >= 1) { passes.push("simplify-globals-optimizing"); } @@ -1622,6 +1619,9 @@ export class Module { passes.push("simplify-globals"); passes.push("vacuum"); } + if (optimizeLevel >= 3 || shrinkLevel >= 1) { + passes.push("code-folding"); + } // precompute works best after global optimizations if (optimizeLevel >= 2 || shrinkLevel >= 1) { passes.push("precompute-propagate"); diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 704f2e5f94..aff0dd6eae 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -5648,10 +5648,10 @@ (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $4 block $folding-inner0 + local.get $1 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 i32.load offset=12 local.tee $2 @@ -18846,10 +18846,10 @@ (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $4 block $folding-inner0 + local.get $1 + call $~lib/rt/pure/__retain + local.set $4 local.get $0 i32.load offset=12 local.tee $2 diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index 877130baff..22f43d800f 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -1376,53 +1376,53 @@ (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 8 - i32.shr_u - local.tee $2 - i32.const 5672 - i32.add - i32.load8_u - local.get $2 - i32.const 2032 - i32.add - i32.load8_u - i32.const 86 - i32.mul - i32.const 2032 - i32.add - local.get $0 - i32.const 255 - i32.and - local.tee $5 - i32.const 3 - i32.div_u - i32.add - i32.load8_u - local.get $5 - i32.const 3 - i32.rem_u - i32.const 2 - i32.shl - i32.const 4700 - i32.add - i32.load - i32.mul - i32.const 11 - i32.shr_u - i32.const 6 - i32.rem_u - i32.add - i32.const 2 - i32.shl - i32.const 4712 - i32.add - i32.load - local.tee $2 - i32.const 8 - i32.shr_s - local.set $3 block $folding-inner0 + local.get $0 + i32.const 8 + i32.shr_u + local.tee $2 + i32.const 5672 + i32.add + i32.load8_u + local.get $2 + i32.const 2032 + i32.add + i32.load8_u + i32.const 86 + i32.mul + i32.const 2032 + i32.add + local.get $0 + i32.const 255 + i32.and + local.tee $5 + i32.const 3 + i32.div_u + i32.add + i32.load8_u + local.get $5 + i32.const 3 + i32.rem_u + i32.const 2 + i32.shl + i32.const 4700 + i32.add + i32.load + i32.mul + i32.const 11 + i32.shr_u + i32.const 6 + i32.rem_u + i32.add + i32.const 2 + i32.shl + i32.const 4712 + i32.add + i32.load + local.tee $2 + i32.const 8 + i32.shr_s + local.set $3 local.get $2 i32.const 255 i32.and diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 258a9fc2f4..d9cb82d7d9 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -4488,13 +4488,13 @@ (local $6 i32) (local $7 i32) (local $8 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 block $folding-inner0 + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 local.get $0 call $~lib/string/String#get:length local.tee $3 @@ -4770,13 +4770,13 @@ (local $8 i32) (local $9 i32) (local $10 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $7 - local.get $2 - call $~lib/rt/pure/__retain - local.set $5 block $folding-inner0 + local.get $1 + call $~lib/rt/pure/__retain + local.set $7 + local.get $2 + call $~lib/rt/pure/__retain + local.set $5 local.get $0 call $~lib/string/String#get:length local.tee $4 @@ -5558,223 +5558,218 @@ (local $8 i32) (local $9 i32) (local $10 i32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - block $folding-inner0 - local.get $2 - i32.eqz - br_if $folding-inner0 + block $folding-inner1 local.get $1 - i32.eqz - if - i32.const 1 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.tee $2 - i32.load offset=4 - local.get $0 - call $~lib/rt/pure/__retain - i32.store - local.get $1 - call $~lib/rt/pure/__release + call $~lib/rt/pure/__retain + local.set $1 + block $folding-inner0 local.get $2 - return - end - local.get $0 - call $~lib/string/String#get:length - local.set $4 - i32.const 2147483647 - local.get $2 - local.get $2 - i32.const 0 - i32.lt_s - select - local.set $2 - local.get $1 - call $~lib/string/String#get:length - local.tee $6 - if - local.get $4 + i32.eqz + br_if $folding-inner0 + local.get $1 i32.eqz if i32.const 1 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $0 + local.tee $2 i32.load offset=4 - i32.const 1280 + local.get $0 + call $~lib/rt/pure/__retain i32.store local.get $1 call $~lib/rt/pure/__release - local.get $0 + local.get $2 return end - else - local.get $4 - i32.eqz - br_if $folding-inner0 - local.get $4 + local.get $0 + call $~lib/string/String#get:length + local.set $4 + i32.const 2147483647 local.get $2 - local.get $4 local.get $2 + i32.const 0 i32.lt_s select - local.tee $5 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.tee $4 - i32.load offset=4 - local.set $6 - loop $for-loop|0 - local.get $3 - local.get $5 - i32.lt_s + local.set $2 + local.get $1 + call $~lib/string/String#get:length + local.tee $6 + if + local.get $4 + i32.eqz if - i32.const 2 i32.const 1 - call $~lib/rt/tlsf/__alloc - local.tee $2 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + i32.load offset=4 + i32.const 1280 + i32.store + local.get $1 + call $~lib/rt/pure/__release local.get $0 + return + end + else + local.get $4 + i32.eqz + br_if $folding-inner0 + local.get $4 + local.get $2 + local.get $4 + local.get $2 + i32.lt_s + select + local.tee $5 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $4 + i32.load offset=4 + local.set $6 + loop $for-loop|0 local.get $3 + local.get $5 + i32.lt_s + if + i32.const 2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $2 + local.get $0 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $6 + local.get $3 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store + local.get $2 + call $~lib/rt/pure/__retain + drop + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $for-loop|0 + end + end + local.get $1 + call $~lib/rt/pure/__release + local.get $4 + return + end + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $3 + loop $while-continue|1 + local.get $0 + local.get $1 + local.get $5 + call $~lib/string/String#indexOf + local.tee $8 + i32.const -1 + i32.xor + if + local.get $8 + local.get $5 + i32.sub + local.tee $7 + i32.const 0 + i32.gt_s + if + local.get $7 + i32.const 1 + i32.shl + local.tee $7 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $9 + local.get $0 + local.get $5 + i32.const 1 + i32.shl + i32.add + local.get $7 + call $~lib/memory/memory.copy + local.get $3 + local.get $9 + call $~lib/array/Array<~lib/string/String>#push + else + local.get $3 + i32.const 1280 + call $~lib/array/Array<~lib/string/String>#push + end + local.get $2 + local.get $10 i32.const 1 - i32.shl i32.add - i32.load16_u - i32.store16 + local.tee $10 + i32.eq + br_if $folding-inner1 local.get $6 - local.get $3 - i32.const 2 - i32.shl - i32.add - local.get $2 - i32.store - local.get $2 - call $~lib/rt/pure/__retain - drop - local.get $3 - i32.const 1 + local.get $8 i32.add - local.set $3 - br $for-loop|0 + local.set $5 + br $while-continue|1 end end - local.get $1 - call $~lib/rt/pure/__release + local.get $5 + i32.eqz + if + local.get $3 + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + br $folding-inner1 + end local.get $4 - return - end - i32.const 0 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.set $3 - loop $while-continue|1 - local.get $0 - local.get $1 local.get $5 - call $~lib/string/String#indexOf - local.tee $8 - i32.const -1 - i32.xor + i32.sub + local.tee $2 + i32.const 0 + i32.gt_s if - local.get $8 - local.get $5 - i32.sub - local.tee $7 - i32.const 0 - i32.gt_s - if - local.get $7 - i32.const 1 - i32.shl - local.tee $7 - i32.const 1 - call $~lib/rt/tlsf/__alloc - local.tee $9 - local.get $0 - local.get $5 - i32.const 1 - i32.shl - i32.add - local.get $7 - call $~lib/memory/memory.copy - local.get $3 - local.get $9 - call $~lib/array/Array<~lib/string/String>#push - else - local.get $3 - i32.const 1280 - call $~lib/array/Array<~lib/string/String>#push - end local.get $2 - local.get $10 i32.const 1 + i32.shl + local.tee $2 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $4 + local.get $0 + local.get $5 + i32.const 1 + i32.shl i32.add - local.tee $10 - i32.eq - if - local.get $1 - call $~lib/rt/pure/__release - local.get $3 - return - end - local.get $6 - local.get $8 - i32.add - local.set $5 - br $while-continue|1 + local.get $2 + call $~lib/memory/memory.copy + local.get $3 + local.get $4 + call $~lib/array/Array<~lib/string/String>#push + else + local.get $3 + i32.const 1280 + call $~lib/array/Array<~lib/string/String>#push end + br $folding-inner1 end - local.get $5 - i32.eqz - if - local.get $3 - local.get $0 - call $~lib/array/Array<~lib/string/String>#push - local.get $1 - call $~lib/rt/pure/__release - local.get $3 - return - end - local.get $4 - local.get $5 - i32.sub - local.tee $2 i32.const 0 - i32.gt_s - if - local.get $2 - i32.const 1 - i32.shl - local.tee $2 - i32.const 1 - call $~lib/rt/tlsf/__alloc - local.tee $4 - local.get $0 - local.get $5 - i32.const 1 - i32.shl - i32.add - local.get $2 - call $~lib/memory/memory.copy - local.get $3 - local.get $4 - call $~lib/array/Array<~lib/string/String>#push - else - local.get $3 - i32.const 1280 - call $~lib/array/Array<~lib/string/String>#push - end + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain local.get $1 call $~lib/rt/pure/__release - local.get $3 return end - i32.const 0 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain local.get $1 call $~lib/rt/pure/__release + local.get $3 ) (func $~lib/array/Array<~lib/string/String>#__get (param $0 i32) (param $1 i32) (result i32) local.get $1 diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index b8b8591ed0..5294e75c64 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -31817,28 +31817,28 @@ call $~lib/rt/pure/__release i32.const 2704 call $~lib/rt/pure/__release - block $folding-inner18 - block $folding-inner0 - block $folding-inner17 - block $folding-inner16 - block $folding-inner13 - block $folding-inner12 - block $folding-inner11 - block $folding-inner10 - block $folding-inner9 - block $folding-inner8 - block $folding-inner7 - block $folding-inner6 - block $folding-inner5 - block $folding-inner4 - block $folding-inner3 - block $folding-inner2 + block $folding-inner17 + block $folding-inner16 + block $folding-inner15 + block $folding-inner14 + block $folding-inner11 + block $folding-inner10 + block $folding-inner9 + block $folding-inner8 + block $folding-inner7 + block $folding-inner6 + block $folding-inner5 + block $folding-inner4 + block $folding-inner3 + block $folding-inner2 + block $folding-inner1 + block $folding-inner0 local.get $3 i32.const 255 i32.and i32.const 6 i32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $6 call $~lib/rt/pure/__release local.get $1 @@ -31866,7 +31866,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -31894,7 +31894,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -31973,7 +31973,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $6 call $~lib/rt/pure/__release local.get $1 @@ -32052,7 +32052,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $6 call $~lib/rt/pure/__release local.get $1 @@ -32078,7 +32078,7 @@ call $~lib/typedarray/Int32Array#reduce i32.const 6 i32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -32104,7 +32104,7 @@ call $~lib/typedarray/Int32Array#reduce i32.const 6 i32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -32130,7 +32130,7 @@ call $~lib/typedarray/Int64Array#reduce i64.const 6 i64.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -32156,7 +32156,7 @@ call $~lib/typedarray/Int64Array#reduce i64.const 6 i64.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -32231,7 +32231,7 @@ local.get $9 f32.const 6 f32.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $5 call $~lib/rt/pure/__release local.get $1 @@ -32306,7 +32306,7 @@ local.get $10 f64.const 6 f64.ne - br_if $folding-inner2 + br_if $folding-inner0 local.get $5 call $~lib/rt/pure/__release local.get $1 @@ -32381,7 +32381,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner3 + br_if $folding-inner1 local.get $6 call $~lib/rt/pure/__release local.get $1 @@ -32409,7 +32409,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner3 + br_if $folding-inner1 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -32437,7 +32437,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner3 + br_if $folding-inner1 local.get $1 call $~lib/rt/pure/__release local.get $0 @@ -32516,7 +32516,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner3 + br_if $folding-inner1 local.get $6 call $~lib/rt/pure/__release local.get $1 @@ -32595,7 +32595,7 @@ i32.and i32.const 6 i32.ne - br_if $folding-inner3 + br_if $folding-inner1 local.get $6 call $~lib/rt/pure/__release local.get $1 @@ -32616,3301 +32616,3298 @@ i32.const 2 i32.const 3 call $~lib/typedarray/Int32Array#__set - block $folding-inner1 - local.get $0 - i32.const 3216 - call $~lib/typedarray/Int32Array#reduceRight - i32.const 6 - i32.ne - br_if $folding-inner1 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 3248 - call $~lib/typedarray/Int32Array#reduceRight - i32.const 6 - i32.ne - br_if $folding-inner1 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 1 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 3280 - call $~lib/typedarray/Int64Array#reduceRight - i64.const 6 - i64.ne - br_if $folding-inner1 - local.get $1 - call $~lib/rt/pure/__release + local.get $0 + i32.const 3216 + call $~lib/typedarray/Int32Array#reduceRight + i32.const 6 + i32.ne + br_if $folding-inner1 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 3248 + call $~lib/typedarray/Int32Array#reduceRight + i32.const 6 + i32.ne + br_if $folding-inner1 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 3280 + call $~lib/typedarray/Int64Array#reduceRight + i64.const 6 + i64.ne + br_if $folding-inner1 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 3312 + call $~lib/typedarray/Int64Array#reduceRight + i64.const 6 + i64.ne + br_if $folding-inner1 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.tee $1 + i32.const 0 + f32.const 1 + call $~lib/typedarray/Float32Array#__set + local.get $1 + i32.const 1 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $1 + i32.const 2 + f32.const 3 + call $~lib/typedarray/Float32Array#__set + f32.const 0 + local.set $9 + local.get $1 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 3344 + call $~lib/rt/pure/__retain + local.set $4 + local.get $2 + i32.load offset=4 + local.set $6 + local.get $2 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.const 1 + i32.sub + local.set $0 + loop $for-loop|07 local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 i32.const 0 - i64.const 1 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 3312 - call $~lib/typedarray/Int64Array#reduceRight - i64.const 6 - i64.ne - br_if $folding-inner1 - local.get $1 - call $~lib/rt/pure/__release + i32.ge_s + if + local.get $6 + local.get $0 + i32.const 2 + i32.shl + i32.add + f32.load + local.set $12 + i32.const 4 + global.set $~argumentsLength + local.get $9 + local.get $12 + local.get $0 + local.get $2 + local.get $4 + i32.load + call_indirect (type $f32_f32_i32_i32_=>_f32) + local.set $9 + local.get $0 + i32.const 1 + i32.sub + local.set $0 + br $for-loop|07 + end + end + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 3344 + call $~lib/rt/pure/__release + local.get $9 + f32.const 6 + f32.ne + br_if $folding-inner1 + local.get $5 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.tee $1 + i32.const 0 + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $1 + i32.const 1 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $1 + i32.const 2 + f64.const 3 + call $~lib/typedarray/Float64Array#__set + f64.const 0 + local.set $10 + local.get $1 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 3376 + call $~lib/rt/pure/__retain + local.set $4 + local.get $2 + i32.load offset=4 + local.set $6 + local.get $2 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.const 1 + i32.sub + local.set $0 + loop $for-loop|08 local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.tee $5 - call $~lib/rt/pure/__retain - local.tee $1 i32.const 0 - f32.const 1 - call $~lib/typedarray/Float32Array#__set - local.get $1 - i32.const 1 - f32.const 2 - call $~lib/typedarray/Float32Array#__set - local.get $1 - i32.const 2 - f32.const 3 - call $~lib/typedarray/Float32Array#__set - f32.const 0 - local.set $9 - local.get $1 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 3344 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - i32.load offset=4 - local.set $6 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.const 1 - i32.sub - local.set $0 - loop $for-loop|07 + i32.ge_s + if + local.get $6 local.get $0 - i32.const 0 - i32.ge_s - if - local.get $6 - local.get $0 - i32.const 2 - i32.shl - i32.add - f32.load - local.set $12 - i32.const 4 - global.set $~argumentsLength - local.get $9 - local.get $12 - local.get $0 - local.get $2 - local.get $4 - i32.load - call_indirect (type $f32_f32_i32_i32_=>_f32) - local.set $9 - local.get $0 - i32.const 1 - i32.sub - local.set $0 - br $for-loop|07 - end - end - local.get $4 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - i32.const 3344 - call $~lib/rt/pure/__release - local.get $9 - f32.const 6 - f32.ne - br_if $folding-inner1 - local.get $5 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.tee $5 - call $~lib/rt/pure/__retain - local.tee $1 - i32.const 0 - f64.const 1 - call $~lib/typedarray/Float64Array#__set - local.get $1 - i32.const 1 - f64.const 2 - call $~lib/typedarray/Float64Array#__set - local.get $1 - i32.const 2 - f64.const 3 - call $~lib/typedarray/Float64Array#__set - f64.const 0 - local.set $10 - local.get $1 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 3376 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - i32.load offset=4 - local.set $6 - local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.const 1 - i32.sub - local.set $0 - loop $for-loop|08 + i32.const 3 + i32.shl + i32.add + f64.load + local.set $13 + i32.const 4 + global.set $~argumentsLength + local.get $10 + local.get $13 local.get $0 - i32.const 0 - i32.ge_s - if - local.get $6 - local.get $0 - i32.const 3 - i32.shl - i32.add - f64.load - local.set $13 - i32.const 4 - global.set $~argumentsLength - local.get $10 - local.get $13 - local.get $0 - local.get $2 - local.get $4 - i32.load - call_indirect (type $f64_f64_i32_i32_=>_f64) - local.set $10 - local.get $0 - i32.const 1 - i32.sub - local.set $0 - br $for-loop|08 - end + local.get $2 + local.get $4 + i32.load + call_indirect (type $f64_f64_i32_i32_=>_f64) + local.set $10 + local.get $0 + i32.const 1 + i32.sub + local.set $0 + br $for-loop|08 end - local.get $4 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - i32.const 3376 - call $~lib/rt/pure/__release - local.get $10 - f64.const 6 - f64.ne - br_if $folding-inner1 - local.get $5 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int8Array#__set - local.get $0 - call $~lib/typedarray/Int8Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Int8Array#__get - i32.const 1 - i32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Int8Array#__get - i32.const 4 - i32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Int8Array#__get - i32.const 9 - i32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - call $~lib/typedarray/Uint8Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Uint8Array#__get - i32.const 1 - i32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Uint8Array#__get - i32.const 4 - i32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Uint8Array#__get - i32.const 9 - i32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - call $~lib/typedarray/Uint8ClampedArray#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Uint8ClampedArray#__get - i32.const 1 - i32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__get - i32.const 4 - i32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__get - i32.const 9 - i32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int16Array#__set - local.get $0 - call $~lib/typedarray/Int16Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Int16Array#__get - i32.const 1 - i32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Int16Array#__get - i32.const 4 - i32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Int16Array#__get - i32.const 9 - i32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - call $~lib/typedarray/Uint16Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Uint16Array#__get - i32.const 1 - i32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Uint16Array#__get - i32.const 4 - i32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Uint16Array#__get - i32.const 9 - i32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int32Array#__set - local.get $0 - call $~lib/typedarray/Int32Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Int32Array#__get - i32.const 1 - i32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Int32Array#__get - i32.const 4 - i32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Int32Array#__get - i32.const 9 - i32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - call $~lib/typedarray/Uint32Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Uint32Array#__get - i32.const 1 - i32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Uint32Array#__get - i32.const 4 - i32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Uint32Array#__get - i32.const 9 - i32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 1 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Int64Array#__set - local.get $0 - call $~lib/typedarray/Int64Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Int64Array#__get - i64.const 1 - i64.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Int64Array#__get - i64.const 4 - i64.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Int64Array#__get - i64.const 9 - i64.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 1 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - call $~lib/typedarray/Uint64Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Uint64Array#__get - i64.const 1 - i64.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Uint64Array#__get - i64.const 4 - i64.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Uint64Array#__get - i64.const 9 - i64.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f32.const 1 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 1 - f32.const 2 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 2 - f32.const 3 - call $~lib/typedarray/Float32Array#__set - local.get $0 - call $~lib/typedarray/Float32Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Float32Array#__get - f32.const 1 - f32.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Float32Array#__get - f32.const 4 - f32.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Float32Array#__get - f32.const 9 - f32.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.tee $2 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f64.const 1 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 1 - f64.const 2 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 2 - f64.const 3 - call $~lib/typedarray/Float64Array#__set - local.get $0 - call $~lib/typedarray/Float64Array#map - local.tee $1 - i32.const 0 - call $~lib/typedarray/Float64Array#__get - f64.const 1 - f64.ne - br_if $folding-inner4 - local.get $1 - i32.const 1 - call $~lib/typedarray/Float64Array#__get - f64.const 4 - f64.ne - br_if $folding-inner5 - local.get $1 - i32.const 2 - call $~lib/typedarray/Float64Array#__get - f64.const 9 - f64.ne - br_if $folding-inner6 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - call $std/typedarray/testArrayFilter<~lib/typedarray/Int8Array,i8> - call $std/typedarray/testArrayFilter<~lib/typedarray/Uint8Array,u8> - call $std/typedarray/testArrayFilter<~lib/typedarray/Uint8ClampedArray,u8> - call $std/typedarray/testArrayFilter<~lib/typedarray/Int16Array,i16> - call $std/typedarray/testArrayFilter<~lib/typedarray/Uint16Array,u16> - call $std/typedarray/testArrayFilter<~lib/typedarray/Int32Array,i32> - call $std/typedarray/testArrayFilter<~lib/typedarray/Uint32Array,u32> - call $std/typedarray/testArrayFilter<~lib/typedarray/Int64Array,i64> - call $std/typedarray/testArrayFilter<~lib/typedarray/Uint64Array,u64> - call $std/typedarray/testArrayFilter<~lib/typedarray/Float32Array,f32> - call $std/typedarray/testArrayFilter<~lib/typedarray/Float64Array,f64> - i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 4112 - call $~lib/typedarray/Int8Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4144 - call $~lib/typedarray/Int8Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 4176 - call $~lib/typedarray/Uint8Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4208 - call $~lib/typedarray/Uint8Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 4240 - call $~lib/typedarray/Uint8Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4272 - call $~lib/typedarray/Uint8Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 4304 - call $~lib/typedarray/Int16Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4336 - call $~lib/typedarray/Int16Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 4368 - call $~lib/typedarray/Uint16Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4400 - call $~lib/typedarray/Uint16Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 4432 - call $~lib/typedarray/Int32Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4464 - call $~lib/typedarray/Int32Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 4496 - call $~lib/typedarray/Int32Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4528 - call $~lib/typedarray/Int32Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 2 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 1 - i64.const 4 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 2 - i64.const 6 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 4560 - call $~lib/typedarray/Int64Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4592 - call $~lib/typedarray/Int64Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 2 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 1 - i64.const 4 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 2 - i64.const 6 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 4624 - call $~lib/typedarray/Int64Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4656 - call $~lib/typedarray/Int64Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f32.const 2 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 1 - f32.const 4 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 2 - f32.const 6 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 4688 - call $~lib/typedarray/Float32Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4720 - call $~lib/typedarray/Float32Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f64.const 2 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 1 - f64.const 4 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 2 - f64.const 6 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 4752 - call $~lib/typedarray/Float64Array#some - i32.eqz - br_if $folding-inner7 - local.get $0 - i32.const 4784 - call $~lib/typedarray/Float64Array#some - br_if $folding-inner8 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 4816 - call $~lib/typedarray/Int8Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 4848 - call $~lib/typedarray/Int8Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 4880 - call $~lib/typedarray/Uint8Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 4912 - call $~lib/typedarray/Uint8Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 4944 - call $~lib/typedarray/Uint8Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 4976 - call $~lib/typedarray/Uint8Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 5008 - call $~lib/typedarray/Int16Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5040 - call $~lib/typedarray/Int16Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 5072 - call $~lib/typedarray/Uint16Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5104 - call $~lib/typedarray/Uint16Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 5136 - call $~lib/typedarray/Int32Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5168 - call $~lib/typedarray/Int32Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 5200 - call $~lib/typedarray/Int32Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5232 - call $~lib/typedarray/Int32Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 1 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 5264 - call $~lib/typedarray/Int64Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5296 - call $~lib/typedarray/Int64Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 1 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 5328 - call $~lib/typedarray/Int64Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5360 - call $~lib/typedarray/Int64Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f32.const 1 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 1 - f32.const 2 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 2 - f32.const 3 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 5392 - call $~lib/typedarray/Float32Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5424 - call $~lib/typedarray/Float32Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f64.const 1 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 1 - f64.const 2 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 2 - f64.const 3 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 5456 - call $~lib/typedarray/Float64Array#findIndex - i32.const 1 - i32.ne - br_if $folding-inner9 - local.get $0 - i32.const 5488 - call $~lib/typedarray/Float64Array#findIndex - i32.const -1 - i32.ne - br_if $folding-inner10 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 5520 - call $~lib/typedarray/Int8Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 5552 - call $~lib/typedarray/Int8Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 5584 - call $~lib/typedarray/Uint8Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 5616 - call $~lib/typedarray/Uint8Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 5648 - call $~lib/typedarray/Uint8Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 5680 - call $~lib/typedarray/Uint8Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 5712 - call $~lib/typedarray/Int16Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 5744 - call $~lib/typedarray/Int16Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 5776 - call $~lib/typedarray/Uint16Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 5808 - call $~lib/typedarray/Uint16Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 5840 - call $~lib/typedarray/Int32Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 5872 - call $~lib/typedarray/Int32Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 2 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 1 - i32.const 4 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 2 - i32.const 6 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 5904 - call $~lib/typedarray/Int32Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 5936 - call $~lib/typedarray/Int32Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 2 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 1 - i64.const 4 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 2 - i64.const 6 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 5968 - call $~lib/typedarray/Int64Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 6000 - call $~lib/typedarray/Int64Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 2 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 1 - i64.const 4 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 2 - i64.const 6 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 6032 - call $~lib/typedarray/Int64Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 6064 - call $~lib/typedarray/Int64Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f32.const 2 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 1 - f32.const 4 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 2 - f32.const 6 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 6096 - call $~lib/typedarray/Float32Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 6128 - call $~lib/typedarray/Float32Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - f64.const 2 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 1 - f64.const 4 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 2 - f64.const 6 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 6160 - call $~lib/typedarray/Float64Array#every - i32.eqz - br_if $folding-inner11 - local.get $0 - i32.const 6192 - call $~lib/typedarray/Float64Array#every - br_if $folding-inner12 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int8Array#constructor - local.tee $5 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/typedarray/Int8Array#__set - i32.const 0 - local.set $1 - local.get $0 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 6288 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - i32.load offset=4 - local.set $6 - local.get $2 - i32.load offset=8 - local.set $7 - loop $for-loop|09 - local.get $1 - local.get $7 - i32.lt_s - if - local.get $1 - local.get $6 - i32.add - i32.load8_s - i32.const 3 - global.set $~argumentsLength - local.get $1 - local.get $2 - local.get $4 - i32.load - call_indirect (type $i32_i32_i32_=>_none) - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|09 - end - end - local.get $4 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - i32.const 6288 - call $~lib/rt/pure/__release - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Uint8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 6320 - call $~lib/typedarray/Uint8Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - i32.const 255 - i32.and - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 6352 - call $~lib/typedarray/Uint8Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int16Array#constructor - local.tee $5 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/typedarray/Int16Array#__set - i32.const 0 - local.set $1 - local.get $0 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 6384 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - i32.load offset=4 - local.set $6 - local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $7 - loop $for-loop|010 - local.get $1 - local.get $7 - i32.lt_s - if - local.get $6 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.load16_s - i32.const 3 - global.set $~argumentsLength - local.get $1 - local.get $2 - local.get $4 - i32.load - call_indirect (type $i32_i32_i32_=>_none) - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|010 - end - end - local.get $4 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - i32.const 6384 - call $~lib/rt/pure/__release - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Uint16Array#constructor - local.tee $5 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - i32.const 65535 - i32.and - call $~lib/typedarray/Uint16Array#__set - i32.const 0 - local.set $1 - local.get $0 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 6416 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - i32.load offset=4 - local.set $6 - local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $7 - loop $for-loop|011 + end + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 3376 + call $~lib/rt/pure/__release + local.get $10 + f64.const 6 + f64.ne + br_if $folding-inner1 + local.get $5 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $0 + call $~lib/typedarray/Int8Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Int8Array#__get + i32.const 1 + i32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Int8Array#__get + i32.const 4 + i32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Int8Array#__get + i32.const 9 + i32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + call $~lib/typedarray/Uint8Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Uint8Array#__get + i32.const 1 + i32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Uint8Array#__get + i32.const 4 + i32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Uint8Array#__get + i32.const 9 + i32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + call $~lib/typedarray/Uint8ClampedArray#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 1 + i32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 4 + i32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__get + i32.const 9 + i32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int16Array#__set + local.get $0 + call $~lib/typedarray/Int16Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Int16Array#__get + i32.const 1 + i32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Int16Array#__get + i32.const 4 + i32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Int16Array#__get + i32.const 9 + i32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + call $~lib/typedarray/Uint16Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Uint16Array#__get + i32.const 1 + i32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Uint16Array#__get + i32.const 4 + i32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Uint16Array#__get + i32.const 9 + i32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int32Array#__set + local.get $0 + call $~lib/typedarray/Int32Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Int32Array#__get + i32.const 1 + i32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Int32Array#__get + i32.const 4 + i32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Int32Array#__get + i32.const 9 + i32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + call $~lib/typedarray/Uint32Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Uint32Array#__get + i32.const 1 + i32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Uint32Array#__get + i32.const 4 + i32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Uint32Array#__get + i32.const 9 + i32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Int64Array#__set + local.get $0 + call $~lib/typedarray/Int64Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Int64Array#__get + i64.const 1 + i64.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Int64Array#__get + i64.const 4 + i64.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Int64Array#__get + i64.const 9 + i64.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + call $~lib/typedarray/Uint64Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Uint64Array#__get + i64.const 1 + i64.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Uint64Array#__get + i64.const 4 + i64.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Uint64Array#__get + i64.const 9 + i64.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f32.const 1 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 1 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 2 + f32.const 3 + call $~lib/typedarray/Float32Array#__set + local.get $0 + call $~lib/typedarray/Float32Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Float32Array#__get + f32.const 1 + f32.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Float32Array#__get + f32.const 4 + f32.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Float32Array#__get + f32.const 9 + f32.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $2 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 1 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + f64.const 3 + call $~lib/typedarray/Float64Array#__set + local.get $0 + call $~lib/typedarray/Float64Array#map + local.tee $1 + i32.const 0 + call $~lib/typedarray/Float64Array#__get + f64.const 1 + f64.ne + br_if $folding-inner2 + local.get $1 + i32.const 1 + call $~lib/typedarray/Float64Array#__get + f64.const 4 + f64.ne + br_if $folding-inner3 + local.get $1 + i32.const 2 + call $~lib/typedarray/Float64Array#__get + f64.const 9 + f64.ne + br_if $folding-inner4 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + call $std/typedarray/testArrayFilter<~lib/typedarray/Int8Array,i8> + call $std/typedarray/testArrayFilter<~lib/typedarray/Uint8Array,u8> + call $std/typedarray/testArrayFilter<~lib/typedarray/Uint8ClampedArray,u8> + call $std/typedarray/testArrayFilter<~lib/typedarray/Int16Array,i16> + call $std/typedarray/testArrayFilter<~lib/typedarray/Uint16Array,u16> + call $std/typedarray/testArrayFilter<~lib/typedarray/Int32Array,i32> + call $std/typedarray/testArrayFilter<~lib/typedarray/Uint32Array,u32> + call $std/typedarray/testArrayFilter<~lib/typedarray/Int64Array,i64> + call $std/typedarray/testArrayFilter<~lib/typedarray/Uint64Array,u64> + call $std/typedarray/testArrayFilter<~lib/typedarray/Float32Array,f32> + call $std/typedarray/testArrayFilter<~lib/typedarray/Float64Array,f64> + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 4112 + call $~lib/typedarray/Int8Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4144 + call $~lib/typedarray/Int8Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 4176 + call $~lib/typedarray/Uint8Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4208 + call $~lib/typedarray/Uint8Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 4240 + call $~lib/typedarray/Uint8Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4272 + call $~lib/typedarray/Uint8Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 4304 + call $~lib/typedarray/Int16Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4336 + call $~lib/typedarray/Int16Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 4368 + call $~lib/typedarray/Uint16Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4400 + call $~lib/typedarray/Uint16Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 4432 + call $~lib/typedarray/Int32Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4464 + call $~lib/typedarray/Int32Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 4496 + call $~lib/typedarray/Int32Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4528 + call $~lib/typedarray/Int32Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 1 + i64.const 4 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 2 + i64.const 6 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 4560 + call $~lib/typedarray/Int64Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4592 + call $~lib/typedarray/Int64Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 1 + i64.const 4 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 2 + i64.const 6 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 4624 + call $~lib/typedarray/Int64Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4656 + call $~lib/typedarray/Int64Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 1 + f32.const 4 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 2 + f32.const 6 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 4688 + call $~lib/typedarray/Float32Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4720 + call $~lib/typedarray/Float32Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 1 + f64.const 4 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + f64.const 6 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 4752 + call $~lib/typedarray/Float64Array#some + i32.eqz + br_if $folding-inner5 + local.get $0 + i32.const 4784 + call $~lib/typedarray/Float64Array#some + br_if $folding-inner6 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 4816 + call $~lib/typedarray/Int8Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 4848 + call $~lib/typedarray/Int8Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 4880 + call $~lib/typedarray/Uint8Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 4912 + call $~lib/typedarray/Uint8Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 4944 + call $~lib/typedarray/Uint8Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 4976 + call $~lib/typedarray/Uint8Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 5008 + call $~lib/typedarray/Int16Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5040 + call $~lib/typedarray/Int16Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 5072 + call $~lib/typedarray/Uint16Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5104 + call $~lib/typedarray/Uint16Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 5136 + call $~lib/typedarray/Int32Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5168 + call $~lib/typedarray/Int32Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 5200 + call $~lib/typedarray/Int32Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5232 + call $~lib/typedarray/Int32Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 5264 + call $~lib/typedarray/Int64Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5296 + call $~lib/typedarray/Int64Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 5328 + call $~lib/typedarray/Int64Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5360 + call $~lib/typedarray/Int64Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f32.const 1 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 1 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 2 + f32.const 3 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 5392 + call $~lib/typedarray/Float32Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5424 + call $~lib/typedarray/Float32Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 1 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + f64.const 3 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 5456 + call $~lib/typedarray/Float64Array#findIndex + i32.const 1 + i32.ne + br_if $folding-inner7 + local.get $0 + i32.const 5488 + call $~lib/typedarray/Float64Array#findIndex + i32.const -1 + i32.ne + br_if $folding-inner8 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 5520 + call $~lib/typedarray/Int8Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 5552 + call $~lib/typedarray/Int8Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 5584 + call $~lib/typedarray/Uint8Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 5616 + call $~lib/typedarray/Uint8Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 5648 + call $~lib/typedarray/Uint8Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 5680 + call $~lib/typedarray/Uint8Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 5712 + call $~lib/typedarray/Int16Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 5744 + call $~lib/typedarray/Int16Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 5776 + call $~lib/typedarray/Uint16Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 5808 + call $~lib/typedarray/Uint16Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 5840 + call $~lib/typedarray/Int32Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 5872 + call $~lib/typedarray/Int32Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 2 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 1 + i32.const 4 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 2 + i32.const 6 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 5904 + call $~lib/typedarray/Int32Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 5936 + call $~lib/typedarray/Int32Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 1 + i64.const 4 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 2 + i64.const 6 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 5968 + call $~lib/typedarray/Int64Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 6000 + call $~lib/typedarray/Int64Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 1 + i64.const 4 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 2 + i64.const 6 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 6032 + call $~lib/typedarray/Int64Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 6064 + call $~lib/typedarray/Int64Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 1 + f32.const 4 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 2 + f32.const 6 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 6096 + call $~lib/typedarray/Float32Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 6128 + call $~lib/typedarray/Float32Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 1 + f64.const 4 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + f64.const 6 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 6160 + call $~lib/typedarray/Float64Array#every + i32.eqz + br_if $folding-inner9 + local.get $0 + i32.const 6192 + call $~lib/typedarray/Float64Array#every + br_if $folding-inner10 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/typedarray/Int8Array#__set + i32.const 0 + local.set $1 + local.get $0 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 6288 + call $~lib/rt/pure/__retain + local.set $4 + local.get $2 + i32.load offset=4 + local.set $6 + local.get $2 + i32.load offset=8 + local.set $7 + loop $for-loop|09 + local.get $1 + local.get $7 + i32.lt_s + if local.get $1 - local.get $7 - i32.lt_s - if - local.get $6 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.load16_u - i32.const 3 - global.set $~argumentsLength - local.get $1 - local.get $2 - local.get $4 - i32.load - call_indirect (type $i32_i32_i32_=>_none) - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|011 - end + local.get $6 + i32.add + i32.load8_s + i32.const 3 + global.set $~argumentsLength + local.get $1 + local.get $2 + local.get $4 + i32.load + call_indirect (type $i32_i32_i32_=>_none) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $for-loop|09 end - local.get $4 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - i32.const 6416 - call $~lib/rt/pure/__release - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 6448 - call $~lib/typedarray/Int32Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Uint32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 6480 - call $~lib/typedarray/Int32Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 6512 - call $~lib/typedarray/Int64Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Uint64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - i64.extend_i32_s - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 6544 - call $~lib/typedarray/Int64Array#forEach - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 + end + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 6288 + call $~lib/rt/pure/__release + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $5 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 6320 + call $~lib/typedarray/Uint8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 6352 + call $~lib/typedarray/Uint8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/typedarray/Int16Array#__set + i32.const 0 + local.set $1 + local.get $0 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 6384 + call $~lib/rt/pure/__retain + local.set $4 + local.get $2 + i32.load offset=4 + local.set $6 + local.get $2 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $7 + loop $for-loop|010 local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.tee $5 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - f32.convert_i32_s - call $~lib/typedarray/Float32Array#__set - i32.const 0 - local.set $1 - local.get $0 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 6576 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - i32.load offset=4 - local.set $6 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $7 - loop $for-loop|012 + local.get $7 + i32.lt_s + if + local.get $6 local.get $1 - local.get $7 - i32.lt_s - if - local.get $6 - local.get $1 - i32.const 2 - i32.shl - i32.add - f32.load - i32.const 3 - global.set $~argumentsLength - local.get $1 - local.get $2 - local.get $4 - i32.load - call_indirect (type $f32_i32_i32_=>_none) - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|012 - end + i32.const 1 + i32.shl + i32.add + i32.load16_s + i32.const 3 + global.set $~argumentsLength + local.get $1 + local.get $2 + local.get $4 + i32.load + call_indirect (type $i32_i32_i32_=>_none) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $for-loop|010 end - local.get $4 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - i32.const 6576 - call $~lib/rt/pure/__release - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 0 - global.set $std/typedarray/forEachCallCount - i32.const 3 - call $~lib/typedarray/Float64Array#constructor - local.tee $5 - call $~lib/rt/pure/__retain - local.tee $0 - global.set $std/typedarray/forEachSelf - local.get $0 - i32.const 0 - i32.const 6256 - i32.const 0 - call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 1 - i32.const 6256 - i32.const 1 - call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 2 - i32.const 6256 - i32.const 2 - call $~lib/array/Array#__get - f64.convert_i32_s - call $~lib/typedarray/Float64Array#__set - i32.const 0 - local.set $1 - local.get $0 - call $~lib/rt/pure/__retain - local.set $2 - i32.const 6608 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - i32.load offset=4 - local.set $6 - local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $7 - loop $for-loop|013 + end + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 6384 + call $~lib/rt/pure/__release + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $5 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/typedarray/Uint16Array#__set + i32.const 0 + local.set $1 + local.get $0 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 6416 + call $~lib/rt/pure/__retain + local.set $4 + local.get $2 + i32.load offset=4 + local.set $6 + local.get $2 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $7 + loop $for-loop|011 + local.get $1 + local.get $7 + i32.lt_s + if + local.get $6 local.get $1 - local.get $7 - i32.lt_s - if - local.get $6 - local.get $1 - i32.const 3 - i32.shl - i32.add - f64.load - i32.const 3 - global.set $~argumentsLength - local.get $1 - local.get $2 - local.get $4 - i32.load - call_indirect (type $f64_i32_i32_=>_none) - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|013 - end + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.const 3 + global.set $~argumentsLength + local.get $1 + local.get $2 + local.get $4 + i32.load + call_indirect (type $i32_i32_i32_=>_none) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $for-loop|011 end - local.get $4 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - i32.const 6608 - call $~lib/rt/pure/__release - global.get $std/typedarray/forEachCallCount - i32.const 3 - i32.ne - br_if $folding-inner13 - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - call $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> - call $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> - call $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> - call $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> - call $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> - call $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> - call $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> - call $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> - call $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> - call $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> - call $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int8Array,i8> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint8Array,u8> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint8ClampedArray,u8> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int16Array,i16> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint16Array,u16> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int32Array,i32> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint32Array,u32> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int64Array,i64> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint64Array,u64> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Float32Array,f32> - call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Float64Array,f64> - i32.const 1 - call $~lib/typedarray/Float64Array#constructor - local.tee $2 - i32.const 0 - f64.const nan:0x8000000000000 - call $~lib/typedarray/Float64Array#__set - local.get $2 - f64.const nan:0x8000000000000 - i32.const 0 - call $~lib/typedarray/Float64Array#indexOf - i32.const -1 - i32.ne + end + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 6416 + call $~lib/rt/pure/__release + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $5 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 6448 + call $~lib/typedarray/Int32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 6480 + call $~lib/typedarray/Int32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 6512 + call $~lib/typedarray/Int64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 6544 + call $~lib/typedarray/Int64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/typedarray/Float32Array#__set + i32.const 0 + local.set $1 + local.get $0 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 6576 + call $~lib/rt/pure/__retain + local.set $4 + local.get $2 + i32.load offset=4 + local.set $6 + local.get $2 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $7 + loop $for-loop|012 + local.get $1 + local.get $7 + i32.lt_s if - i32.const 0 - i32.const 1312 - i32.const 607 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $0 - block $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) - i32.const 0 - local.get $2 - call $~lib/rt/pure/__retain - local.tee $1 - i32.load offset=8 + local.get $6 + local.get $1 + i32.const 2 + i32.shl + i32.add + f32.load i32.const 3 - i32.shr_u - local.tee $3 - i32.ge_s - i32.const 1 - local.get $3 - select - if - local.get $1 - call $~lib/rt/pure/__release - i32.const 0 - br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 - end + global.set $~argumentsLength local.get $1 - i32.load offset=4 - local.set $4 - loop $while-continue|0 - local.get $0 - local.get $3 - i32.lt_s - if - i32.const 1 - local.get $4 - local.get $0 - i32.const 3 - i32.shl - i32.add - f64.load - local.tee $10 - local.get $10 - f64.ne - local.get $10 - f64.const nan:0x8000000000000 - f64.eq - select - if - local.get $1 - call $~lib/rt/pure/__release - i32.const 1 - br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 - end - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $while-continue|0 - end - end + local.get $2 + local.get $4 + i32.load + call_indirect (type $f32_i32_i32_=>_none) local.get $1 - call $~lib/rt/pure/__release - i32.const 0 + i32.const 1 + i32.add + local.set $1 + br $for-loop|012 end - i32.eqz + end + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 6576 + call $~lib/rt/pure/__release + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $5 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.tee $5 + call $~lib/rt/pure/__retain + local.tee $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + i32.const 6256 + i32.const 0 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 1 + i32.const 6256 + i32.const 1 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + i32.const 6256 + i32.const 2 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/typedarray/Float64Array#__set + i32.const 0 + local.set $1 + local.get $0 + call $~lib/rt/pure/__retain + local.set $2 + i32.const 6608 + call $~lib/rt/pure/__retain + local.set $4 + local.get $2 + i32.load offset=4 + local.set $6 + local.get $2 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $7 + loop $for-loop|013 + local.get $1 + local.get $7 + i32.lt_s if - i32.const 0 - i32.const 1312 - i32.const 608 + local.get $6 + local.get $1 i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - call $~lib/typedarray/Float32Array#constructor - local.tee $3 - i32.const 0 - f32.const nan:0x400000 - call $~lib/typedarray/Float32Array#__set - local.get $3 - f32.const nan:0x400000 - i32.const 0 - call $~lib/typedarray/Float32Array#indexOf - i32.const -1 - i32.ne - if - i32.const 0 - i32.const 1312 - i32.const 613 + i32.shl + i32.add + f64.load i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $0 - block $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) - i32.const 0 - local.get $3 - call $~lib/rt/pure/__retain - local.tee $1 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.tee $4 - i32.ge_s - i32.const 1 - local.get $4 - select - if - local.get $1 - call $~lib/rt/pure/__release - i32.const 0 - br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 - end + global.set $~argumentsLength local.get $1 - i32.load offset=4 - local.set $5 - loop $while-continue|014 - local.get $0 - local.get $4 - i32.lt_s - if - i32.const 1 - local.get $5 - local.get $0 - i32.const 2 - i32.shl - i32.add - f32.load - local.tee $9 - local.get $9 - f32.ne - local.get $9 - f32.const nan:0x400000 - f32.eq - select - if - local.get $1 - call $~lib/rt/pure/__release - i32.const 1 - br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 - end - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $while-continue|014 - end - end + local.get $2 + local.get $4 + i32.load + call_indirect (type $f64_i32_i32_=>_none) local.get $1 - call $~lib/rt/pure/__release - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1312 - i32.const 614 - i32.const 3 - call $~lib/builtins/abort - unreachable + i32.const 1 + i32.add + local.set $1 + br $for-loop|013 end - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Int8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 3 - i32.const 4 - call $~lib/typedarray/Int8Array#__set - local.get $0 - i32.const 4 - i32.const 5 - call $~lib/typedarray/Int8Array#__set - local.get $0 - call $~lib/typedarray/Int8Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Int8Array#join - local.tee $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Uint8Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 3 - i32.const 4 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - i32.const 4 - i32.const 5 - call $~lib/typedarray/Uint8Array#__set - local.get $0 - call $~lib/typedarray/Uint8Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Uint8Array#join - local.tee $3 - local.get $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 3 - i32.const 4 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - i32.const 4 - i32.const 5 - call $~lib/typedarray/Uint8ClampedArray#__set - local.get $0 - call $~lib/typedarray/Uint8Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Uint8Array#join - local.tee $3 - local.get $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Int16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 + end + local.get $4 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + i32.const 6608 + call $~lib/rt/pure/__release + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + br_if $folding-inner11 + local.get $5 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + call $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> + call $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> + call $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> + call $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> + call $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> + call $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> + call $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> + call $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> + call $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> + call $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> + call $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int8Array,i8> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint8Array,u8> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint8ClampedArray,u8> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int16Array,i16> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint16Array,u16> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int32Array,i32> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint32Array,u32> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Int64Array,i64> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Uint64Array,u64> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Float32Array,f32> + call $std/typedarray/testArrayIndexOfAndLastIndexOf<~lib/typedarray/Float64Array,f64> + i32.const 1 + call $~lib/typedarray/Float64Array#constructor + local.tee $2 + i32.const 0 + f64.const nan:0x8000000000000 + call $~lib/typedarray/Float64Array#__set + local.get $2 + f64.const nan:0x8000000000000 + i32.const 0 + call $~lib/typedarray/Float64Array#indexOf + i32.const -1 + i32.ne + if i32.const 0 - i32.const 1 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int16Array#__set - local.get $0 + i32.const 1312 + i32.const 607 i32.const 3 - i32.const 4 - call $~lib/typedarray/Int16Array#__set - local.get $0 - i32.const 4 - i32.const 5 - call $~lib/typedarray/Int16Array#__set - local.get $0 - call $~lib/typedarray/Int16Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Int16Array#join - local.tee $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Uint16Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + local.set $0 + block $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 3 - i32.const 4 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - i32.const 4 - i32.const 5 - call $~lib/typedarray/Uint16Array#__set - local.get $0 - call $~lib/typedarray/Uint16Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Uint16Array#join - local.tee $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Int32Array#constructor - local.tee $1 call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 3 - i32.const 4 - call $~lib/typedarray/Int32Array#__set - local.get $0 - i32.const 4 - i32.const 5 - call $~lib/typedarray/Int32Array#__set - local.get $0 - call $~lib/typedarray/Int32Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Int32Array#join - local.tee $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Uint32Array#constructor local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 1 - i32.const 2 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 2 - i32.const 3 - call $~lib/typedarray/Uint32Array#__set - local.get $0 + i32.load offset=8 i32.const 3 - i32.const 4 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - i32.const 4 - i32.const 5 - call $~lib/typedarray/Uint32Array#__set - local.get $0 - call $~lib/typedarray/Uint32Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Uint32Array#join + i32.shr_u local.tee $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 1 - call $~lib/typedarray/Int64Array#__set - local.get $0 + i32.ge_s i32.const 1 - i64.const 2 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 3 - i64.const 4 - call $~lib/typedarray/Int64Array#__set - local.get $0 - i32.const 4 - i64.const 5 - call $~lib/typedarray/Int64Array#__set - local.get $0 - call $~lib/typedarray/Int64Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Int64Array#join - local.tee $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release local.get $3 - call $~lib/rt/pure/__release + select + if + local.get $1 + call $~lib/rt/pure/__release + i32.const 0 + br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 + end local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Uint64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i64.const 1 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 1 - i64.const 2 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 2 - i64.const 3 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 3 - i64.const 4 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - i32.const 4 - i64.const 5 - call $~lib/typedarray/Uint64Array#__set - local.get $0 - call $~lib/typedarray/Uint64Array#join - local.tee $2 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/typedarray/Uint64Array#join - local.tee $3 - i32.const 7200 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner18 - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release + i32.load offset=4 + local.set $4 + loop $while-continue|0 + local.get $0 + local.get $3 + i32.lt_s + if + i32.const 1 + local.get $4 + local.get $0 + i32.const 3 + i32.shl + i32.add + f64.load + local.tee $10 + local.get $10 + f64.ne + local.get $10 + f64.const nan:0x8000000000000 + f64.eq + select + if + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $while-continue|0 + end + end local.get $1 call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Float32Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 i32.const 0 - f32.const 1 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 1 - f32.const 2 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 2 - f32.const 3 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 3 - f32.const 4 - call $~lib/typedarray/Float32Array#__set - local.get $0 - i32.const 4 - f32.const 5 - call $~lib/typedarray/Float32Array#__set - local.get $0 - call $~lib/typedarray/Float32Array#join - local.tee $2 - i32.const 8304 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner16 - local.get $0 - call $~lib/typedarray/Float32Array#join - local.tee $3 - i32.const 8304 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner17 - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - i32.const 5 - call $~lib/typedarray/Float64Array#constructor - local.tee $1 - call $~lib/rt/pure/__retain - local.tee $0 + end + i32.eqz + if i32.const 0 - f64.const 1 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 1 - f64.const 2 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 2 - f64.const 3 - call $~lib/typedarray/Float64Array#__set - local.get $0 + i32.const 1312 + i32.const 608 i32.const 3 - f64.const 4 - call $~lib/typedarray/Float64Array#__set - local.get $0 - i32.const 4 - f64.const 5 - call $~lib/typedarray/Float64Array#__set - local.get $0 - call $~lib/typedarray/Float64Array#join - local.tee $2 - i32.const 8304 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner16 - local.get $0 - call $~lib/typedarray/Float64Array#join - local.tee $3 - i32.const 8304 - call $~lib/string/String.__eq - i32.eqz - br_if $folding-inner17 - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $~lib/typedarray/Float32Array#constructor + local.tee $3 + i32.const 0 + f32.const nan:0x400000 + call $~lib/typedarray/Float32Array#__set + local.get $3 + f32.const nan:0x400000 + i32.const 0 + call $~lib/typedarray/Float32Array#indexOf + i32.const -1 + i32.ne + if i32.const 0 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $0 - i32.const 2 - global.set $~argumentsLength - local.get $0 + i32.const 1312 + i32.const 613 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + local.set $0 + block $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) i32.const 0 - call $~lib/typedarray/Uint8Array.wrap@varargs - local.tee $2 + local.get $3 + call $~lib/rt/pure/__retain + local.tee $1 i32.load offset=8 + i32.const 2 + i32.shr_u + local.tee $4 + i32.ge_s + i32.const 1 + local.get $4 + select if + local.get $1 + call $~lib/rt/pure/__release i32.const 0 - i32.const 1312 - i32.const 691 - i32.const 3 - call $~lib/builtins/abort - unreachable + br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 end - i32.const 2 - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $1 - local.get $0 - call $~lib/rt/pure/__release - i32.const 2 - global.set $~argumentsLength local.get $1 - i32.const 2 - call $~lib/typedarray/Uint8Array.wrap@varargs - local.set $0 - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - i32.load offset=8 - if - i32.const 0 - i32.const 1312 - i32.const 695 - i32.const 3 - call $~lib/builtins/abort - unreachable + i32.load offset=4 + local.set $5 + loop $while-continue|014 + local.get $0 + local.get $4 + i32.lt_s + if + i32.const 1 + local.get $5 + local.get $0 + i32.const 2 + i32.shl + i32.add + f32.load + local.tee $9 + local.get $9 + f32.ne + local.get $9 + f32.const nan:0x400000 + f32.eq + select + if + local.get $1 + call $~lib/rt/pure/__release + i32.const 1 + br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 + end + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $while-continue|014 + end end local.get $1 call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - call $std/typedarray/testArrayWrap<~lib/typedarray/Int8Array,i8> - call $std/typedarray/testArrayWrap<~lib/typedarray/Uint8Array,u8> - call $std/typedarray/testArrayWrap<~lib/typedarray/Uint8ClampedArray,u8> - call $std/typedarray/testArrayWrap<~lib/typedarray/Int16Array,i16> - call $std/typedarray/testArrayWrap<~lib/typedarray/Uint16Array,u16> - call $std/typedarray/testArrayWrap<~lib/typedarray/Int32Array,i32> - call $std/typedarray/testArrayWrap<~lib/typedarray/Uint32Array,u32> - call $std/typedarray/testArrayWrap<~lib/typedarray/Int64Array,i64> - call $std/typedarray/testArrayWrap<~lib/typedarray/Uint64Array,u64> - call $std/typedarray/testArrayWrap<~lib/typedarray/Float32Array,f32> - call $std/typedarray/testArrayWrap<~lib/typedarray/Float64Array,f64> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Int8Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint8Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint8ClampedArray> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Int16Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint16Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Int32Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint32Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Int64Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint64Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Float32Array> - call $std/typedarray/testTypedArraySet<~lib/typedarray/Float64Array> - i32.const 10 - call $~lib/typedarray/Uint8ClampedArray#constructor - local.set $0 - i32.const 3 - call $~lib/typedarray/Float32Array#constructor - local.tee $4 i32.const 0 - f32.const 400 - call $~lib/typedarray/Float32Array#__set - local.get $4 - i32.const 1 - f32.const nan:0x400000 - call $~lib/typedarray/Float32Array#__set - local.get $4 - i32.const 2 - f32.const inf - call $~lib/typedarray/Float32Array#__set - i32.const 4 - call $~lib/typedarray/Int64Array#constructor - local.tee $1 + end + i32.eqz + if i32.const 0 - i64.const -10 - call $~lib/typedarray/Int64Array#__set - local.get $1 - i32.const 1 - i64.const 100 - call $~lib/typedarray/Int64Array#__set - local.get $1 - i32.const 2 - i64.const 10 - call $~lib/typedarray/Int64Array#__set - local.get $1 + i32.const 1312 + i32.const 614 i32.const 3 - i64.const 300 - call $~lib/typedarray/Int64Array#__set - i32.const 2 - call $~lib/typedarray/Int32Array#constructor - local.tee $5 - i32.const 0 - i32.const 300 - call $~lib/typedarray/Int32Array#__set - local.get $5 - i32.const 1 - i32.const -1 - call $~lib/typedarray/Int32Array#__set - local.get $0 - local.get $4 - call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Float32Array> - local.get $0 - local.get $1 - i32.const 4 - call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Int64Array> - local.get $0 - local.get $5 - call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Int32Array> - local.get $0 - i32.const 10 - i32.const 0 - i32.const 63 - i32.const 12480 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.tee $6 - call $std/typedarray/valuesEqual<~lib/typedarray/Uint8ClampedArray> - i32.const 4 - call $~lib/typedarray/Uint32Array#constructor - local.tee $2 + call $~lib/builtins/abort + unreachable + end + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Int8Array#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Int8Array#__set + local.get $0 + call $~lib/typedarray/Int8Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Int8Array#join + local.tee $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Uint8Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Uint8Array#__set + local.get $0 + call $~lib/typedarray/Uint8Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Uint8Array#join + local.tee $3 + local.get $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + call $~lib/typedarray/Uint8Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Uint8Array#join + local.tee $3 + local.get $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Int16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Int16Array#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Int16Array#__set + local.get $0 + call $~lib/typedarray/Int16Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Int16Array#join + local.tee $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Uint16Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Uint16Array#__set + local.get $0 + call $~lib/typedarray/Uint16Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Uint16Array#join + local.tee $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Int32Array#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Int32Array#__set + local.get $0 + call $~lib/typedarray/Int32Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Int32Array#join + local.tee $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Uint32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 1 + i32.const 2 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 2 + i32.const 3 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 3 + i32.const 4 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + i32.const 4 + i32.const 5 + call $~lib/typedarray/Uint32Array#__set + local.get $0 + call $~lib/typedarray/Uint32Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Uint32Array#join + local.tee $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 3 + i64.const 4 + call $~lib/typedarray/Int64Array#__set + local.get $0 + i32.const 4 + i64.const 5 + call $~lib/typedarray/Int64Array#__set + local.get $0 + call $~lib/typedarray/Int64Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Int64Array#join + local.tee $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Uint64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + i64.const 1 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 1 + i64.const 2 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 2 + i64.const 3 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 3 + i64.const 4 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + i32.const 4 + i64.const 5 + call $~lib/typedarray/Uint64Array#__set + local.get $0 + call $~lib/typedarray/Uint64Array#join + local.tee $2 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner16 + local.get $0 + call $~lib/typedarray/Uint64Array#join + local.tee $3 + i32.const 7200 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner17 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Float32Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f32.const 1 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 1 + f32.const 2 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 2 + f32.const 3 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 3 + f32.const 4 + call $~lib/typedarray/Float32Array#__set + local.get $0 + i32.const 4 + f32.const 5 + call $~lib/typedarray/Float32Array#__set + local.get $0 + call $~lib/typedarray/Float32Array#join + local.tee $2 + i32.const 8304 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner14 + local.get $0 + call $~lib/typedarray/Float32Array#join + local.tee $3 + i32.const 8304 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner15 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 5 + call $~lib/typedarray/Float64Array#constructor + local.tee $1 + call $~lib/rt/pure/__retain + local.tee $0 + i32.const 0 + f64.const 1 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 1 + f64.const 2 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 2 + f64.const 3 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 3 + f64.const 4 + call $~lib/typedarray/Float64Array#__set + local.get $0 + i32.const 4 + f64.const 5 + call $~lib/typedarray/Float64Array#__set + local.get $0 + call $~lib/typedarray/Float64Array#join + local.tee $2 + i32.const 8304 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner14 + local.get $0 + call $~lib/typedarray/Float64Array#join + local.tee $3 + i32.const 8304 + call $~lib/string/String.__eq + i32.eqz + br_if $folding-inner15 + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $0 + i32.const 2 + global.set $~argumentsLength + local.get $0 + i32.const 0 + call $~lib/typedarray/Uint8Array.wrap@varargs + local.tee $2 + i32.load offset=8 + if i32.const 0 - i32.const 1 - call $~lib/typedarray/Uint32Array#__set - local.get $2 - i32.const 1 - i32.const 300 - call $~lib/typedarray/Uint32Array#__set - local.get $2 - i32.const 2 - i32.const 100 - call $~lib/typedarray/Uint32Array#__set - local.get $2 + i32.const 1312 + i32.const 691 i32.const 3 - i32.const -1 - call $~lib/typedarray/Uint32Array#__set - i32.const 4 - call $~lib/typedarray/Int16Array#constructor - local.tee $3 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + i32.const 2 + global.set $~argumentsLength + local.get $1 + i32.const 2 + call $~lib/typedarray/Uint8Array.wrap@varargs + local.set $0 + local.get $2 + call $~lib/rt/pure/__release + local.get $0 + i32.load offset=8 + if i32.const 0 - i32.const -10 - call $~lib/typedarray/Int16Array#__set - local.get $3 - i32.const 1 - i32.const 100 - call $~lib/typedarray/Int16Array#__set - local.get $3 - i32.const 2 - i32.const 10 - call $~lib/typedarray/Int16Array#__set - local.get $3 + i32.const 1312 + i32.const 695 i32.const 3 - i32.const 300 - call $~lib/typedarray/Int16Array#__set - local.get $0 - local.get $2 - call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Uint32Array> - local.get $0 - local.get $3 - i32.const 5 - call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Int16Array> - local.get $0 - i32.const 10 - i32.const 0 - i32.const 63 - i32.const 12512 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.tee $7 - call $std/typedarray/valuesEqual<~lib/typedarray/Uint8ClampedArray> - local.get $0 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $7 - call $~lib/rt/pure/__release - return + call $~lib/builtins/abort + unreachable end - br $folding-inner3 + local.get $1 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release + call $std/typedarray/testArrayWrap<~lib/typedarray/Int8Array,i8> + call $std/typedarray/testArrayWrap<~lib/typedarray/Uint8Array,u8> + call $std/typedarray/testArrayWrap<~lib/typedarray/Uint8ClampedArray,u8> + call $std/typedarray/testArrayWrap<~lib/typedarray/Int16Array,i16> + call $std/typedarray/testArrayWrap<~lib/typedarray/Uint16Array,u16> + call $std/typedarray/testArrayWrap<~lib/typedarray/Int32Array,i32> + call $std/typedarray/testArrayWrap<~lib/typedarray/Uint32Array,u32> + call $std/typedarray/testArrayWrap<~lib/typedarray/Int64Array,i64> + call $std/typedarray/testArrayWrap<~lib/typedarray/Uint64Array,u64> + call $std/typedarray/testArrayWrap<~lib/typedarray/Float32Array,f32> + call $std/typedarray/testArrayWrap<~lib/typedarray/Float64Array,f64> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Int8Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint8Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint8ClampedArray> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Int16Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint16Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Int32Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint32Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Int64Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Uint64Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Float32Array> + call $std/typedarray/testTypedArraySet<~lib/typedarray/Float64Array> + i32.const 10 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $0 + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.tee $4 + i32.const 0 + f32.const 400 + call $~lib/typedarray/Float32Array#__set + local.get $4 + i32.const 1 + f32.const nan:0x400000 + call $~lib/typedarray/Float32Array#__set + local.get $4 + i32.const 2 + f32.const inf + call $~lib/typedarray/Float32Array#__set + i32.const 4 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + i32.const 0 + i64.const -10 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 1 + i64.const 100 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 2 + i64.const 10 + call $~lib/typedarray/Int64Array#__set + local.get $1 + i32.const 3 + i64.const 300 + call $~lib/typedarray/Int64Array#__set + i32.const 2 + call $~lib/typedarray/Int32Array#constructor + local.tee $5 + i32.const 0 + i32.const 300 + call $~lib/typedarray/Int32Array#__set + local.get $5 + i32.const 1 + i32.const -1 + call $~lib/typedarray/Int32Array#__set + local.get $0 + local.get $4 + call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Float32Array> + local.get $0 + local.get $1 + i32.const 4 + call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Int64Array> + local.get $0 + local.get $5 + call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Int32Array> + local.get $0 + i32.const 10 + i32.const 0 + i32.const 63 + i32.const 12480 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $6 + call $std/typedarray/valuesEqual<~lib/typedarray/Uint8ClampedArray> + i32.const 4 + call $~lib/typedarray/Uint32Array#constructor + local.tee $2 + i32.const 0 + i32.const 1 + call $~lib/typedarray/Uint32Array#__set + local.get $2 + i32.const 1 + i32.const 300 + call $~lib/typedarray/Uint32Array#__set + local.get $2 + i32.const 2 + i32.const 100 + call $~lib/typedarray/Uint32Array#__set + local.get $2 + i32.const 3 + i32.const -1 + call $~lib/typedarray/Uint32Array#__set + i32.const 4 + call $~lib/typedarray/Int16Array#constructor + local.tee $3 + i32.const 0 + i32.const -10 + call $~lib/typedarray/Int16Array#__set + local.get $3 + i32.const 1 + i32.const 100 + call $~lib/typedarray/Int16Array#__set + local.get $3 + i32.const 2 + i32.const 10 + call $~lib/typedarray/Int16Array#__set + local.get $3 + i32.const 3 + i32.const 300 + call $~lib/typedarray/Int16Array#__set + local.get $0 + local.get $2 + call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Uint32Array> + local.get $0 + local.get $3 + i32.const 5 + call $~lib/typedarray/Uint8ClampedArray#set<~lib/typedarray/Int16Array> + local.get $0 + i32.const 10 + i32.const 0 + i32.const 63 + i32.const 12512 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $7 + call $std/typedarray/valuesEqual<~lib/typedarray/Uint8ClampedArray> + local.get $0 + call $~lib/rt/pure/__release + local.get $4 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $5 + call $~lib/rt/pure/__release + local.get $6 + call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release + local.get $7 + call $~lib/rt/pure/__release + return end i32.const 0 i32.const 1312 From 2666c4786ec00f7c5573610923e5eb8358830305 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 11 Oct 2020 20:10:11 +0300 Subject: [PATCH 2/9] simplify some parts --- src/module.ts | 7 +- tests/compiler/assert-nonnull.optimized.wat | 16 +- tests/compiler/builtins.optimized.wat | 6 +- .../compiler/class-overloading.optimized.wat | 6 +- tests/compiler/class.optimized.wat | 3 +- .../field-initialization.optimized.wat | 6 +- .../function-expression.optimized.wat | 153 +++++---- tests/compiler/infer-array.optimized.wat | 28 +- tests/compiler/infer-generic.optimized.wat | 17 +- tests/compiler/loop-flow.optimized.wat | 36 +- tests/compiler/number.optimized.wat | 315 +++++++++--------- tests/compiler/rc/optimize.optimized.wat | 31 +- tests/compiler/resolve-access.optimized.wat | 35 +- tests/compiler/resolve-binary.optimized.wat | 269 ++++++++------- .../resolve-elementaccess.optimized.wat | 298 ++++++++--------- .../resolve-function-expression.optimized.wat | 50 ++- .../resolve-propertyaccess.optimized.wat | 39 ++- tests/compiler/resolve-unary.optimized.wat | 39 ++- tests/compiler/std/array-access.optimized.wat | 20 +- tests/compiler/std/map.optimized.wat | 56 ++-- tests/compiler/std/object.optimized.wat | 6 +- .../std/operator-overloading.optimized.wat | 8 +- tests/compiler/std/symbol.optimized.wat | 131 ++++---- tests/compiler/std/typedarray.optimized.wat | 207 ++++++------ tests/compiler/super-inline.optimized.wat | 2 +- tests/compiler/typeof.optimized.wat | 6 +- tests/compiler/wasi/trace.optimized.wat | 87 +++-- 27 files changed, 961 insertions(+), 916 deletions(-) diff --git a/src/module.ts b/src/module.ts index 4a33e71204..252081502c 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1546,13 +1546,12 @@ export class Module { // passes.push("post-assemblyscript"); // } passes.push("optimize-instructions"); + passes.push("remove-unused-brs"); + passes.push("remove-unused-names"); if (optimizeLevel >= 3 || shrinkLevel >= 1) { passes.push("dce"); passes.push("inlining"); } - passes.push("remove-unused-brs"); - passes.push("remove-unused-names"); - passes.push("inlining-optimizing"); if (optimizeLevel >= 3 || shrinkLevel >= 2) { passes.push("precompute-propagate"); } else { @@ -1656,7 +1655,7 @@ export class Module { passes.push("simplify-locals"); passes.push("vacuum"); - passes.push("inlining-optimizing"); + passes.push("inlining"); passes.push("precompute-propagate"); passes.push("vacuum"); diff --git a/tests/compiler/assert-nonnull.optimized.wat b/tests/compiler/assert-nonnull.optimized.wat index cf2ed16137..3714a533bc 100644 --- a/tests/compiler/assert-nonnull.optimized.wat +++ b/tests/compiler/assert-nonnull.optimized.wat @@ -136,7 +136,6 @@ local.get $0 ) (func $assert-nonnull/testAll (param $0 i32) (result i32) - (local $1 i32) block $folding-inner0 local.get $0 i32.eqz @@ -144,9 +143,9 @@ local.get $0 call $~lib/array/Array#__get local.tee $0 - local.get $0 i32.eqz br_if $folding-inner0 + local.get $0 i32.load local.tee $0 i32.eqz @@ -162,7 +161,6 @@ unreachable ) (func $assert-nonnull/testAll2 (param $0 i32) (result i32) - (local $1 i32) block $folding-inner0 local.get $0 i32.eqz @@ -170,9 +168,9 @@ local.get $0 call $~lib/array/Array#__get local.tee $0 - local.get $0 i32.eqz br_if $folding-inner0 + local.get $0 i32.load local.tee $0 i32.eqz @@ -208,12 +206,10 @@ call_indirect (type $none_=>_i32) ) (func $assert-nonnull/testRet (param $0 i32) (result i32) - (local $1 i32) local.get $0 i32.load call_indirect (type $none_=>_i32) - local.tee $1 - local.get $1 + local.tee $0 i32.eqz if i32.const 1040 @@ -223,6 +219,7 @@ call $~lib/builtins/abort unreachable end + local.get $0 ) (func $assert-nonnull/testObjFn (param $0 i32) (result i32) local.get $0 @@ -231,13 +228,11 @@ call_indirect (type $none_=>_i32) ) (func $assert-nonnull/testObjRet (param $0 i32) (result i32) - (local $1 i32) local.get $0 i32.load offset=4 i32.load call_indirect (type $none_=>_i32) - local.tee $1 - local.get $1 + local.tee $0 i32.eqz if i32.const 1040 @@ -247,5 +242,6 @@ call $~lib/builtins/abort unreachable end + local.get $0 ) ) diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index e522385f05..0807f4df17 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -107,16 +107,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end diff --git a/tests/compiler/class-overloading.optimized.wat b/tests/compiler/class-overloading.optimized.wat index 9f337184e4..26fd01a7b6 100644 --- a/tests/compiler/class-overloading.optimized.wat +++ b/tests/compiler/class-overloading.optimized.wat @@ -163,16 +163,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index 2b4cd885ea..125955a409 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -140,9 +140,10 @@ i32.const 0 i32.const 0 call $~lib/rt/stub/__alloc - local.set $1 + local.tee $1 local.get $0 i32.load + i32.ne drop local.get $0 local.get $1 diff --git a/tests/compiler/field-initialization.optimized.wat b/tests/compiler/field-initialization.optimized.wat index 6f20599bb8..d5a22b76ef 100644 --- a/tests/compiler/field-initialization.optimized.wat +++ b/tests/compiler/field-initialization.optimized.wat @@ -193,16 +193,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end diff --git a/tests/compiler/function-expression.optimized.wat b/tests/compiler/function-expression.optimized.wat index 9384556cdd..3363405e5f 100644 --- a/tests/compiler/function-expression.optimized.wat +++ b/tests/compiler/function-expression.optimized.wat @@ -26,6 +26,7 @@ (data (i32.const 1600) "\08\00\00\00\01\00\00\00\07\00\00\00\08\00\00\00\11") (table $0 18 funcref) (elem (i32.const 1) $start:function-expression~anonymous|0 $start:function-expression~anonymous|0 $start:function-expression~someName $start:function-expression~anonymous|2 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $start:function-expression~anonymous|2 $function-expression/testGlobal~anonymous|0~anonymous|0 $function-expression/testGlobal~anonymous|0 $function-expression/testGlobal~anonymous|0~anonymous|0 $function-expression/testLocal~anonymous|0 $function-expression/testGlobal~anonymous|0~anonymous|0 $function-expression/testField~anonymous|0) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) (start $~start) (func $start:function-expression~anonymous|0 (param $0 i32) (result i32) @@ -69,9 +70,92 @@ (func $function-expression/testField~anonymous|0 (result i32) i32.const 1584 ) - (func $start:function-expression + (func $function-expression/testField (local $0 i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $2 + i32.const 16 + i32.add + local.tee $0 + memory.size + local.tee $3 + i32.const 16 + i32.shl + local.tee $1 + i32.gt_u + if + local.get $3 + local.get $0 + local.get $1 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $1 + local.get $3 + local.get $1 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $1 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $0 + global.set $~lib/rt/stub/offset + local.get $2 + i32.const 16 + i32.sub + local.tee $0 + i32.const 16 + i32.store + local.get $0 + i32.const 1 + i32.store offset=4 + local.get $0 + i32.const 8 + i32.store offset=8 + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $2 + i32.const 1616 + i32.store + i32.const 1 + local.get $2 + i32.load + i32.load + call_indirect (type $none_=>_i32) + i32.load + call_indirect (type $i32_=>_i32) + i32.const 25 + i32.ne + if + i32.const 0 + i32.const 1072 + i32.const 82 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + ) + (func $start:function-expression i32.const 1 i32.const 1040 i32.load @@ -229,72 +313,9 @@ call $~lib/builtins/abort unreachable end - i32.const 1664 - memory.size - local.tee $1 - i32.const 16 - i32.shl - local.tee $0 - i32.gt_u - if - local.get $1 - i32.const 67199 - local.get $0 - i32.sub - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $0 - local.get $1 - local.get $0 - i32.gt_s - select - memory.grow - i32.const 0 - i32.lt_s - if - local.get $0 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - end i32.const 1632 - i32.const 16 - i32.store - i32.const 1636 - i32.const 1 - i32.store - i32.const 1640 - i32.const 8 - i32.store - i32.const 1644 - i32.const 4 - i32.store - i32.const 1648 - i32.const 1616 - i32.store - i32.const 1 - i32.const 1648 - i32.load - i32.load - call_indirect (type $none_=>_i32) - i32.load - call_indirect (type $i32_=>_i32) - i32.const 25 - i32.ne - if - i32.const 0 - i32.const 1072 - i32.const 82 - i32.const 3 - call $~lib/builtins/abort - unreachable - end + global.set $~lib/rt/stub/offset + call $function-expression/testField ) (func $~start call $start:function-expression diff --git a/tests/compiler/infer-array.optimized.wat b/tests/compiler/infer-array.optimized.wat index ebe9642e9f..9a64104c04 100644 --- a/tests/compiler/infer-array.optimized.wat +++ b/tests/compiler/infer-array.optimized.wat @@ -288,15 +288,16 @@ (func $~lib/rt/__allocArray (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) + (local $6 i32) i32.const 16 local.get $2 call $~lib/rt/stub/__alloc - local.set $2 + local.tee $2 local.get $0 local.get $1 i32.shl local.tee $4 - local.set $5 + local.set $6 local.get $4 i32.const 0 call $~lib/rt/stub/__alloc @@ -305,10 +306,9 @@ if local.get $1 local.get $3 - local.get $5 + local.get $6 call $~lib/memory/memory.copy end - local.get $2 local.get $1 i32.store local.get $2 @@ -340,18 +340,20 @@ i32.const 1184 call $~lib/rt/__allocArray drop + i32.const 2 + i32.const 2 + i32.const 5 + i32.const 1232 + call $~lib/rt/__allocArray + local.tee $0 + local.set $1 block $folding-inner0 i32.const 1 - i32.const 2 - i32.const 2 - i32.const 5 - i32.const 1232 - call $~lib/rt/__allocArray - local.tee $0 + local.get $0 i32.load offset=12 i32.ge_u br_if $folding-inner0 - local.get $0 + local.get $1 i32.load offset=4 i32.load offset=4 i32.const -1 @@ -370,17 +372,17 @@ i32.const 1312 call $~lib/rt/__allocArray drop - i32.const 1 i32.const 3 i32.const 2 i32.const 6 i32.const 1360 call $~lib/rt/__allocArray local.tee $0 + i32.const 1 + local.get $0 i32.load offset=12 i32.ge_u br_if $folding-inner0 - local.get $0 i32.load offset=4 f32.load offset=4 drop diff --git a/tests/compiler/infer-generic.optimized.wat b/tests/compiler/infer-generic.optimized.wat index ce07f87f18..a536b251d4 100644 --- a/tests/compiler/infer-generic.optimized.wat +++ b/tests/compiler/infer-generic.optimized.wat @@ -35,25 +35,22 @@ (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) i32.const 1132 i32.load - local.set $1 + local.set $2 loop $for-loop|0 - local.get $1 + local.get $0 + local.get $2 i32.const 1132 i32.load - local.tee $2 - i32.lt_s - local.set $3 - local.get $0 - local.get $1 + local.tee $3 local.get $2 local.get $3 + i32.lt_s select i32.lt_s if - local.get $4 + local.get $1 i32.const 1124 i32.load local.get $0 @@ -66,7 +63,7 @@ i32.const 1152 i32.load call_indirect (type $i32_f32_i32_i32_=>_i32) - local.set $4 + local.set $1 local.get $0 i32.const 1 i32.add diff --git a/tests/compiler/loop-flow.optimized.wat b/tests/compiler/loop-flow.optimized.wat index 638f2185d5..67d6226c88 100644 --- a/tests/compiler/loop-flow.optimized.wat +++ b/tests/compiler/loop-flow.optimized.wat @@ -35,13 +35,17 @@ if local.get $0 i32.const 2 - i32.ne - br_if $while-continue|0 - i32.const 1088 - i32.const 1040 - i32.const 24 - i32.const 22 - call $~lib/builtins/abort + i32.eq + if + i32.const 1088 + i32.const 1040 + i32.const 24 + i32.const 22 + call $~lib/builtins/abort + unreachable + else + br $while-continue|0 + end unreachable end end @@ -85,13 +89,17 @@ if local.get $0 i32.const 2 - i32.ne - br_if $do-continue|0 - i32.const 1088 - i32.const 1040 - i32.const 78 - i32.const 22 - call $~lib/builtins/abort + i32.eq + if + i32.const 1088 + i32.const 1040 + i32.const 78 + i32.const 22 + call $~lib/builtins/abort + unreachable + else + br $do-continue|0 + end unreachable end end diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index 6d8c3d16e2..f30b32e7b8 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -2,11 +2,12 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_=>_i32 (func (param i32 i64 i32 i64 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) @@ -192,44 +193,45 @@ br_if $do-continue|0 end ) - (func $~lib/number/I32#toString (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 - if (result i32) - local.get $0 - i32.const 31 - i32.shr_u - local.tee $1 - if - i32.const 0 - local.get $0 - i32.sub - local.set $0 - end - local.get $0 - call $~lib/util/number/decimalCount32 - local.get $1 - i32.add - local.tee $3 - i32.const 1 - i32.shl - call $~lib/rt/stub/__alloc - local.tee $2 + i32.eqz + if + i32.const 1232 + return + end + local.get $0 + i32.const 31 + i32.shr_u + local.tee $1 + if + i32.const 0 local.get $0 - local.get $3 - call $~lib/util/number/utoa_dec_simple - local.get $1 - if - local.get $2 - i32.const 45 - i32.store16 - end + i32.sub + local.set $0 + end + local.get $0 + call $~lib/util/number/decimalCount32 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.shl + call $~lib/rt/stub/__alloc + local.tee $2 + local.get $0 + local.get $3 + call $~lib/util/number/utoa_dec_simple + local.get $1 + if local.get $2 - else - i32.const 1232 + i32.const 45 + i32.store16 end + local.get $2 ) (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 @@ -289,16 +291,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end @@ -1269,80 +1271,135 @@ global.get $~lib/util/number/_K call $~lib/util/number/prettify ) - (func $~lib/string/String#substring (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/number/dtoa (result i32) + (local $0 i32) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) - i32.const 0 - local.get $0 - call $~lib/string/String#get:length - local.tee $4 - i32.lt_s - local.set $2 - local.get $1 - i32.const 0 - local.get $1 - i32.const 0 - i32.gt_s - select - local.tee $3 - local.get $4 - i32.lt_s - local.set $1 - i32.const 0 - local.get $4 - local.get $2 - select + (local $5 i32) + i32.const 56 + call $~lib/rt/stub/__alloc local.tee $2 - local.get $3 - local.get $4 - local.get $1 - select + call $~lib/util/number/dtoa_core local.tee $3 + i32.const 28 + i32.eq + if + local.get $2 + return + end local.get $2 - local.get $3 - i32.gt_s - select - i32.const 1 - i32.shl - local.tee $1 + local.set $0 + block $__inlined_func$~lib/string/String#substring + i32.const 0 + local.get $2 + call $~lib/string/String#get:length + local.tee $1 + i32.const 0 + local.get $1 + i32.lt_s + select + local.tee $4 + local.get $3 + i32.const 0 + local.get $3 + i32.const 0 + i32.gt_s + select + local.tee $3 + local.get $1 + local.get $3 + local.get $1 + i32.lt_s + select + local.tee $3 + local.get $4 + local.get $3 + i32.gt_s + select + i32.const 1 + i32.shl + local.tee $5 + local.get $4 + local.get $3 + local.get $4 + local.get $3 + i32.lt_s + select + i32.const 1 + i32.shl + local.tee $4 + i32.sub + local.tee $3 + i32.eqz + if + i32.const 2496 + local.set $0 + br $__inlined_func$~lib/string/String#substring + end + i32.const 0 + local.get $5 + local.get $1 + i32.const 1 + i32.shl + i32.eq + local.get $4 + select + br_if $__inlined_func$~lib/string/String#substring + local.get $3 + call $~lib/rt/stub/__alloc + local.tee $1 + local.get $0 + local.get $4 + i32.add + local.get $3 + call $~lib/memory/memory.copy + local.get $1 + local.set $0 + end local.get $2 - local.get $3 + i32.const 15 + i32.and + i32.eqz + i32.const 0 local.get $2 - local.get $3 - i32.lt_s select - i32.const 1 - i32.shl - local.tee $2 - i32.sub - local.tee $3 i32.eqz if - i32.const 2496 - return + i32.const 0 + i32.const 2512 + i32.const 68 + i32.const 3 + call $~lib/builtins/abort + unreachable end - i32.const 0 - local.get $1 - local.get $4 - i32.const 1 - i32.shl - i32.eq local.get $2 - select + i32.const 16 + i32.sub + local.tee $1 + i32.load offset=4 + i32.const 1 + i32.ne if - local.get $0 - return + i32.const 0 + i32.const 2512 + i32.const 70 + i32.const 14 + call $~lib/builtins/abort + unreachable end - local.get $3 - call $~lib/rt/stub/__alloc - local.tee $1 - local.get $0 + global.get $~lib/rt/stub/offset local.get $2 - i32.add - local.get $3 - call $~lib/memory/memory.copy local.get $1 + i32.load + i32.add + i32.eq + if + local.get $1 + global.set $~lib/rt/stub/offset + end + local.get $0 ) (func $~lib/number/F32.isSafeInteger (param $0 f32) (result i32) local.get $0 @@ -1396,12 +1453,10 @@ ) (func $start:number (local $0 i32) - (local $1 i32) - (local $2 i32) i32.const 2768 global.set $~lib/rt/stub/offset global.get $number/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1360 call $~lib/string/String.__eq i32.eqz @@ -1413,61 +1468,7 @@ call $~lib/builtins/abort unreachable end - i32.const 56 - call $~lib/rt/stub/__alloc - local.tee $0 - call $~lib/util/number/dtoa_core - local.tee $1 - i32.const 28 - i32.ne - if (result i32) - local.get $0 - local.get $1 - call $~lib/string/String#substring - local.get $0 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $0 - select - i32.eqz - if - i32.const 0 - i32.const 2512 - i32.const 68 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 16 - i32.sub - local.tee $2 - i32.load offset=4 - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 2512 - i32.const 70 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/stub/offset - local.get $0 - local.get $2 - i32.load - i32.add - i32.eq - if - local.get $2 - global.set $~lib/rt/stub/offset - end - else - local.get $0 - end + call $~lib/util/number/dtoa i32.const 2560 call $~lib/string/String.__eq i32.eqz @@ -1480,7 +1481,7 @@ unreachable end i32.const 3 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2592 call $~lib/string/String.__eq i32.eqz @@ -1493,7 +1494,7 @@ unreachable end i32.const -5 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2624 call $~lib/string/String.__eq i32.eqz @@ -1506,7 +1507,7 @@ unreachable end i32.const 4 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2656 call $~lib/string/String.__eq i32.eqz @@ -1523,7 +1524,7 @@ i32.add global.set $number/a global.get $number/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2688 call $~lib/string/String.__eq i32.eqz @@ -1540,7 +1541,7 @@ i32.sub global.set $number/a global.get $number/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1360 call $~lib/string/String.__eq i32.eqz @@ -1582,7 +1583,7 @@ i32.add global.set $number/a local.get $0 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1360 call $~lib/string/String.__eq i32.eqz @@ -1600,7 +1601,7 @@ i32.sub global.set $number/a local.get $0 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2688 call $~lib/string/String.__eq i32.eqz diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index 17cde00d78..2d4bb450ae 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -802,6 +802,7 @@ (local $1 i32) (local $2 i32) (local $3 i32) + (local $4 i32) global.get $~lib/rt/tlsf/collectLock if i32.const 0 @@ -827,7 +828,7 @@ if i32.const 16 memory.size - local.tee $2 + local.tee $1 i32.const 16 i32.shl i32.const 16 @@ -842,18 +843,18 @@ i32.and i32.const 16 i32.shr_u - local.set $1 - local.get $2 + local.set $2 local.get $1 local.get $2 local.get $1 + local.get $2 i32.gt_s select memory.grow i32.const 0 i32.lt_s if - local.get $1 + local.get $2 memory.grow i32.const 0 i32.lt_s @@ -862,7 +863,7 @@ end end local.get $0 - local.get $2 + local.get $1 i32.const 16 i32.shl memory.size @@ -910,28 +911,30 @@ local.get $1 call $~lib/rt/tlsf/removeBlock local.get $1 + local.set $2 + local.get $2 i32.load - local.tee $2 + local.tee $3 i32.const -4 i32.and i32.const 16 i32.sub - local.tee $3 + local.tee $4 i32.const 32 i32.ge_u if - local.get $1 local.get $2 + local.get $3 i32.const 2 i32.and i32.const 16 i32.or i32.store - local.get $1 + local.get $2 i32.const 32 i32.add local.tee $2 - local.get $3 + local.get $4 i32.const 16 i32.sub i32.const 1 @@ -941,22 +944,22 @@ local.get $2 call $~lib/rt/tlsf/insertBlock else - local.get $1 local.get $2 + local.get $3 i32.const -2 i32.and i32.store - local.get $1 + local.get $2 i32.const 16 i32.add local.tee $0 - local.get $1 + local.get $2 i32.load i32.const -4 i32.and i32.add local.get $0 - local.get $1 + local.get $2 i32.load i32.const -4 i32.and diff --git a/tests/compiler/resolve-access.optimized.wat b/tests/compiler/resolve-access.optimized.wat index 49a4bab338..5edf48d977 100644 --- a/tests/compiler/resolve-access.optimized.wat +++ b/tests/compiler/resolve-access.optimized.wat @@ -347,7 +347,7 @@ end ) (func $~lib/util/number/utoa64 (param $0 i64) (result i32) - (local $1 i64) + (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -363,16 +363,16 @@ if local.get $0 i32.wrap_i64 - local.tee $2 + local.tee $1 call $~lib/util/number/decimalCount32 - local.tee $3 + local.tee $2 i32.const 1 i32.shl i32.const 1 call $~lib/rt/stub/__alloc - local.tee $4 + local.tee $3 + local.get $1 local.get $2 - local.get $3 call $~lib/util/number/utoa_dec_simple else local.get $0 @@ -419,39 +419,42 @@ i64.const 1000000000000000 i64.lt_u select - local.tee $2 + local.tee $1 i32.const 1 i32.shl i32.const 1 call $~lib/rt/stub/__alloc - local.tee $4 - local.set $3 + local.tee $3 + local.set $2 loop $do-continue|0 + local.get $0 + i64.const 10 + i64.rem_u + i32.wrap_i64 + local.set $4 local.get $0 i64.const 10 i64.div_u - local.get $3 + local.set $0 local.get $2 + local.get $1 i32.const 1 i32.sub - local.tee $2 + local.tee $1 i32.const 1 i32.shl i32.add - local.get $0 - i64.const 10 - i64.rem_u - i32.wrap_i64 + local.get $4 i32.const 48 i32.add i32.store16 - local.tee $0 + local.get $0 i64.const 0 i64.ne br_if $do-continue|0 end end - local.get $4 + local.get $3 ) (func $resolve-access/arrayAccess (result i32) (local $0 i32) diff --git a/tests/compiler/resolve-binary.optimized.wat b/tests/compiler/resolve-binary.optimized.wat index 81ca43caa9..a31266088f 100644 --- a/tests/compiler/resolve-binary.optimized.wat +++ b/tests/compiler/resolve-binary.optimized.wat @@ -111,16 +111,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end @@ -322,45 +322,46 @@ br_if $do-continue|0 end ) - (func $~lib/number/I32#toString (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 - if (result i32) - local.get $0 - i32.const 31 - i32.shr_u - local.tee $1 - if - i32.const 0 - local.get $0 - i32.sub - local.set $0 - end - local.get $0 - call $~lib/util/number/decimalCount32 - local.get $1 - i32.add - local.tee $3 - i32.const 1 - i32.shl - i32.const 1 - call $~lib/rt/stub/__alloc - local.tee $2 + i32.eqz + if + i32.const 1392 + return + end + local.get $0 + i32.const 31 + i32.shr_u + local.tee $1 + if + i32.const 0 local.get $0 - local.get $3 - call $~lib/util/number/utoa_dec_simple - local.get $1 - if - local.get $2 - i32.const 45 - i32.store16 - end + i32.sub + local.set $0 + end + local.get $0 + call $~lib/util/number/decimalCount32 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/stub/__alloc + local.tee $2 + local.get $0 + local.get $3 + call $~lib/util/number/utoa_dec_simple + local.get $1 + if local.get $2 - else - i32.const 1392 + i32.const 45 + i32.store16 end + local.get $2 ) (func $~lib/util/number/genDigits (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (result i32) (local $6 i32) @@ -1290,45 +1291,41 @@ i32.const 0 local.get $0 call $~lib/string/String#get:length - local.tee $4 + local.tee $2 + i32.const 0 + local.get $2 i32.lt_s - local.set $2 + select + local.tee $3 local.get $1 i32.const 0 local.get $1 i32.const 0 i32.gt_s select - local.tee $3 - local.get $4 - i32.lt_s - local.set $1 - i32.const 0 - local.get $4 + local.tee $1 local.get $2 - select - local.tee $2 - local.get $3 - local.get $4 local.get $1 - select - local.tee $3 local.get $2 + i32.lt_s + select + local.tee $1 local.get $3 + local.get $1 i32.gt_s select i32.const 1 i32.shl - local.tee $1 - local.get $2 + local.tee $4 local.get $3 - local.get $2 + local.get $1 local.get $3 + local.get $1 i32.lt_s select i32.const 1 i32.shl - local.tee $2 + local.tee $1 i32.sub local.tee $3 i32.eqz @@ -1337,12 +1334,12 @@ return end i32.const 0 - local.get $1 local.get $4 + local.get $2 i32.const 1 i32.shl i32.eq - local.get $2 + local.get $1 select if local.get $0 @@ -1351,15 +1348,15 @@ local.get $3 i32.const 1 call $~lib/rt/stub/__alloc - local.tee $1 + local.tee $2 local.get $0 - local.get $2 + local.get $1 i32.add local.get $3 call $~lib/memory/memory.copy - local.get $1 + local.get $2 ) - (func $~lib/number/F64#toString (result i32) + (func $~lib/util/number/dtoa (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -1370,54 +1367,54 @@ call $~lib/util/number/dtoa_core local.tee $1 i32.const 28 - i32.ne - if (result i32) - local.get $0 - local.get $1 - call $~lib/string/String#substring + i32.eq + if local.get $0 - i32.const 15 - i32.and - i32.eqz + return + end + local.get $0 + local.get $1 + call $~lib/string/String#substring + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if i32.const 0 - local.get $0 - select - i32.eqz - if - i32.const 0 - i32.const 2656 - i32.const 68 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 16 - i32.sub - local.tee $2 - i32.load offset=4 - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 2656 - i32.const 70 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/stub/offset - local.get $0 - local.get $2 - i32.load - i32.add - i32.eq - if - local.get $2 - global.set $~lib/rt/stub/offset - end - else - local.get $0 + i32.const 2656 + i32.const 68 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + i32.load offset=4 + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 2656 + i32.const 70 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/stub/offset + local.get $0 + local.get $1 + i32.load + i32.add + i32.eq + if + local.get $1 + global.set $~lib/rt/stub/offset end ) (func $start:resolve-binary @@ -1525,7 +1522,7 @@ i32.const 1 global.set $resolve-binary/a i32.const 1 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1542,7 +1539,7 @@ i32.add global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1559,7 +1556,7 @@ i32.sub global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1576,7 +1573,7 @@ i32.shl global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1588,7 +1585,7 @@ call $~lib/builtins/abort unreachable end - call $~lib/number/F64#toString + call $~lib/util/number/dtoa i32.const 2704 call $~lib/string/String.__eq i32.eqz @@ -1605,7 +1602,7 @@ i32.const 2 global.set $resolve-binary/a i32.const 2 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1622,7 +1619,7 @@ i32.rem_s global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1639,7 +1636,7 @@ i32.shl global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2736 call $~lib/string/String.__eq i32.eqz @@ -1656,7 +1653,7 @@ i32.shr_s global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1673,7 +1670,7 @@ i32.shr_u global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1690,7 +1687,7 @@ i32.and global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1707,7 +1704,7 @@ i32.or global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1724,7 +1721,7 @@ i32.xor global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1737,7 +1734,7 @@ unreachable end i32.const 3 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1750,7 +1747,7 @@ unreachable end i32.const -1 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2800 call $~lib/string/String.__eq i32.eqz @@ -1763,7 +1760,7 @@ unreachable end i32.const 2 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1776,7 +1773,7 @@ unreachable end i32.const 2 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1789,7 +1786,7 @@ unreachable end i32.const 1 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1831,7 +1828,7 @@ end end local.get $2 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2736 call $~lib/string/String.__eq i32.eqz @@ -1843,7 +1840,7 @@ call $~lib/builtins/abort unreachable end - call $~lib/number/F64#toString + call $~lib/util/number/dtoa i32.const 2704 call $~lib/string/String.__eq i32.eqz @@ -1855,7 +1852,7 @@ call $~lib/builtins/abort unreachable end - call $~lib/number/F64#toString + call $~lib/util/number/dtoa i32.const 2704 call $~lib/string/String.__eq i32.eqz @@ -1868,7 +1865,7 @@ unreachable end i32.const 4 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2736 call $~lib/string/String.__eq i32.eqz @@ -1881,7 +1878,7 @@ unreachable end i32.const 1 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1894,7 +1891,7 @@ unreachable end i32.const 3 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1907,7 +1904,7 @@ unreachable end i32.const 1 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1920,7 +1917,7 @@ unreachable end i32.const 3 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1933,7 +1930,7 @@ unreachable end i32.const 2 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1946,7 +1943,7 @@ unreachable end i32.const 2 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1959,7 +1956,7 @@ unreachable end i32.const 0 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1392 call $~lib/string/String.__eq i32.eqz @@ -1972,7 +1969,7 @@ unreachable end i32.const 1 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1985,7 +1982,7 @@ unreachable end i32.const 2 - call $~lib/number/I32#toString + call $~lib/util/number/itoa32 i32.const 1552 call $~lib/string/String.__eq i32.eqz diff --git a/tests/compiler/resolve-elementaccess.optimized.wat b/tests/compiler/resolve-elementaccess.optimized.wat index b36e1a3f7a..1d013692f2 100644 --- a/tests/compiler/resolve-elementaccess.optimized.wat +++ b/tests/compiler/resolve-elementaccess.optimized.wat @@ -9,7 +9,7 @@ (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) @@ -292,6 +292,7 @@ ) (func $~lib/arraybuffer/ArrayBufferView#constructor (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) local.get $0 i32.eqz if @@ -325,25 +326,29 @@ i32.const 2 local.get $1 i32.shl - local.tee $1 + local.tee $3 i32.const 0 call $~lib/rt/stub/__alloc local.tee $2 - local.get $1 + local.get $3 call $~lib/memory/memory.fill local.get $0 + local.tee $1 + local.get $2 + local.tee $0 + local.get $1 i32.load + i32.ne drop local.get $0 - local.get $2 i32.store + local.get $1 local.get $0 - local.get $2 i32.store offset=4 - local.get $0 local.get $1 + local.get $3 i32.store offset=8 - local.get $0 + local.get $1 ) (func $~lib/typedarray/Float32Array#__set (param $0 i32) (param $1 i32) (param $2 f32) local.get $1 @@ -1557,45 +1562,41 @@ i32.const 0 local.get $0 call $~lib/string/String#get:length - local.tee $4 + local.tee $2 + i32.const 0 + local.get $2 i32.lt_s - local.set $2 + select + local.tee $3 local.get $1 i32.const 0 local.get $1 i32.const 0 i32.gt_s select - local.tee $3 - local.get $4 - i32.lt_s - local.set $1 - i32.const 0 - local.get $4 + local.tee $1 local.get $2 - select - local.tee $2 - local.get $3 - local.get $4 local.get $1 - select - local.tee $3 local.get $2 + i32.lt_s + select + local.tee $1 local.get $3 + local.get $1 i32.gt_s select i32.const 1 i32.shl - local.tee $1 - local.get $2 + local.tee $4 local.get $3 - local.get $2 + local.get $1 local.get $3 + local.get $1 i32.lt_s select i32.const 1 i32.shl - local.tee $2 + local.tee $1 i32.sub local.tee $3 i32.eqz @@ -1604,12 +1605,12 @@ return end i32.const 0 - local.get $1 local.get $4 + local.get $2 i32.const 1 i32.shl i32.eq - local.get $2 + local.get $1 select if local.get $0 @@ -1618,110 +1619,103 @@ local.get $3 i32.const 1 call $~lib/rt/stub/__alloc - local.tee $1 + local.tee $2 local.get $0 - local.get $2 + local.get $1 i32.add local.get $3 call $~lib/memory/memory.copy - local.get $1 + local.get $2 ) - (func $~lib/number/F32#toString (param $0 f32) (result i32) + (func $~lib/util/number/dtoa (param $0 f64) (result i32) (local $1 i32) (local $2 i32) - (local $3 f64) - (local $4 i32) - block $__inlined_func$~lib/util/number/dtoa + (local $3 i32) + local.get $0 + f64.const 0 + f64.eq + if + i32.const 1280 + return + end + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.ne + if + local.get $0 local.get $0 - f64.promote_f32 - local.tee $3 - f64.const 0 - f64.eq - if - i32.const 1280 - local.set $1 - br $__inlined_func$~lib/util/number/dtoa - end - local.get $3 - local.get $3 - f64.sub - f64.const 0 f64.ne if - local.get $3 - local.get $3 - f64.ne - if - i32.const 1312 - local.set $1 - br $__inlined_func$~lib/util/number/dtoa - end - i32.const 1344 - i32.const 1392 - local.get $3 - f64.const 0 - f64.lt - select - local.set $1 - br $__inlined_func$~lib/util/number/dtoa + i32.const 1312 + return end - i32.const 56 - i32.const 1 - call $~lib/rt/stub/__alloc - local.tee $1 - local.get $3 - call $~lib/util/number/dtoa_core - local.tee $2 - i32.const 28 - i32.eq - br_if $__inlined_func$~lib/util/number/dtoa - local.get $1 - local.get $2 - call $~lib/string/String#substring - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 + i32.const 1344 + i32.const 1392 + local.get $0 + f64.const 0 + f64.lt select - i32.eqz - if - i32.const 0 - i32.const 2352 - i32.const 68 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.sub - local.tee $4 - i32.load offset=4 - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 2352 - i32.const 70 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/stub/offset + return + end + i32.const 56 + i32.const 1 + call $~lib/rt/stub/__alloc + local.tee $1 + local.get $0 + call $~lib/util/number/dtoa_core + local.tee $2 + i32.const 28 + i32.eq + if local.get $1 - local.get $4 - i32.load - i32.add - i32.eq - if - local.get $4 - global.set $~lib/rt/stub/offset - end - local.set $1 + return end local.get $1 + local.get $2 + call $~lib/string/String#substring + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + select + i32.eqz + if + i32.const 0 + i32.const 2352 + i32.const 68 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.tee $3 + i32.load offset=4 + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 2352 + i32.const 70 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/stub/offset + local.get $1 + local.get $3 + i32.load + i32.add + i32.eq + if + local.get $3 + global.set $~lib/rt/stub/offset + end ) (func $~lib/util/string/compareImpl (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1773,16 +1767,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end @@ -1870,36 +1864,31 @@ i32.add i32.load8_u ) - (func $~lib/number/U8#toString (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - block $__inlined_func$~lib/util/number/utoa32 - local.get $0 - i32.const 255 - i32.and - local.tee $1 - i32.eqz - if - i32.const 2752 - local.set $0 - br $__inlined_func$~lib/util/number/utoa32 - end - local.get $1 - call $~lib/util/number/decimalCount32 - local.tee $2 - i32.const 1 - i32.shl - i32.const 1 - call $~lib/rt/stub/__alloc - local.tee $0 - local.get $1 - local.get $2 - call $~lib/util/number/utoa_dec_simple + local.get $0 + i32.eqz + if + i32.const 2752 + return end local.get $0 + call $~lib/util/number/decimalCount32 + local.tee $1 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/stub/__alloc + local.tee $2 + local.get $0 + local.get $1 + call $~lib/util/number/utoa_dec_simple + local.get $2 ) (func $start:resolve-elementaccess (local $0 i32) + (local $1 i32) i32.const 2960 global.set $~lib/rt/stub/offset i32.const 12 @@ -1919,7 +1908,8 @@ global.get $resolve-elementaccess/arr i32.const 0 call $~lib/typedarray/Float32Array#__get - call $~lib/number/F32#toString + f64.promote_f32 + call $~lib/util/number/dtoa i32.const 2400 call $~lib/string/String.__eq i32.eqz @@ -1934,7 +1924,8 @@ global.get $resolve-elementaccess/arr i32.const 1 call $~lib/typedarray/Float32Array#__get - call $~lib/number/F32#toString + f64.promote_f32 + call $~lib/util/number/dtoa i32.const 2496 call $~lib/string/String.__eq i32.eqz @@ -1958,7 +1949,8 @@ local.get $0 i32.const 0 call $~lib/typedarray/Float32Array#__get - call $~lib/number/F32#toString + f64.promote_f32 + call $~lib/util/number/dtoa i32.const 2528 call $~lib/string/String.__eq i32.eqz @@ -1994,7 +1986,9 @@ i32.const 12 i32.const 4 call $~lib/rt/stub/__alloc - local.tee $0 + local.tee $1 + local.set $0 + local.get $1 if (result i32) local.get $0 else @@ -2016,7 +2010,9 @@ global.get $resolve-elementaccess/buf i32.const 0 call $~lib/typedarray/Uint8Array#__get - call $~lib/number/U8#toString + i32.const 255 + i32.and + call $~lib/util/number/utoa32 i32.const 2880 call $~lib/string/String.__eq i32.eqz @@ -2031,7 +2027,9 @@ global.get $resolve-elementaccess/buf i32.const 1 call $~lib/typedarray/Uint8Array#__get - call $~lib/number/U8#toString + i32.const 255 + i32.and + call $~lib/util/number/utoa32 i32.const 2912 call $~lib/string/String.__eq i32.eqz @@ -2055,7 +2053,9 @@ local.get $0 i32.const 0 call $~lib/typedarray/Uint8Array#__get - call $~lib/number/U8#toString + i32.const 255 + i32.and + call $~lib/util/number/utoa32 i32.const 2944 call $~lib/string/String.__eq i32.eqz diff --git a/tests/compiler/resolve-function-expression.optimized.wat b/tests/compiler/resolve-function-expression.optimized.wat index ee3dd5a1bf..26e7436c4a 100644 --- a/tests/compiler/resolve-function-expression.optimized.wat +++ b/tests/compiler/resolve-function-expression.optimized.wat @@ -133,7 +133,7 @@ local.get $0 i32.const 31 i32.shr_u - local.tee $2 + local.tee $1 if i32.const 0 local.get $0 @@ -180,42 +180,45 @@ i32.const 100000 i32.lt_u select - local.get $2 + local.get $1 i32.add - local.tee $3 + local.tee $2 i32.const 1 i32.shl call $~lib/rt/stub/__alloc - local.tee $4 - local.set $5 + local.tee $3 + local.set $4 loop $do-continue|0 + local.get $0 + i32.const 10 + i32.rem_u + local.set $5 local.get $0 i32.const 10 i32.div_u - local.get $5 - local.get $3 + local.set $0 + local.get $4 + local.get $2 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 1 i32.shl i32.add - local.get $0 - i32.const 10 - i32.rem_u + local.get $5 i32.const 48 i32.add i32.store16 - local.tee $0 + local.get $0 br_if $do-continue|0 end - local.get $2 + local.get $1 if - local.get $4 + local.get $3 i32.const 45 i32.store16 end - local.get $4 + local.get $3 ) (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 @@ -300,7 +303,7 @@ end i32.const 0 ) - (func $start:resolve-function-expression + (func $~start (local $0 i32) (local $1 i32) i32.const 2 @@ -334,32 +337,30 @@ i32.const 1552 global.set $~lib/rt/stub/offset block $__inlined_func$~lib/string/String.__eq (result i32) + i32.const 1 i32.const 0 i32.const 1184 i32.load call_indirect (type $i32_=>_i32) call $~lib/util/number/itoa32 local.tee $0 - local.set $1 - i32.const 1 - local.get $0 i32.const 1536 i32.eq br_if $__inlined_func$~lib/string/String.__eq drop block $folding-inner0 - local.get $1 + local.get $0 i32.eqz br_if $folding-inner0 - local.get $1 + local.get $0 call $~lib/string/String#get:length - local.tee $0 + local.tee $1 i32.const 1536 call $~lib/string/String#get:length i32.ne br_if $folding-inner0 - local.get $1 local.get $0 + local.get $1 call $~lib/util/string/compareImpl i32.eqz br $__inlined_func$~lib/string/String.__eq @@ -376,7 +377,4 @@ unreachable end ) - (func $~start - call $start:resolve-function-expression - ) ) diff --git a/tests/compiler/resolve-propertyaccess.optimized.wat b/tests/compiler/resolve-propertyaccess.optimized.wat index 07f6d62705..c3958b703c 100644 --- a/tests/compiler/resolve-propertyaccess.optimized.wat +++ b/tests/compiler/resolve-propertyaccess.optimized.wat @@ -125,7 +125,7 @@ local.get $0 i32.const 31 i32.shr_u - local.tee $2 + local.tee $1 if i32.const 0 local.get $0 @@ -172,43 +172,46 @@ i32.const 100000 i32.lt_u select - local.get $2 + local.get $1 i32.add - local.tee $3 + local.tee $2 i32.const 1 i32.shl i32.const 1 call $~lib/rt/stub/__alloc - local.tee $4 - local.set $5 + local.tee $3 + local.set $4 loop $do-continue|0 + local.get $0 + i32.const 10 + i32.rem_u + local.set $5 local.get $0 i32.const 10 i32.div_u - local.get $5 - local.get $3 + local.set $0 + local.get $4 + local.get $2 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 1 i32.shl i32.add - local.get $0 - i32.const 10 - i32.rem_u + local.get $5 i32.const 48 i32.add i32.store16 - local.tee $0 + local.get $0 br_if $do-continue|0 end - local.get $2 + local.get $1 if - local.get $4 + local.get $3 i32.const 45 i32.store16 end - local.get $4 + local.get $3 ) (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 @@ -268,16 +271,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end diff --git a/tests/compiler/resolve-unary.optimized.wat b/tests/compiler/resolve-unary.optimized.wat index 1a6b1e62cd..ccc6f2ec40 100644 --- a/tests/compiler/resolve-unary.optimized.wat +++ b/tests/compiler/resolve-unary.optimized.wat @@ -130,7 +130,7 @@ local.get $0 i32.const 31 i32.shr_u - local.tee $2 + local.tee $1 if i32.const 0 local.get $0 @@ -177,43 +177,46 @@ i32.const 100000 i32.lt_u select - local.get $2 + local.get $1 i32.add - local.tee $3 + local.tee $2 i32.const 1 i32.shl i32.const 1 call $~lib/rt/stub/__alloc - local.tee $4 - local.set $5 + local.tee $3 + local.set $4 loop $do-continue|0 + local.get $0 + i32.const 10 + i32.rem_u + local.set $5 local.get $0 i32.const 10 i32.div_u - local.get $5 - local.get $3 + local.set $0 + local.get $4 + local.get $2 i32.const 1 i32.sub - local.tee $3 + local.tee $2 i32.const 1 i32.shl i32.add - local.get $0 - i32.const 10 - i32.rem_u + local.get $5 i32.const 48 i32.add i32.store16 - local.tee $0 + local.get $0 br_if $do-continue|0 end - local.get $2 + local.get $1 if - local.get $4 + local.get $3 i32.const 45 i32.store16 end - local.get $4 + local.get $3 ) (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 @@ -273,16 +276,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index 8c4643e1d0..0dd0696483 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -37,7 +37,6 @@ i32.add i32.load local.tee $0 - local.get $0 i32.eqz if i32.const 1152 @@ -47,6 +46,7 @@ call $~lib/builtins/abort unreachable end + local.get $0 ) (func $std/array-access/i32ArrayArrayElementAccess (param $0 i32) (result i32) i32.const 1 @@ -135,16 +135,16 @@ local.set $2 local.get $0 if - local.get $3 + local.get $1 i32.load16_u local.tee $0 - local.get $1 + local.get $3 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $0 + local.get $4 i32.sub return end @@ -168,26 +168,24 @@ i32.const 0 local.get $0 call $~lib/string/String#get:length - local.tee $2 - i32.lt_s - local.set $1 + local.tee $1 i32.const 0 - local.get $2 local.get $1 + i32.lt_s select - local.tee $1 + local.tee $2 i32.const 1264 call $~lib/string/String#get:length local.tee $3 i32.add - local.get $2 + local.get $1 i32.gt_s if i32.const 0 return end local.get $0 - local.get $1 + local.get $2 local.get $3 call $~lib/util/string/compareImpl i32.eqz diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 67c9dd1483..e6a2d14c26 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -3267,24 +3267,24 @@ i32.const 6 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $1 + local.tee $3 i32.const 16 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - local.get $1 + local.get $3 i32.const 3 i32.store offset=4 - local.get $1 + local.get $3 i32.const 32 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - local.get $1 + local.get $3 i32.const 4 i32.store offset=12 - local.get $1 + local.get $3 i32.const 0 i32.store offset=16 - local.get $1 + local.get $3 i32.const 0 i32.store offset=20 call $~lib/map/Map#constructor @@ -3312,13 +3312,13 @@ i32.load offset=4 i32.add i32.load8_s - local.set $3 + local.set $1 local.get $6 local.get $2 call $~lib/array/Array#__get local.set $7 local.get $0 - local.get $3 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -3343,17 +3343,17 @@ call $~lib/builtins/abort unreachable end - local.get $1 - local.get $3 local.get $3 + local.get $1 + local.get $1 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $5 local.get $7 i32.const 20 i32.sub - local.tee $3 - local.get $3 + local.tee $1 + local.get $1 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $2 @@ -3363,7 +3363,7 @@ br $for-loop|4 end end - local.get $1 + local.get $3 i32.load offset=20 i32.const 100 i32.ne @@ -3556,7 +3556,7 @@ call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release - local.get $1 + local.get $3 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release @@ -4481,24 +4481,24 @@ i32.const 10 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $1 + local.tee $3 i32.const 16 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - local.get $1 + local.get $3 i32.const 3 i32.store offset=4 - local.get $1 + local.get $3 i32.const 32 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - local.get $1 + local.get $3 i32.const 4 i32.store offset=12 - local.get $1 + local.get $3 i32.const 0 i32.store offset=16 - local.get $1 + local.get $3 i32.const 0 i32.store offset=20 call $~lib/map/Map#constructor @@ -4526,13 +4526,13 @@ i32.load offset=4 i32.add i32.load8_u - local.set $3 + local.set $1 local.get $6 local.get $2 call $~lib/array/Array#__get local.set $7 local.get $0 - local.get $3 + local.get $1 call $~lib/map/Map#has i32.eqz if @@ -4557,17 +4557,17 @@ call $~lib/builtins/abort unreachable end - local.get $1 - local.get $3 local.get $3 + local.get $1 + local.get $1 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $5 local.get $7 i32.const 20 i32.sub - local.tee $3 - local.get $3 + local.tee $1 + local.get $1 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $2 @@ -4577,7 +4577,7 @@ br $for-loop|4 end end - local.get $1 + local.get $3 i32.load offset=20 i32.const 100 i32.ne @@ -4762,7 +4762,7 @@ call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release - local.get $1 + local.get $3 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release diff --git a/tests/compiler/std/object.optimized.wat b/tests/compiler/std/object.optimized.wat index 856757bab1..72bd4a876d 100644 --- a/tests/compiler/std/object.optimized.wat +++ b/tests/compiler/std/object.optimized.wat @@ -122,16 +122,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 49e1f223da..86c25b7325 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -1122,12 +1122,10 @@ global.set $std/operator-overloading/incdec global.get $std/operator-overloading/incdec local.tee $0 + local.get $0 i32.load i32.const 1 i32.add - local.set $1 - local.get $0 - local.get $1 i32.store local.get $0 local.get $0 @@ -1160,12 +1158,10 @@ end global.get $std/operator-overloading/incdec local.tee $0 + local.get $0 i32.load i32.const 1 i32.sub - local.set $1 - local.get $0 - local.get $1 i32.store local.get $0 local.get $0 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 35c2d5f686..3262d35021 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -353,11 +353,11 @@ local.get $3 i32.lt_u if + local.get $1 local.get $0 local.get $2 i32.add i32.load8_u - local.get $1 i32.xor i32.const 16777619 i32.mul @@ -422,16 +422,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end @@ -491,31 +491,31 @@ i32.shl i32.add i32.load - local.set $0 + local.set $1 loop $while-continue|0 - local.get $0 + local.get $1 if - local.get $0 + local.get $1 i32.load offset=8 i32.const 1 i32.and if (result i32) i32.const 0 else - local.get $0 + local.get $1 i32.load i32.const 1040 call $~lib/string/String.__eq end if - local.get $0 + local.get $1 return end - local.get $0 + local.get $1 i32.load offset=8 i32.const -2 i32.and - local.set $0 + local.set $1 br $while-continue|0 end end @@ -536,61 +536,61 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $4 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $6 + local.tee $7 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $4 + local.tee $8 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $7 + local.set $6 local.get $3 local.set $2 loop $while-continue|0 - local.get $4 - local.get $7 + local.get $6 + local.get $8 i32.ne if - local.get $4 + local.get $8 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $4 + local.get $8 i32.load i32.store local.get $2 - local.get $4 + local.get $8 i32.load offset=4 i32.store offset=4 local.get $2 local.get $4 + local.get $8 i32.load call $~lib/util/hash/hashStr local.get $1 i32.and i32.const 2 i32.shl - local.get $5 i32.add - local.tee $8 + local.tee $5 i32.load i32.store offset=8 - local.get $8 + local.get $5 local.get $2 i32.store local.get $2 @@ -598,33 +598,41 @@ i32.add local.set $2 end - local.get $4 + local.get $8 i32.const 12 i32.add - local.set $4 + local.set $8 br $while-continue|0 end end local.get $0 + local.set $2 + local.get $4 + local.tee $0 + local.get $2 i32.load + i32.ne drop + local.get $2 local.get $0 - local.get $5 i32.store - local.get $0 + local.get $2 local.get $1 i32.store offset=4 - local.get $0 + local.get $3 + local.tee $0 + local.get $2 i32.load offset=8 + i32.ne drop + local.get $2 local.get $0 - local.get $3 i32.store offset=8 - local.get $0 - local.get $6 + local.get $2 + local.get $7 i32.store offset=12 - local.get $0 - local.get $0 + local.get $2 + local.get $2 i32.load offset=20 i32.store offset=16 ) @@ -802,61 +810,61 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + local.set $4 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $6 + local.tee $7 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $4 + local.tee $8 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $7 + local.set $6 local.get $3 local.set $2 loop $while-continue|0 - local.get $4 - local.get $7 + local.get $6 + local.get $8 i32.ne if - local.get $4 + local.get $8 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $4 + local.get $8 i32.load i32.store local.get $2 - local.get $4 + local.get $8 i32.load offset=4 i32.store offset=4 local.get $2 local.get $4 + local.get $8 i32.load call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 i32.shl - local.get $5 i32.add - local.tee $8 + local.tee $5 i32.load i32.store offset=8 - local.get $8 + local.get $5 local.get $2 i32.store local.get $2 @@ -864,33 +872,41 @@ i32.add local.set $2 end - local.get $4 + local.get $8 i32.const 12 i32.add - local.set $4 + local.set $8 br $while-continue|0 end end local.get $0 + local.set $2 + local.get $4 + local.tee $0 + local.get $2 i32.load + i32.ne drop + local.get $2 local.get $0 - local.get $5 i32.store - local.get $0 + local.get $2 local.get $1 i32.store offset=4 - local.get $0 + local.get $3 + local.tee $0 + local.get $2 i32.load offset=8 + i32.ne drop + local.get $2 local.get $0 - local.get $3 i32.store offset=8 - local.get $0 - local.get $6 + local.get $2 + local.get $7 i32.store offset=12 - local.get $0 - local.get $0 + local.get $2 + local.get $2 i32.load offset=20 i32.store offset=16 ) @@ -1425,7 +1441,6 @@ ) (func $start:std/symbol (local $0 i32) - (local $1 i32) call $~lib/symbol/Symbol global.set $std/symbol/sym1 call $~lib/symbol/Symbol @@ -1485,7 +1500,6 @@ global.get $std/symbol/sym3 call $~lib/symbol/_Symbol.keyFor local.tee $0 - local.get $0 i32.eqz if i32.const 1344 @@ -1495,11 +1509,11 @@ call $~lib/builtins/abort unreachable end + local.get $0 global.set $std/symbol/key3 global.get $std/symbol/sym4 call $~lib/symbol/_Symbol.keyFor local.tee $0 - local.get $0 i32.eqz if i32.const 1344 @@ -1509,6 +1523,7 @@ call $~lib/builtins/abort unreachable end + local.get $0 global.set $std/symbol/key4 global.get $std/symbol/key3 i32.const 1040 diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 5294e75c64..f78799fc91 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -29437,15 +29437,15 @@ (local $14 i32) i32.const 3 call $~lib/typedarray/Int64Array#constructor - local.tee $7 + local.tee $6 i32.const 0 i64.const 7 call $~lib/typedarray/Int64Array#__set - local.get $7 + local.get $6 i32.const 1 i64.const 8 call $~lib/typedarray/Int64Array#__set - local.get $7 + local.get $6 i32.const 2 i64.const 9 call $~lib/typedarray/Int64Array#__set @@ -29469,93 +29469,95 @@ call $~lib/typedarray/Uint8Array#__set i32.const 3 call $~lib/typedarray/Int16Array#constructor - local.tee $8 + local.tee $7 i32.const 0 i32.const 1000 call $~lib/typedarray/Int16Array#__set - local.get $8 + local.get $7 i32.const 1 i32.const 1001 call $~lib/typedarray/Int16Array#__set - local.get $8 + local.get $7 i32.const 2 i32.const 1002 call $~lib/typedarray/Int16Array#__set i32.const 10 call $~lib/typedarray/Float64Array#constructor - local.tee $13 + local.tee $14 call $~lib/rt/pure/__retain - local.tee $3 + local.tee $0 call $~lib/rt/pure/__retain - local.set $1 - block $folding-inner1 + local.set $2 + block $folding-inner0 i32.const 8496 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=12 - local.get $1 + local.get $2 i32.load offset=8 i32.const 3 i32.shr_u i32.gt_s - br_if $folding-inner1 - local.get $1 - i32.load offset=4 - local.set $4 + br_if $folding-inner0 local.get $2 i32.load offset=4 + local.set $8 + local.get $3 + i32.load offset=4 local.set $9 - local.get $2 + local.get $3 i32.load offset=12 - local.set $6 + local.set $10 loop $for-loop|0 - local.get $0 - local.get $6 + local.get $1 + local.get $10 i32.lt_s if - local.get $4 - local.get $0 + local.get $8 + local.get $1 i32.const 3 i32.shl i32.add local.get $9 - local.get $0 + local.get $1 i32.const 2 i32.shl i32.add i32.load f64.convert_i32_s f64.store - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|0 end end - local.get $2 + local.get $3 call $~lib/rt/pure/__release - local.get $1 + local.get $2 call $~lib/rt/pure/__release i32.const 8496 call $~lib/rt/pure/__release - local.get $3 + local.get $0 i32.const 10 i32.const 3 i32.const 62 i32.const 12048 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $9 + local.tee $8 call $std/typedarray/valuesEqual<~lib/typedarray/Float64Array> + local.get $0 + local.set $1 i32.const 0 - local.set $0 - local.get $3 + local.set $2 + local.get $1 call $~lib/rt/pure/__retain local.set $1 i32.const 8560 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=12 i32.const 3 i32.add @@ -29564,62 +29566,69 @@ i32.const 3 i32.shr_u i32.gt_s - br_if $folding-inner1 + if + i32.const 1376 + i32.const 1440 + i32.const 1775 + i32.const 47 + call $~lib/builtins/abort + unreachable + end local.get $1 i32.load offset=4 i32.const 24 i32.add local.set $4 - local.get $2 + local.get $3 i32.load offset=4 - local.set $6 - local.get $2 + local.set $9 + local.get $3 i32.load offset=12 local.set $10 loop $for-loop|00 - local.get $0 + local.get $2 local.get $10 i32.lt_s if local.get $4 - local.get $0 + local.get $2 i32.const 3 i32.shl i32.add - local.get $6 - local.get $0 + local.get $9 + local.get $2 i32.const 2 i32.shl i32.add f32.load f64.promote_f32 f64.store - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|00 end end - local.get $2 + local.get $3 call $~lib/rt/pure/__release local.get $1 call $~lib/rt/pure/__release i32.const 8560 call $~lib/rt/pure/__release - local.get $3 + local.get $0 i32.const 10 i32.const 3 i32.const 62 i32.const 12192 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $6 + local.tee $9 call $std/typedarray/valuesEqual<~lib/typedarray/Float64Array> - local.get $3 - local.get $7 + local.get $0 + local.get $6 call $~lib/typedarray/Float64Array#set<~lib/typedarray/Int64Array> - local.get $3 + local.get $0 i32.const 10 i32.const 3 i32.const 62 @@ -29629,145 +29638,145 @@ local.tee $10 call $std/typedarray/valuesEqual<~lib/typedarray/Float64Array> i32.const 0 - local.set $0 + local.set $1 local.get $5 call $~lib/rt/pure/__retain local.set $4 - local.get $3 + local.get $0 call $~lib/rt/pure/__retain - local.set $1 + local.set $2 local.get $4 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=8 - local.get $1 + local.get $2 i32.load offset=8 i32.const 3 i32.shr_u i32.gt_s - br_if $folding-inner1 - local.get $1 + br_if $folding-inner0 + local.get $2 i32.load offset=4 local.set $11 - local.get $2 + local.get $3 i32.load offset=4 local.set $12 - local.get $2 + local.get $3 i32.load offset=8 - local.set $14 + local.set $13 loop $for-loop|001 - local.get $0 - local.get $14 + local.get $1 + local.get $13 i32.lt_s if local.get $11 - local.get $0 + local.get $1 i32.const 3 i32.shl i32.add - local.get $0 + local.get $1 local.get $12 i32.add i32.load8_u f64.convert_i32_u f64.store - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|001 end end - local.get $2 + local.get $3 call $~lib/rt/pure/__release - local.get $1 + local.get $2 call $~lib/rt/pure/__release local.get $4 call $~lib/rt/pure/__release - local.get $3 - local.get $8 + local.get $0 + local.get $7 call $~lib/typedarray/Float64Array#set<~lib/typedarray/Int16Array> i32.const 0 - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain local.set $1 + local.get $0 + call $~lib/rt/pure/__retain + local.set $2 i32.const 8704 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=12 i32.const 7 i32.add - local.get $1 + local.get $2 i32.load offset=8 i32.const 3 i32.shr_u i32.gt_s - br_if $folding-inner1 - local.get $1 + br_if $folding-inner0 + local.get $2 i32.load offset=4 i32.const 56 i32.add - local.set $4 - local.get $2 - i32.load offset=4 local.set $11 - local.get $2 - i32.load offset=12 + local.get $3 + i32.load offset=4 local.set $12 + local.get $3 + i32.load offset=12 + local.set $13 loop $for-loop|01 - local.get $0 - local.get $12 + local.get $1 + local.get $13 i32.lt_s if - local.get $4 - local.get $0 + local.get $11 + local.get $1 i32.const 3 i32.shl i32.add - local.get $0 - local.get $11 + local.get $1 + local.get $12 i32.add i32.load8_s f64.convert_i32_s f64.store - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|01 end end - local.get $2 + local.get $3 call $~lib/rt/pure/__release - local.get $1 + local.get $2 call $~lib/rt/pure/__release i32.const 8704 call $~lib/rt/pure/__release - local.get $3 + local.get $0 i32.const 10 i32.const 3 i32.const 62 i32.const 12384 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $0 + local.tee $1 call $std/typedarray/valuesEqual<~lib/typedarray/Float64Array> - local.get $0 + local.get $1 call $~lib/rt/pure/__release - local.get $7 + local.get $6 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release - local.get $8 + local.get $7 call $~lib/rt/pure/__release - local.get $13 + local.get $14 call $~lib/rt/pure/__release - local.get $3 + local.get $0 call $~lib/rt/pure/__release - local.get $9 + local.get $8 call $~lib/rt/pure/__release - local.get $6 + local.get $9 call $~lib/rt/pure/__release local.get $10 call $~lib/rt/pure/__release diff --git a/tests/compiler/super-inline.optimized.wat b/tests/compiler/super-inline.optimized.wat index 3a7a9f164b..d310e637fb 100644 --- a/tests/compiler/super-inline.optimized.wat +++ b/tests/compiler/super-inline.optimized.wat @@ -93,7 +93,7 @@ i32.sub i32.load i32.const 4 - i32.ne + i32.eq br_if $__inlined_func$super-inline/Foo#a@virtual end i32.const 4 diff --git a/tests/compiler/typeof.optimized.wat b/tests/compiler/typeof.optimized.wat index b51c195178..94996de87f 100644 --- a/tests/compiler/typeof.optimized.wat +++ b/tests/compiler/typeof.optimized.wat @@ -76,16 +76,16 @@ local.set $2 local.get $3 if - local.get $0 + local.get $1 i32.load16_u local.tee $3 - local.get $1 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $3 local.get $4 + local.get $3 i32.sub return end diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index 264ec7194d..a435f39325 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1696,76 +1696,71 @@ (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) call $~lib/string/String.UTF8.byteLength - local.tee $7 - i32.const 56 - i32.gt_s - local.set $6 - local.get $7 + local.tee $6 i32.const 56 local.get $6 + i32.const 56 + i32.gt_s select i32.const 13 i32.add call $~lib/rt/stub/__alloc - local.tee $7 + local.tee $6 i32.const 8 i32.add local.tee $8 i32.const 4 i32.add - local.set $6 - local.get $7 + local.set $7 local.get $6 + local.get $7 i32.store - local.get $6 + local.get $7 i64.const 9071406388179572 i64.store - local.get $7 + local.get $6 i32.const 7 i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop - local.get $7 + local.get $6 i32.const 1040 i32.const 1040 call $~lib/string/String#get:length - local.get $6 + local.get $7 call $~lib/string/String.UTF8.encodeUnsafe i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop local.get $0 if (result i32) - local.get $6 + local.get $7 i32.const 32 i32.store8 local.get $6 + local.get $7 i32.const 1 i32.add - local.tee $6 + local.tee $7 + local.get $7 local.get $1 call $~lib/util/number/dtoa_buffered - local.set $9 local.get $7 - local.get $6 - local.get $9 - local.get $6 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1774,18 +1769,18 @@ i32.const 1 i32.gt_s if - local.get $7 - local.get $6 local.get $6 + local.get $7 + local.get $7 local.get $2 call $~lib/util/number/dtoa_buffered - local.get $6 + local.get $7 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1794,18 +1789,18 @@ i32.const 2 i32.gt_s if - local.get $7 - local.get $6 local.get $6 + local.get $7 + local.get $7 local.get $3 call $~lib/util/number/dtoa_buffered - local.get $6 + local.get $7 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1814,18 +1809,18 @@ i32.const 3 i32.gt_s if - local.get $7 - local.get $6 local.get $6 + local.get $7 + local.get $7 local.get $4 call $~lib/util/number/dtoa_buffered - local.get $6 + local.get $7 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1834,18 +1829,18 @@ i32.const 4 i32.gt_s if - local.get $7 - local.get $6 local.get $6 + local.get $7 + local.get $7 local.get $5 call $~lib/util/number/dtoa_buffered - local.get $6 + local.get $7 call $~lib/string/String.UTF8.encodeUnsafe i32.const 1 i32.add i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write @@ -1854,29 +1849,29 @@ end end end - local.get $6 + local.get $7 i32.const 1 i32.sub else - local.get $6 + local.get $7 end i32.const 10 i32.store8 - local.get $7 + local.get $6 i32.const 1 i32.store offset=4 i32.const 2 - local.get $7 + local.get $6 i32.const 1 local.get $8 call $~lib/bindings/wasi_snapshot_preview1/fd_write drop - local.get $7 + local.get $6 i32.const 15 i32.and i32.eqz i32.const 0 - local.get $7 + local.get $6 select i32.eqz if @@ -1885,7 +1880,7 @@ call $~lib/wasi/index/abort unreachable end - local.get $7 + local.get $6 i32.const 16 i32.sub local.tee $0 @@ -1899,7 +1894,7 @@ unreachable end global.get $~lib/rt/stub/offset - local.get $7 + local.get $6 local.get $0 i32.load i32.add From 4fdef72cd233775a0b02a8202fa5871762440a33 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 11 Oct 2020 20:13:29 +0300 Subject: [PATCH 3/9] better --- src/module.ts | 4 +-- tests/compiler/loop-flow.optimized.wat | 36 ++++++++++---------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/module.ts b/src/module.ts index 252081502c..c0fe766753 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1546,12 +1546,12 @@ export class Module { // passes.push("post-assemblyscript"); // } passes.push("optimize-instructions"); - passes.push("remove-unused-brs"); - passes.push("remove-unused-names"); if (optimizeLevel >= 3 || shrinkLevel >= 1) { passes.push("dce"); passes.push("inlining"); } + passes.push("remove-unused-brs"); + passes.push("remove-unused-names"); if (optimizeLevel >= 3 || shrinkLevel >= 2) { passes.push("precompute-propagate"); } else { diff --git a/tests/compiler/loop-flow.optimized.wat b/tests/compiler/loop-flow.optimized.wat index 67d6226c88..638f2185d5 100644 --- a/tests/compiler/loop-flow.optimized.wat +++ b/tests/compiler/loop-flow.optimized.wat @@ -35,17 +35,13 @@ if local.get $0 i32.const 2 - i32.eq - if - i32.const 1088 - i32.const 1040 - i32.const 24 - i32.const 22 - call $~lib/builtins/abort - unreachable - else - br $while-continue|0 - end + i32.ne + br_if $while-continue|0 + i32.const 1088 + i32.const 1040 + i32.const 24 + i32.const 22 + call $~lib/builtins/abort unreachable end end @@ -89,17 +85,13 @@ if local.get $0 i32.const 2 - i32.eq - if - i32.const 1088 - i32.const 1040 - i32.const 78 - i32.const 22 - call $~lib/builtins/abort - unreachable - else - br $do-continue|0 - end + i32.ne + br_if $do-continue|0 + i32.const 1088 + i32.const 1040 + i32.const 78 + i32.const 22 + call $~lib/builtins/abort unreachable end end From a67e7cdf07c923e90a7967bcc2794ea2fe7e296e Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 11 Oct 2020 20:15:42 +0300 Subject: [PATCH 4/9] revert inline position --- src/module.ts | 2 +- tests/compiler/assert-nonnull.optimized.wat | 12 +- tests/compiler/builtins.optimized.wat | 6 +- .../compiler/class-overloading.optimized.wat | 6 +- tests/compiler/class.optimized.wat | 3 +- .../field-initialization.optimized.wat | 6 +- .../function-expression.optimized.wat | 153 ++++++++---------- tests/compiler/infer-array.optimized.wat | 40 +++-- tests/compiler/number.optimized.wat | 85 +++++----- tests/compiler/resolve-binary.optimized.wat | 127 ++++++++------- .../resolve-elementaccess.optimized.wat | 80 +++++---- .../resolve-function-expression.optimized.wat | 11 +- .../resolve-propertyaccess.optimized.wat | 6 +- tests/compiler/resolve-unary.optimized.wat | 6 +- tests/compiler/std/array-access.optimized.wat | 6 +- tests/compiler/std/map.optimized.wat | 56 +++---- tests/compiler/std/object.optimized.wat | 6 +- .../std/operator-overloading.optimized.wat | 4 +- tests/compiler/std/symbol.optimized.wat | 122 +++++++------- tests/compiler/typeof.optimized.wat | 6 +- 20 files changed, 356 insertions(+), 387 deletions(-) diff --git a/src/module.ts b/src/module.ts index c0fe766753..ba0660b0de 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1548,11 +1548,11 @@ export class Module { passes.push("optimize-instructions"); if (optimizeLevel >= 3 || shrinkLevel >= 1) { passes.push("dce"); - passes.push("inlining"); } passes.push("remove-unused-brs"); passes.push("remove-unused-names"); if (optimizeLevel >= 3 || shrinkLevel >= 2) { + passes.push("inlining"); passes.push("precompute-propagate"); } else { passes.push("precompute"); diff --git a/tests/compiler/assert-nonnull.optimized.wat b/tests/compiler/assert-nonnull.optimized.wat index 3714a533bc..288016c276 100644 --- a/tests/compiler/assert-nonnull.optimized.wat +++ b/tests/compiler/assert-nonnull.optimized.wat @@ -136,16 +136,18 @@ local.get $0 ) (func $assert-nonnull/testAll (param $0 i32) (result i32) + (local $1 i32) block $folding-inner0 local.get $0 + local.tee $1 i32.eqz br_if $folding-inner0 - local.get $0 + local.get $1 call $~lib/array/Array#__get local.tee $0 + local.get $0 i32.eqz br_if $folding-inner0 - local.get $0 i32.load local.tee $0 i32.eqz @@ -161,16 +163,18 @@ unreachable ) (func $assert-nonnull/testAll2 (param $0 i32) (result i32) + (local $1 i32) block $folding-inner0 local.get $0 + local.tee $1 i32.eqz br_if $folding-inner0 - local.get $0 + local.get $1 call $~lib/array/Array#__get local.tee $0 + local.get $0 i32.eqz br_if $folding-inner0 - local.get $0 i32.load local.tee $0 i32.eqz diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index 0807f4df17..e522385f05 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -107,16 +107,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end diff --git a/tests/compiler/class-overloading.optimized.wat b/tests/compiler/class-overloading.optimized.wat index 26fd01a7b6..9f337184e4 100644 --- a/tests/compiler/class-overloading.optimized.wat +++ b/tests/compiler/class-overloading.optimized.wat @@ -163,16 +163,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index 125955a409..2b4cd885ea 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -140,10 +140,9 @@ i32.const 0 i32.const 0 call $~lib/rt/stub/__alloc - local.tee $1 + local.set $1 local.get $0 i32.load - i32.ne drop local.get $0 local.get $1 diff --git a/tests/compiler/field-initialization.optimized.wat b/tests/compiler/field-initialization.optimized.wat index d5a22b76ef..6f20599bb8 100644 --- a/tests/compiler/field-initialization.optimized.wat +++ b/tests/compiler/field-initialization.optimized.wat @@ -193,16 +193,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end diff --git a/tests/compiler/function-expression.optimized.wat b/tests/compiler/function-expression.optimized.wat index 3363405e5f..9384556cdd 100644 --- a/tests/compiler/function-expression.optimized.wat +++ b/tests/compiler/function-expression.optimized.wat @@ -26,7 +26,6 @@ (data (i32.const 1600) "\08\00\00\00\01\00\00\00\07\00\00\00\08\00\00\00\11") (table $0 18 funcref) (elem (i32.const 1) $start:function-expression~anonymous|0 $start:function-expression~anonymous|0 $start:function-expression~someName $start:function-expression~anonymous|2 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $start:function-expression~anonymous|3 $start:function-expression~anonymous|4 $start:function-expression~anonymous|5 $start:function-expression~anonymous|2 $function-expression/testGlobal~anonymous|0~anonymous|0 $function-expression/testGlobal~anonymous|0 $function-expression/testGlobal~anonymous|0~anonymous|0 $function-expression/testLocal~anonymous|0 $function-expression/testGlobal~anonymous|0~anonymous|0 $function-expression/testField~anonymous|0) - (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) (start $~start) (func $start:function-expression~anonymous|0 (param $0 i32) (result i32) @@ -70,92 +69,9 @@ (func $function-expression/testField~anonymous|0 (result i32) i32.const 1584 ) - (func $function-expression/testField + (func $start:function-expression (local $0 i32) (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/rt/stub/offset - i32.const 16 - i32.add - local.tee $2 - i32.const 16 - i32.add - local.tee $0 - memory.size - local.tee $3 - i32.const 16 - i32.shl - local.tee $1 - i32.gt_u - if - local.get $3 - local.get $0 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.tee $1 - local.get $3 - local.get $1 - i32.gt_s - select - memory.grow - i32.const 0 - i32.lt_s - if - local.get $1 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $0 - global.set $~lib/rt/stub/offset - local.get $2 - i32.const 16 - i32.sub - local.tee $0 - i32.const 16 - i32.store - local.get $0 - i32.const 1 - i32.store offset=4 - local.get $0 - i32.const 8 - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $2 - i32.const 1616 - i32.store - i32.const 1 - local.get $2 - i32.load - i32.load - call_indirect (type $none_=>_i32) - i32.load - call_indirect (type $i32_=>_i32) - i32.const 25 - i32.ne - if - i32.const 0 - i32.const 1072 - i32.const 82 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - ) - (func $start:function-expression i32.const 1 i32.const 1040 i32.load @@ -313,9 +229,72 @@ call $~lib/builtins/abort unreachable end + i32.const 1664 + memory.size + local.tee $1 + i32.const 16 + i32.shl + local.tee $0 + i32.gt_u + if + local.get $1 + i32.const 67199 + local.get $0 + i32.sub + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $0 + local.get $1 + local.get $0 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $0 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end i32.const 1632 - global.set $~lib/rt/stub/offset - call $function-expression/testField + i32.const 16 + i32.store + i32.const 1636 + i32.const 1 + i32.store + i32.const 1640 + i32.const 8 + i32.store + i32.const 1644 + i32.const 4 + i32.store + i32.const 1648 + i32.const 1616 + i32.store + i32.const 1 + i32.const 1648 + i32.load + i32.load + call_indirect (type $none_=>_i32) + i32.load + call_indirect (type $i32_=>_i32) + i32.const 25 + i32.ne + if + i32.const 0 + i32.const 1072 + i32.const 82 + i32.const 3 + call $~lib/builtins/abort + unreachable + end ) (func $~start call $start:function-expression diff --git a/tests/compiler/infer-array.optimized.wat b/tests/compiler/infer-array.optimized.wat index 9a64104c04..ddcc193399 100644 --- a/tests/compiler/infer-array.optimized.wat +++ b/tests/compiler/infer-array.optimized.wat @@ -288,7 +288,6 @@ (func $~lib/rt/__allocArray (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) - (local $6 i32) i32.const 16 local.get $2 call $~lib/rt/stub/__alloc @@ -296,26 +295,27 @@ local.get $0 local.get $1 i32.shl - local.tee $4 - local.set $6 - local.get $4 + local.tee $1 + local.set $5 + local.get $1 i32.const 0 call $~lib/rt/stub/__alloc - local.set $1 + local.set $4 local.get $3 if - local.get $1 + local.get $4 local.get $3 - local.get $6 + local.get $5 call $~lib/memory/memory.copy end - local.get $1 + local.get $4 + local.tee $3 i32.store local.get $2 - local.get $1 + local.get $3 i32.store offset=4 local.get $2 - local.get $4 + local.get $1 i32.store offset=8 local.get $2 local.get $0 @@ -340,20 +340,18 @@ i32.const 1184 call $~lib/rt/__allocArray drop - i32.const 2 - i32.const 2 - i32.const 5 - i32.const 1232 - call $~lib/rt/__allocArray - local.tee $0 - local.set $1 block $folding-inner0 i32.const 1 - local.get $0 + i32.const 2 + i32.const 2 + i32.const 5 + i32.const 1232 + call $~lib/rt/__allocArray + local.tee $0 i32.load offset=12 i32.ge_u br_if $folding-inner0 - local.get $1 + local.get $0 i32.load offset=4 i32.load offset=4 i32.const -1 @@ -372,17 +370,17 @@ i32.const 1312 call $~lib/rt/__allocArray drop + i32.const 1 i32.const 3 i32.const 2 i32.const 6 i32.const 1360 call $~lib/rt/__allocArray local.tee $0 - i32.const 1 - local.get $0 i32.load offset=12 i32.ge_u br_if $folding-inner0 + local.get $0 i32.load offset=4 f32.load offset=4 drop diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index f30b32e7b8..11b3187dab 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -193,45 +193,44 @@ br_if $do-continue|0 end ) - (func $~lib/util/number/itoa32 (param $0 i32) (result i32) + (func $~lib/number/I32#toString (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 - i32.eqz - if - i32.const 1232 - return - end - local.get $0 - i32.const 31 - i32.shr_u - local.tee $1 - if - i32.const 0 + if (result i32) local.get $0 - i32.sub - local.set $0 - end - local.get $0 - call $~lib/util/number/decimalCount32 - local.get $1 - i32.add - local.tee $3 - i32.const 1 - i32.shl - call $~lib/rt/stub/__alloc - local.tee $2 - local.get $0 - local.get $3 - call $~lib/util/number/utoa_dec_simple - local.get $1 - if + i32.const 31 + i32.shr_u + local.tee $1 + if + i32.const 0 + local.get $0 + i32.sub + local.set $0 + end + local.get $0 + call $~lib/util/number/decimalCount32 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.shl + call $~lib/rt/stub/__alloc + local.tee $2 + local.get $0 + local.get $3 + call $~lib/util/number/utoa_dec_simple + local.get $1 + if + local.get $2 + i32.const 45 + i32.store16 + end local.get $2 - i32.const 45 - i32.store16 + else + i32.const 1232 end - local.get $2 ) (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 @@ -291,16 +290,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end @@ -1456,7 +1455,7 @@ i32.const 2768 global.set $~lib/rt/stub/offset global.get $number/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1360 call $~lib/string/String.__eq i32.eqz @@ -1481,7 +1480,7 @@ unreachable end i32.const 3 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2592 call $~lib/string/String.__eq i32.eqz @@ -1494,7 +1493,7 @@ unreachable end i32.const -5 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2624 call $~lib/string/String.__eq i32.eqz @@ -1507,7 +1506,7 @@ unreachable end i32.const 4 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2656 call $~lib/string/String.__eq i32.eqz @@ -1524,7 +1523,7 @@ i32.add global.set $number/a global.get $number/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2688 call $~lib/string/String.__eq i32.eqz @@ -1541,7 +1540,7 @@ i32.sub global.set $number/a global.get $number/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1360 call $~lib/string/String.__eq i32.eqz @@ -1583,7 +1582,7 @@ i32.add global.set $number/a local.get $0 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1360 call $~lib/string/String.__eq i32.eqz @@ -1601,7 +1600,7 @@ i32.sub global.set $number/a local.get $0 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2688 call $~lib/string/String.__eq i32.eqz diff --git a/tests/compiler/resolve-binary.optimized.wat b/tests/compiler/resolve-binary.optimized.wat index a31266088f..8f9893eb0c 100644 --- a/tests/compiler/resolve-binary.optimized.wat +++ b/tests/compiler/resolve-binary.optimized.wat @@ -111,16 +111,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end @@ -322,46 +322,45 @@ br_if $do-continue|0 end ) - (func $~lib/util/number/itoa32 (param $0 i32) (result i32) + (func $~lib/number/I32#toString (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 - i32.eqz - if - i32.const 1392 - return - end - local.get $0 - i32.const 31 - i32.shr_u - local.tee $1 - if - i32.const 0 + if (result i32) local.get $0 - i32.sub - local.set $0 - end - local.get $0 - call $~lib/util/number/decimalCount32 - local.get $1 - i32.add - local.tee $3 - i32.const 1 - i32.shl - i32.const 1 - call $~lib/rt/stub/__alloc - local.tee $2 - local.get $0 - local.get $3 - call $~lib/util/number/utoa_dec_simple - local.get $1 - if + i32.const 31 + i32.shr_u + local.tee $1 + if + i32.const 0 + local.get $0 + i32.sub + local.set $0 + end + local.get $0 + call $~lib/util/number/decimalCount32 + local.get $1 + i32.add + local.tee $3 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/stub/__alloc + local.tee $2 + local.get $0 + local.get $3 + call $~lib/util/number/utoa_dec_simple + local.get $1 + if + local.get $2 + i32.const 45 + i32.store16 + end local.get $2 - i32.const 45 - i32.store16 + else + i32.const 1392 end - local.get $2 ) (func $~lib/util/number/genDigits (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (result i32) (local $6 i32) @@ -1522,7 +1521,7 @@ i32.const 1 global.set $resolve-binary/a i32.const 1 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1539,7 +1538,7 @@ i32.add global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1556,7 +1555,7 @@ i32.sub global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1573,7 +1572,7 @@ i32.shl global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1602,7 +1601,7 @@ i32.const 2 global.set $resolve-binary/a i32.const 2 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1619,7 +1618,7 @@ i32.rem_s global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1636,7 +1635,7 @@ i32.shl global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2736 call $~lib/string/String.__eq i32.eqz @@ -1653,7 +1652,7 @@ i32.shr_s global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1670,7 +1669,7 @@ i32.shr_u global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1687,7 +1686,7 @@ i32.and global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1704,7 +1703,7 @@ i32.or global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1721,7 +1720,7 @@ i32.xor global.set $resolve-binary/a global.get $resolve-binary/a - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1734,7 +1733,7 @@ unreachable end i32.const 3 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1747,7 +1746,7 @@ unreachable end i32.const -1 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2800 call $~lib/string/String.__eq i32.eqz @@ -1760,7 +1759,7 @@ unreachable end i32.const 2 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1773,7 +1772,7 @@ unreachable end i32.const 2 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1786,7 +1785,7 @@ unreachable end i32.const 1 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1828,7 +1827,7 @@ end end local.get $2 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2736 call $~lib/string/String.__eq i32.eqz @@ -1865,7 +1864,7 @@ unreachable end i32.const 4 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2736 call $~lib/string/String.__eq i32.eqz @@ -1878,7 +1877,7 @@ unreachable end i32.const 1 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1891,7 +1890,7 @@ unreachable end i32.const 3 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1904,7 +1903,7 @@ unreachable end i32.const 1 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1917,7 +1916,7 @@ unreachable end i32.const 3 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 2768 call $~lib/string/String.__eq i32.eqz @@ -1930,7 +1929,7 @@ unreachable end i32.const 2 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1943,7 +1942,7 @@ unreachable end i32.const 2 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz @@ -1956,7 +1955,7 @@ unreachable end i32.const 0 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1392 call $~lib/string/String.__eq i32.eqz @@ -1969,7 +1968,7 @@ unreachable end i32.const 1 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1520 call $~lib/string/String.__eq i32.eqz @@ -1982,7 +1981,7 @@ unreachable end i32.const 2 - call $~lib/util/number/itoa32 + call $~lib/number/I32#toString i32.const 1552 call $~lib/string/String.__eq i32.eqz diff --git a/tests/compiler/resolve-elementaccess.optimized.wat b/tests/compiler/resolve-elementaccess.optimized.wat index 1d013692f2..68a0342fc8 100644 --- a/tests/compiler/resolve-elementaccess.optimized.wat +++ b/tests/compiler/resolve-elementaccess.optimized.wat @@ -292,7 +292,6 @@ ) (func $~lib/arraybuffer/ArrayBufferView#constructor (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 i32.eqz if @@ -326,29 +325,25 @@ i32.const 2 local.get $1 i32.shl - local.tee $3 + local.tee $1 i32.const 0 call $~lib/rt/stub/__alloc local.tee $2 - local.get $3 + local.get $1 call $~lib/memory/memory.fill local.get $0 - local.tee $1 - local.get $2 - local.tee $0 - local.get $1 i32.load - i32.ne drop local.get $0 + local.get $2 i32.store - local.get $1 local.get $0 + local.get $2 i32.store offset=4 + local.get $0 local.get $1 - local.get $3 i32.store offset=8 - local.get $1 + local.get $0 ) (func $~lib/typedarray/Float32Array#__set (param $0 i32) (param $1 i32) (param $2 f32) local.get $1 @@ -1767,16 +1762,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end @@ -1864,31 +1859,36 @@ i32.add i32.load8_u ) - (func $~lib/util/number/utoa32 (param $0 i32) (result i32) + (func $~lib/number/U8#toString (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - local.get $0 - i32.eqz - if - i32.const 2752 - return + block $__inlined_func$~lib/util/number/utoa32 + local.get $0 + i32.const 255 + i32.and + local.tee $1 + i32.eqz + if + i32.const 2752 + local.set $0 + br $__inlined_func$~lib/util/number/utoa32 + end + local.get $1 + call $~lib/util/number/decimalCount32 + local.tee $2 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/stub/__alloc + local.tee $0 + local.get $1 + local.get $2 + call $~lib/util/number/utoa_dec_simple end local.get $0 - call $~lib/util/number/decimalCount32 - local.tee $1 - i32.const 1 - i32.shl - i32.const 1 - call $~lib/rt/stub/__alloc - local.tee $2 - local.get $0 - local.get $1 - call $~lib/util/number/utoa_dec_simple - local.get $2 ) (func $start:resolve-elementaccess (local $0 i32) - (local $1 i32) i32.const 2960 global.set $~lib/rt/stub/offset i32.const 12 @@ -1986,9 +1986,7 @@ i32.const 12 i32.const 4 call $~lib/rt/stub/__alloc - local.tee $1 - local.set $0 - local.get $1 + local.tee $0 if (result i32) local.get $0 else @@ -2010,9 +2008,7 @@ global.get $resolve-elementaccess/buf i32.const 0 call $~lib/typedarray/Uint8Array#__get - i32.const 255 - i32.and - call $~lib/util/number/utoa32 + call $~lib/number/U8#toString i32.const 2880 call $~lib/string/String.__eq i32.eqz @@ -2027,9 +2023,7 @@ global.get $resolve-elementaccess/buf i32.const 1 call $~lib/typedarray/Uint8Array#__get - i32.const 255 - i32.and - call $~lib/util/number/utoa32 + call $~lib/number/U8#toString i32.const 2912 call $~lib/string/String.__eq i32.eqz @@ -2053,9 +2047,7 @@ local.get $0 i32.const 0 call $~lib/typedarray/Uint8Array#__get - i32.const 255 - i32.and - call $~lib/util/number/utoa32 + call $~lib/number/U8#toString i32.const 2944 call $~lib/string/String.__eq i32.eqz diff --git a/tests/compiler/resolve-function-expression.optimized.wat b/tests/compiler/resolve-function-expression.optimized.wat index 26e7436c4a..bed48e57d5 100644 --- a/tests/compiler/resolve-function-expression.optimized.wat +++ b/tests/compiler/resolve-function-expression.optimized.wat @@ -277,16 +277,16 @@ local.set $1 local.get $2 if - local.get $0 + local.get $3 i32.load16_u local.tee $2 - local.get $3 + local.get $0 i32.load16_u local.tee $4 i32.ne if - local.get $2 local.get $4 + local.get $2 i32.sub return end @@ -303,7 +303,7 @@ end i32.const 0 ) - (func $~start + (func $start:resolve-function-expression (local $0 i32) (local $1 i32) i32.const 2 @@ -377,4 +377,7 @@ unreachable end ) + (func $~start + call $start:resolve-function-expression + ) ) diff --git a/tests/compiler/resolve-propertyaccess.optimized.wat b/tests/compiler/resolve-propertyaccess.optimized.wat index c3958b703c..a317a5d48d 100644 --- a/tests/compiler/resolve-propertyaccess.optimized.wat +++ b/tests/compiler/resolve-propertyaccess.optimized.wat @@ -271,16 +271,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end diff --git a/tests/compiler/resolve-unary.optimized.wat b/tests/compiler/resolve-unary.optimized.wat index ccc6f2ec40..c50551feff 100644 --- a/tests/compiler/resolve-unary.optimized.wat +++ b/tests/compiler/resolve-unary.optimized.wat @@ -276,16 +276,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index 0dd0696483..9c9b4de434 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -135,16 +135,16 @@ local.set $2 local.get $0 if - local.get $1 + local.get $3 i32.load16_u local.tee $0 - local.get $3 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $0 local.get $4 + local.get $0 i32.sub return end diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index e6a2d14c26..67c9dd1483 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -3267,24 +3267,24 @@ i32.const 6 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $3 + local.tee $1 i32.const 16 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - local.get $3 + local.get $1 i32.const 3 i32.store offset=4 - local.get $3 + local.get $1 i32.const 32 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - local.get $3 + local.get $1 i32.const 4 i32.store offset=12 - local.get $3 + local.get $1 i32.const 0 i32.store offset=16 - local.get $3 + local.get $1 i32.const 0 i32.store offset=20 call $~lib/map/Map#constructor @@ -3312,13 +3312,13 @@ i32.load offset=4 i32.add i32.load8_s - local.set $1 + local.set $3 local.get $6 local.get $2 call $~lib/array/Array#__get local.set $7 local.get $0 - local.get $1 + local.get $3 call $~lib/map/Map#has i32.eqz if @@ -3343,17 +3343,17 @@ call $~lib/builtins/abort unreachable end - local.get $3 - local.get $1 local.get $1 + local.get $3 + local.get $3 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $5 local.get $7 i32.const 20 i32.sub - local.tee $1 - local.get $1 + local.tee $3 + local.get $3 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $2 @@ -3363,7 +3363,7 @@ br $for-loop|4 end end - local.get $3 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -3556,7 +3556,7 @@ call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release - local.get $3 + local.get $1 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release @@ -4481,24 +4481,24 @@ i32.const 10 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $3 + local.tee $1 i32.const 16 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store - local.get $3 + local.get $1 i32.const 3 i32.store offset=4 - local.get $3 + local.get $1 i32.const 32 call $~lib/arraybuffer/ArrayBuffer#constructor i32.store offset=8 - local.get $3 + local.get $1 i32.const 4 i32.store offset=12 - local.get $3 + local.get $1 i32.const 0 i32.store offset=16 - local.get $3 + local.get $1 i32.const 0 i32.store offset=20 call $~lib/map/Map#constructor @@ -4526,13 +4526,13 @@ i32.load offset=4 i32.add i32.load8_u - local.set $1 + local.set $3 local.get $6 local.get $2 call $~lib/array/Array#__get local.set $7 local.get $0 - local.get $1 + local.get $3 call $~lib/map/Map#has i32.eqz if @@ -4557,17 +4557,17 @@ call $~lib/builtins/abort unreachable end - local.get $3 - local.get $1 local.get $1 + local.get $3 + local.get $3 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $5 local.get $7 i32.const 20 i32.sub - local.tee $1 - local.get $1 + local.tee $3 + local.get $3 call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $2 @@ -4577,7 +4577,7 @@ br $for-loop|4 end end - local.get $3 + local.get $1 i32.load offset=20 i32.const 100 i32.ne @@ -4762,7 +4762,7 @@ call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release - local.get $3 + local.get $1 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release diff --git a/tests/compiler/std/object.optimized.wat b/tests/compiler/std/object.optimized.wat index 72bd4a876d..856757bab1 100644 --- a/tests/compiler/std/object.optimized.wat +++ b/tests/compiler/std/object.optimized.wat @@ -122,16 +122,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 86c25b7325..487b81017a 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -1075,13 +1075,11 @@ global.set $std/operator-overloading/excl global.get $std/operator-overloading/excl local.tee $0 - local.set $1 - local.get $0 i32.load if (result i32) i32.const 0 else - local.get $1 + local.get $0 i32.load offset=4 i32.eqz end diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 3262d35021..a00fefa1e0 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -422,16 +422,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end @@ -491,31 +491,31 @@ i32.shl i32.add i32.load - local.set $1 + local.set $0 loop $while-continue|0 - local.get $1 + local.get $0 if - local.get $1 + local.get $0 i32.load offset=8 i32.const 1 i32.and if (result i32) i32.const 0 else - local.get $1 + local.get $0 i32.load i32.const 1040 call $~lib/string/String.__eq end if - local.get $1 + local.get $0 return end - local.get $1 + local.get $0 i32.load offset=8 i32.const -2 i32.and - local.set $1 + local.set $0 br $while-continue|0 end end @@ -532,12 +532,12 @@ local.get $1 i32.const 1 i32.add - local.tee $3 + local.tee $2 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $3 + local.set $6 + local.get $2 i32.const 3 i32.shl i32.const 3 @@ -549,37 +549,38 @@ local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $5 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $6 + local.set $8 local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $5 local.get $8 i32.ne if - local.get $8 + local.get $5 + local.tee $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $4 i32.load i32.store local.get $2 - local.get $8 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 + local.get $6 local.get $4 - local.get $8 i32.load call $~lib/util/hash/hashStr local.get $1 @@ -587,10 +588,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $4 i32.load i32.store offset=8 - local.get $5 + local.get $4 local.get $2 i32.store local.get $2 @@ -598,41 +599,39 @@ i32.add local.set $2 end - local.get $8 + local.get $5 i32.const 12 i32.add - local.set $8 + local.set $5 br $while-continue|0 end end + local.get $6 + local.tee $2 local.get $0 - local.set $2 - local.get $4 - local.tee $0 - local.get $2 i32.load i32.ne drop - local.get $2 local.get $0 - i32.store local.get $2 + i32.store + local.get $0 local.get $1 i32.store offset=4 local.get $3 - local.tee $0 - local.get $2 + local.tee $1 + local.get $0 i32.load offset=8 i32.ne drop - local.get $2 local.get $0 + local.get $1 i32.store offset=8 - local.get $2 + local.get $0 local.get $7 i32.store offset=12 - local.get $2 - local.get $2 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) @@ -806,12 +805,12 @@ local.get $1 i32.const 1 i32.add - local.tee $3 + local.tee $2 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 - local.get $3 + local.set $6 + local.get $2 i32.const 3 i32.shl i32.const 3 @@ -823,37 +822,38 @@ local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $5 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $6 + local.set $8 local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $5 local.get $8 i32.ne if - local.get $8 + local.get $5 + local.tee $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $4 i32.load i32.store local.get $2 - local.get $8 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 + local.get $6 local.get $4 - local.get $8 i32.load call $~lib/util/hash/hash32 local.get $1 @@ -861,10 +861,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $4 i32.load i32.store offset=8 - local.get $5 + local.get $4 local.get $2 i32.store local.get $2 @@ -872,41 +872,39 @@ i32.add local.set $2 end - local.get $8 + local.get $5 i32.const 12 i32.add - local.set $8 + local.set $5 br $while-continue|0 end end + local.get $6 + local.tee $2 local.get $0 - local.set $2 - local.get $4 - local.tee $0 - local.get $2 i32.load i32.ne drop - local.get $2 local.get $0 - i32.store local.get $2 + i32.store + local.get $0 local.get $1 i32.store offset=4 local.get $3 - local.tee $0 - local.get $2 + local.tee $1 + local.get $0 i32.load offset=8 i32.ne drop - local.get $2 local.get $0 + local.get $1 i32.store offset=8 - local.get $2 + local.get $0 local.get $7 i32.store offset=12 - local.get $2 - local.get $2 + local.get $0 + local.get $0 i32.load offset=20 i32.store offset=16 ) diff --git a/tests/compiler/typeof.optimized.wat b/tests/compiler/typeof.optimized.wat index 94996de87f..b51c195178 100644 --- a/tests/compiler/typeof.optimized.wat +++ b/tests/compiler/typeof.optimized.wat @@ -76,16 +76,16 @@ local.set $2 local.get $3 if - local.get $1 + local.get $0 i32.load16_u local.tee $3 - local.get $0 + local.get $1 i32.load16_u local.tee $4 i32.ne if - local.get $4 local.get $3 + local.get $4 i32.sub return end From 3228f1e82b1199ca073c9a78b665763eb3121f2a Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 12 Oct 2020 17:57:37 +0300 Subject: [PATCH 5/9] use early precompute-propagate instead precompute --- src/module.ts | 2 +- tests/compiler/std/math.optimized.wat | 144 ++++++++++++-------------- 2 files changed, 65 insertions(+), 81 deletions(-) diff --git a/src/module.ts b/src/module.ts index ba0660b0de..1afe607599 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1526,7 +1526,7 @@ export class Module { passes.push("remove-unused-brs"); passes.push("remove-unused-names"); passes.push("merge-blocks"); - passes.push("precompute"); + passes.push("precompute-propagate"); } if (optimizeLevel >= 3) { passes.push("flatten"); diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index b23e9028df..5d95cf1c61 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -3758,23 +3758,28 @@ end local.set $6 global.get $~lib/math/rempio2_y0 - local.set $0 + local.set $3 global.get $~lib/math/rempio2_y1 local.set $4 local.get $6 i32.const 1 i32.and if (result f64) - local.get $0 - local.get $0 - f64.mul - local.tee $3 - local.get $0 - f64.mul - local.tee $1 local.get $3 local.get $3 + f64.mul + local.tee $0 + local.get $3 + f64.mul + local.set $1 local.get $3 + local.get $0 + local.get $4 + f64.const 0.5 + f64.mul + local.get $1 + local.get $0 + local.get $0 f64.const 2.7557313707070068e-06 f64.mul f64.const -1.984126982985795e-04 @@ -3782,31 +3787,18 @@ f64.mul f64.const 0.00833333333332249 f64.add - local.get $3 - local.get $3 - local.get $3 + local.get $0 + local.get $0 + local.get $0 f64.mul f64.mul - local.get $3 + local.get $0 f64.const 1.58969099521155e-10 f64.mul f64.const -2.5050760253406863e-08 f64.add f64.mul f64.add - local.tee $7 - f64.mul - f64.const -0.16666666666666632 - f64.add - f64.mul - drop - local.get $0 - local.get $3 - local.get $4 - f64.const 0.5 - f64.mul - local.get $1 - local.get $7 f64.mul f64.sub f64.mul @@ -3819,10 +3811,10 @@ f64.sub else f64.const 1 - local.get $0 - local.get $0 + local.get $3 + local.get $3 f64.mul - local.tee $3 + local.tee $0 f64.const 0.5 f64.mul local.tee $1 @@ -3833,10 +3825,10 @@ f64.sub local.get $1 f64.sub - local.get $3 - local.get $3 - local.get $3 - local.get $3 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f64.const 2.480158728947673e-05 f64.mul f64.const -0.001388888888887411 @@ -3845,14 +3837,14 @@ f64.const 0.0416666666666666 f64.add f64.mul - local.get $3 - local.get $3 + local.get $0 + local.get $0 f64.mul local.tee $1 local.get $1 f64.mul - local.get $3 - local.get $3 + local.get $0 + local.get $0 f64.const -1.1359647557788195e-11 f64.mul f64.const 2.087572321298175e-09 @@ -3863,7 +3855,7 @@ f64.mul f64.add f64.mul - local.get $0 + local.get $3 local.get $4 f64.mul f64.sub @@ -9184,7 +9176,7 @@ end local.set $6 global.get $~lib/math/rempio2_y0 - local.set $0 + local.set $3 global.get $~lib/math/rempio2_y1 local.set $4 local.get $6 @@ -9192,10 +9184,10 @@ i32.and if (result f64) f64.const 1 - local.get $0 - local.get $0 + local.get $3 + local.get $3 f64.mul - local.tee $3 + local.tee $0 f64.const 0.5 f64.mul local.tee $1 @@ -9206,10 +9198,10 @@ f64.sub local.get $1 f64.sub - local.get $3 - local.get $3 - local.get $3 - local.get $3 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f64.const 2.480158728947673e-05 f64.mul f64.const -0.001388888888887411 @@ -9218,14 +9210,14 @@ f64.const 0.0416666666666666 f64.add f64.mul - local.get $3 - local.get $3 + local.get $0 + local.get $0 f64.mul local.tee $1 local.get $1 f64.mul - local.get $3 - local.get $3 + local.get $0 + local.get $0 f64.const -1.1359647557788195e-11 f64.mul f64.const 2.087572321298175e-09 @@ -9236,23 +9228,28 @@ f64.mul f64.add f64.mul - local.get $0 + local.get $3 local.get $4 f64.mul f64.sub f64.add f64.add else - local.get $0 - local.get $0 - f64.mul - local.tee $3 - local.get $0 - f64.mul - local.tee $1 local.get $3 local.get $3 + f64.mul + local.tee $0 + local.get $3 + f64.mul + local.set $1 local.get $3 + local.get $0 + local.get $4 + f64.const 0.5 + f64.mul + local.get $1 + local.get $0 + local.get $0 f64.const 2.7557313707070068e-06 f64.mul f64.const -1.984126982985795e-04 @@ -9260,31 +9257,18 @@ f64.mul f64.const 0.00833333333332249 f64.add - local.get $3 - local.get $3 - local.get $3 + local.get $0 + local.get $0 + local.get $0 f64.mul f64.mul - local.get $3 + local.get $0 f64.const 1.58969099521155e-10 f64.mul f64.const -2.5050760253406863e-08 f64.add f64.mul f64.add - local.tee $7 - f64.mul - f64.const -0.16666666666666632 - f64.add - f64.mul - drop - local.get $0 - local.get $3 - local.get $4 - f64.const 0.5 - f64.mul - local.get $1 - local.get $7 f64.mul f64.sub f64.mul @@ -10882,7 +10866,7 @@ local.get $4 local.get $2 global.get $~lib/math/rempio2_y1 - local.tee $7 + local.tee $1 f64.const 0.5 f64.mul local.get $0 @@ -10899,7 +10883,7 @@ local.get $2 local.get $2 f64.mul - local.tee $1 + local.tee $7 f64.mul local.get $2 f64.const 1.58969099521155e-10 @@ -10911,7 +10895,7 @@ f64.mul f64.sub f64.mul - local.get $7 + local.get $1 f64.sub local.get $0 f64.const -0.16666666666666632 @@ -10944,8 +10928,8 @@ f64.const 0.0416666666666666 f64.add f64.mul - local.get $1 - local.get $1 + local.get $7 + local.get $7 f64.mul local.get $2 local.get $2 @@ -10960,7 +10944,7 @@ f64.add f64.mul local.get $4 - local.get $7 + local.get $1 f64.mul f64.sub f64.add From 418855eba0674a160c58b652bd49c7c695559840 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 12 Oct 2020 22:21:21 +0300 Subject: [PATCH 6/9] update fixtures --- tests/compiler/number.optimized.wat | 81 ++- .../retain-release-sanity.optimized.wat | 38 +- tests/compiler/std/array.optimized.wat | 50 +- tests/compiler/std/map.optimized.wat | 264 +++++----- .../std/string-casemapping.optimized.wat | 38 +- tests/compiler/std/string.optimized.wat | 490 +++++++++--------- 6 files changed, 503 insertions(+), 458 deletions(-) diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index f930448ff5..1a9572db1f 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -2,12 +2,11 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_=>_i32 (func (param i32 i64 i32 i64 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) @@ -1270,9 +1269,7 @@ global.get $~lib/util/number/_K call $~lib/util/number/prettify ) - (func $~lib/util/number/dtoa (result i32) - (local $0 i32) - (local $1 i32) + (func $~lib/string/String#substring (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1322,12 +1319,8 @@ local.tee $3 i32.eqz if - i32.const 0 - i32.const 2512 - i32.const 68 - i32.const 3 - call $~lib/builtins/abort - unreachable + i32.const 2496 + return end i32.const 0 local.get $4 @@ -1338,12 +1331,8 @@ local.get $1 select if - i32.const 0 - i32.const 2512 - i32.const 70 - i32.const 14 - call $~lib/builtins/abort - unreachable + local.get $0 + return end local.get $3 call $~lib/rt/stub/__alloc @@ -1407,6 +1396,8 @@ ) (func $start:number (local $0 i32) + (local $1 i32) + (local $2 i32) i32.const 2768 global.set $~lib/rt/stub/offset global.get $number/a @@ -1422,7 +1413,61 @@ call $~lib/builtins/abort unreachable end - call $~lib/util/number/dtoa + i32.const 56 + call $~lib/rt/stub/__alloc + local.tee $0 + call $~lib/util/number/dtoa_core + local.tee $1 + i32.const 28 + i32.ne + if (result i32) + local.get $0 + local.get $1 + call $~lib/string/String#substring + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + i32.eqz + if + i32.const 0 + i32.const 2512 + i32.const 68 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 16 + i32.sub + local.tee $2 + i32.load offset=4 + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 2512 + i32.const 70 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/stub/offset + local.get $0 + local.get $2 + i32.load + i32.add + i32.eq + if + local.get $2 + global.set $~lib/rt/stub/offset + end + else + local.get $0 + end i32.const 2560 call $~lib/string/String.__eq i32.eqz diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 13e29915e6..1aef9ac5e6 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -1670,29 +1670,31 @@ block $__inlined_func$~lib/string/String#concat (result i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $0 i32.const 1424 - local.get $2 + local.get $0 select local.set $3 local.get $1 call $~lib/rt/pure/__retain - local.tee $5 + local.tee $1 + local.set $2 + local.get $2 call $~lib/rt/pure/__retain - local.tee $0 + local.tee $2 i32.eqz if - local.get $0 + local.get $2 i32.const 1424 i32.ne if - local.get $0 + local.get $2 call $~lib/rt/pure/__release end i32.const 1424 - local.set $0 + local.set $2 end - local.get $0 + local.get $2 i32.const 16 i32.sub i32.load offset=12 @@ -1711,38 +1713,38 @@ i32.shl local.tee $4 i32.add - local.tee $1 + local.tee $5 i32.eqz if - local.get $0 + local.get $2 call $~lib/rt/pure/__release i32.const 1344 br $__inlined_func$~lib/string/String#concat end call $~lib/rt/tlsf/maybeInitialize - local.get $1 + local.get $5 i32.const 1 call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $1 + local.tee $5 local.get $3 local.get $4 call $~lib/memory/memory.copy - local.get $1 local.get $4 + local.get $5 i32.add - local.get $0 + local.get $2 local.get $6 call $~lib/memory/memory.copy - local.get $0 + local.get $2 call $~lib/rt/pure/__release - local.get $1 + local.get $5 end - local.get $2 + local.get $0 call $~lib/rt/pure/__release - local.get $5 + local.get $1 call $~lib/rt/pure/__release ) (func $start:retain-release-sanity diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 16ba17b25a..671182a165 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -4570,10 +4570,10 @@ (local $4 i32) (local $5 f32) (local $6 f32) - local.get $1 - call $~lib/rt/pure/__retain - local.set $3 block $folding-inner0 + local.get $1 + call $~lib/rt/pure/__retain + local.set $3 local.get $0 i32.load offset=12 local.tee $2 @@ -5102,10 +5102,10 @@ (local $4 i32) (local $5 f64) (local $6 f64) - local.get $1 - call $~lib/rt/pure/__retain - local.set $3 block $folding-inner0 + local.get $1 + call $~lib/rt/pure/__retain + local.set $3 local.get $0 i32.load offset=12 local.tee $2 @@ -6822,29 +6822,31 @@ block $__inlined_func$~lib/string/String#concat (result i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $0 i32.const 7984 - local.get $2 + local.get $0 select local.set $3 local.get $1 call $~lib/rt/pure/__retain - local.tee $5 + local.tee $1 + local.set $2 + local.get $2 call $~lib/rt/pure/__retain - local.tee $0 + local.tee $2 i32.eqz if - local.get $0 + local.get $2 i32.const 7984 i32.ne if - local.get $0 + local.get $2 call $~lib/rt/pure/__release end i32.const 7984 - local.set $0 + local.set $2 end - local.get $0 + local.get $2 i32.const 16 i32.sub i32.load offset=12 @@ -6863,38 +6865,38 @@ i32.shl local.tee $4 i32.add - local.tee $1 + local.tee $5 i32.eqz if - local.get $0 + local.get $2 call $~lib/rt/pure/__release i32.const 7840 br $__inlined_func$~lib/string/String#concat end call $~lib/rt/tlsf/maybeInitialize - local.get $1 + local.get $5 i32.const 1 call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $1 + local.tee $5 local.get $3 local.get $4 call $~lib/memory/memory.copy - local.get $1 local.get $4 + local.get $5 i32.add - local.get $0 + local.get $2 local.get $6 call $~lib/memory/memory.copy - local.get $0 + local.get $2 call $~lib/rt/pure/__release - local.get $1 + local.get $5 end - local.get $2 + local.get $0 call $~lib/rt/pure/__release - local.get $5 + local.get $1 call $~lib/rt/pure/__release ) (func $std/array/createRandomString (param $0 i32) (result i32) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 40e319fa88..f10975ce95 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -3051,7 +3051,7 @@ i32.const 0 i32.store offset=20 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -3060,7 +3060,7 @@ i32.lt_s if local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -3071,8 +3071,8 @@ unreachable end local.get $1 - local.get $2 - local.get $2 + local.get $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -3082,7 +3082,7 @@ call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3094,9 +3094,9 @@ unreachable end local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#get - local.get $2 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -3112,10 +3112,10 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end @@ -3132,9 +3132,9 @@ unreachable end i32.const 0 - local.set $2 + local.set $0 loop $for-loop|3 - local.get $2 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -3143,7 +3143,7 @@ i32.lt_s if local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3155,9 +3155,9 @@ unreachable end local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#get - local.get $2 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -3174,8 +3174,8 @@ unreachable end local.get $1 - local.get $2 - local.get $2 + local.get $0 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -3185,7 +3185,7 @@ call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -3197,9 +3197,9 @@ unreachable end local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#get - local.get $2 + local.get $0 i32.const 24 i32.shl i32.const 24 @@ -3215,10 +3215,10 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|3 end end @@ -3234,21 +3234,23 @@ call $~lib/builtins/abort unreachable end + i32.const 0 + local.set $0 local.get $1 i32.load offset=8 - local.set $5 + local.set $4 local.get $1 i32.load offset=16 local.tee $6 call $~lib/array/Array#constructor - local.set $2 + local.set $5 loop $for-loop|0 - local.get $4 + local.get $3 local.get $6 i32.lt_s if - local.get $5 local.get $4 + local.get $3 i32.const 12 i32.mul i32.add @@ -3258,7 +3260,7 @@ i32.and i32.eqz if - local.get $2 + local.get $5 local.get $0 local.get $7 i32.load8_s @@ -3268,14 +3270,14 @@ i32.add local.set $0 end - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $for-loop|0 end end - local.get $2 + local.get $5 local.get $0 call $~lib/array/Array#set:length local.get $1 @@ -3309,15 +3311,15 @@ i32.const 0 i32.store offset=20 call $~lib/map/Map#constructor - local.set $4 + local.set $3 loop $for-loop|4 - local.get $3 local.get $2 + local.get $5 i32.load offset=12 i32.lt_s if - local.get $3 local.get $2 + local.get $5 i32.load offset=12 i32.ge_u if @@ -3328,18 +3330,18 @@ call $~lib/builtins/abort unreachable end - local.get $3 local.get $2 + local.get $5 i32.load offset=4 i32.add i32.load8_s - local.set $5 + local.set $4 local.get $6 - local.get $3 + local.get $2 call $~lib/array/Array#__get local.set $7 local.get $1 - local.get $5 + local.get $4 call $~lib/map/Map#has i32.eqz if @@ -3365,22 +3367,22 @@ unreachable end local.get $0 - local.get $5 - local.get $5 + local.get $4 + local.get $4 call $~lib/map/Map#set call $~lib/rt/pure/__release - local.get $4 + local.get $3 local.get $7 i32.const 20 i32.sub - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 call $~lib/map/Map#set call $~lib/rt/pure/__release - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $for-loop|4 end end @@ -3396,7 +3398,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 i32.load offset=20 i32.const 100 i32.ne @@ -3409,9 +3411,9 @@ unreachable end i32.const 0 - local.set $3 + local.set $2 loop $for-loop|6 - local.get $3 + local.get $2 i32.const 24 i32.shl i32.const 24 @@ -3420,7 +3422,7 @@ i32.lt_s if local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has i32.eqz if @@ -3432,9 +3434,9 @@ unreachable end local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#get - local.get $3 + local.get $2 i32.const 24 i32.shl i32.const 24 @@ -3451,10 +3453,10 @@ unreachable end local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#delete local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has if i32.const 0 @@ -3464,10 +3466,10 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $for-loop|6 end end @@ -3484,9 +3486,9 @@ unreachable end i32.const 0 - local.set $3 + local.set $2 loop $for-loop|8 - local.get $3 + local.get $2 i32.const 24 i32.shl i32.const 24 @@ -3495,7 +3497,7 @@ i32.lt_s if local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has if i32.const 0 @@ -3506,8 +3508,8 @@ unreachable end local.get $1 - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.const 24 i32.shl i32.const 24 @@ -3517,7 +3519,7 @@ call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has i32.eqz if @@ -3529,10 +3531,10 @@ unreachable end local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#delete local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has if i32.const 0 @@ -3542,10 +3544,10 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $for-loop|8 end end @@ -3573,13 +3575,13 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $5 call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release local.get $1 call $~lib/rt/pure/__release @@ -4303,14 +4305,14 @@ i32.const 0 i32.store offset=20 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 255 i32.and i32.const 100 i32.lt_u if local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has if i32.const 0 @@ -4321,8 +4323,8 @@ unreachable end local.get $1 - local.get $2 - local.get $2 + local.get $0 + local.get $0 i32.const 255 i32.and i32.const 10 @@ -4330,7 +4332,7 @@ call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4342,9 +4344,9 @@ unreachable end local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#get - local.get $2 + local.get $0 i32.const 255 i32.and i32.const 10 @@ -4358,10 +4360,10 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end @@ -4378,16 +4380,16 @@ unreachable end i32.const 0 - local.set $2 + local.set $0 loop $for-loop|3 - local.get $2 + local.get $0 i32.const 255 i32.and i32.const 100 i32.lt_u if local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4399,9 +4401,9 @@ unreachable end local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#get - local.get $2 + local.get $0 i32.const 255 i32.and i32.const 10 @@ -4416,8 +4418,8 @@ unreachable end local.get $1 - local.get $2 - local.get $2 + local.get $0 + local.get $0 i32.const 255 i32.and i32.const 20 @@ -4425,7 +4427,7 @@ call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#has i32.eqz if @@ -4437,9 +4439,9 @@ unreachable end local.get $1 - local.get $2 + local.get $0 call $~lib/map/Map#get - local.get $2 + local.get $0 i32.const 255 i32.and i32.const 20 @@ -4453,10 +4455,10 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|3 end end @@ -4472,21 +4474,23 @@ call $~lib/builtins/abort unreachable end + i32.const 0 + local.set $0 local.get $1 i32.load offset=8 - local.set $5 + local.set $4 local.get $1 i32.load offset=16 local.tee $6 call $~lib/array/Array#constructor - local.set $2 + local.set $5 loop $for-loop|0 - local.get $4 + local.get $3 local.get $6 i32.lt_s if - local.get $5 local.get $4 + local.get $3 i32.const 12 i32.mul i32.add @@ -4496,7 +4500,7 @@ i32.and i32.eqz if - local.get $2 + local.get $5 local.get $0 local.get $7 i32.load8_u @@ -4506,14 +4510,14 @@ i32.add local.set $0 end - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $for-loop|0 end end - local.get $2 + local.get $5 local.get $0 call $~lib/array/Array#set:length local.get $1 @@ -4547,15 +4551,15 @@ i32.const 0 i32.store offset=20 call $~lib/map/Map#constructor - local.set $4 + local.set $3 loop $for-loop|4 - local.get $3 local.get $2 + local.get $5 i32.load offset=12 i32.lt_s if - local.get $3 local.get $2 + local.get $5 i32.load offset=12 i32.ge_u if @@ -4566,18 +4570,18 @@ call $~lib/builtins/abort unreachable end - local.get $3 local.get $2 + local.get $5 i32.load offset=4 i32.add i32.load8_u - local.set $5 + local.set $4 local.get $6 - local.get $3 + local.get $2 call $~lib/array/Array#__get local.set $7 local.get $1 - local.get $5 + local.get $4 call $~lib/map/Map#has i32.eqz if @@ -4603,22 +4607,22 @@ unreachable end local.get $0 - local.get $5 - local.get $5 + local.get $4 + local.get $4 call $~lib/map/Map#set call $~lib/rt/pure/__release - local.get $4 + local.get $3 local.get $7 i32.const 20 i32.sub - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 call $~lib/map/Map#set call $~lib/rt/pure/__release - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $for-loop|4 end end @@ -4634,7 +4638,7 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $3 i32.load offset=20 i32.const 100 i32.ne @@ -4647,16 +4651,16 @@ unreachable end i32.const 0 - local.set $3 + local.set $2 loop $for-loop|6 - local.get $3 + local.get $2 i32.const 255 i32.and i32.const 50 i32.lt_u if local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has i32.eqz if @@ -4668,9 +4672,9 @@ unreachable end local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#get - local.get $3 + local.get $2 i32.const 255 i32.and i32.const 20 @@ -4685,10 +4689,10 @@ unreachable end local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#delete local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has if i32.const 0 @@ -4698,10 +4702,10 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $for-loop|6 end end @@ -4718,16 +4722,16 @@ unreachable end i32.const 0 - local.set $3 + local.set $2 loop $for-loop|8 - local.get $3 + local.get $2 i32.const 255 i32.and i32.const 50 i32.lt_u if local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has if i32.const 0 @@ -4738,8 +4742,8 @@ unreachable end local.get $1 - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.const 255 i32.and i32.const 10 @@ -4747,7 +4751,7 @@ call $~lib/map/Map#set call $~lib/rt/pure/__release local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has i32.eqz if @@ -4759,10 +4763,10 @@ unreachable end local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#delete local.get $1 - local.get $3 + local.get $2 call $~lib/map/Map#has if i32.const 0 @@ -4772,10 +4776,10 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.const 1 i32.add - local.set $3 + local.set $2 br $for-loop|8 end end @@ -4803,13 +4807,13 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $5 call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release local.get $1 call $~lib/rt/pure/__release diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index c518a12eb6..3fb7d0794f 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -3121,29 +3121,31 @@ block $__inlined_func$~lib/string/String#concat (result i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $0 i32.const 18624 - local.get $2 + local.get $0 select local.set $3 local.get $1 call $~lib/rt/pure/__retain - local.tee $5 + local.tee $1 + local.set $2 + local.get $2 call $~lib/rt/pure/__retain - local.tee $0 + local.tee $2 i32.eqz if - local.get $0 + local.get $2 i32.const 18624 i32.ne if - local.get $0 + local.get $2 call $~lib/rt/pure/__release end i32.const 18624 - local.set $0 + local.set $2 end - local.get $0 + local.get $2 i32.const 16 i32.sub i32.load offset=12 @@ -3162,38 +3164,38 @@ i32.shl local.tee $4 i32.add - local.tee $1 + local.tee $5 i32.eqz if - local.get $0 + local.get $2 call $~lib/rt/pure/__release i32.const 1040 br $__inlined_func$~lib/string/String#concat end call $~lib/rt/tlsf/maybeInitialize - local.get $1 + local.get $5 i32.const 1 call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $1 + local.tee $5 local.get $3 local.get $4 call $~lib/memory/memory.copy - local.get $1 local.get $4 + local.get $5 i32.add - local.get $0 + local.get $2 local.get $6 call $~lib/memory/memory.copy - local.get $0 + local.get $2 call $~lib/rt/pure/__release - local.get $1 + local.get $5 end - local.get $2 + local.get $0 call $~lib/rt/pure/__release - local.get $5 + local.get $1 call $~lib/rt/pure/__release ) (func $start:std/string-casemapping diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 3c1b34b8f7..e680d9a6ff 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -4278,29 +4278,31 @@ block $__inlined_func$~lib/string/String#concat (result i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $0 i32.const 1648 - local.get $2 + local.get $0 select local.set $3 local.get $1 call $~lib/rt/pure/__retain - local.tee $5 + local.tee $1 + local.set $2 + local.get $2 call $~lib/rt/pure/__retain - local.tee $0 + local.tee $2 i32.eqz if - local.get $0 + local.get $2 i32.const 1648 i32.ne if - local.get $0 + local.get $2 call $~lib/rt/pure/__release end i32.const 1648 - local.set $0 + local.set $2 end - local.get $0 + local.get $2 i32.const 16 i32.sub i32.load offset=12 @@ -4319,38 +4321,38 @@ i32.shl local.tee $4 i32.add - local.tee $1 + local.tee $5 i32.eqz if - local.get $0 + local.get $2 call $~lib/rt/pure/__release i32.const 1280 br $__inlined_func$~lib/string/String#concat end call $~lib/rt/tlsf/maybeInitialize - local.get $1 + local.get $5 i32.const 1 call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $1 + local.tee $5 local.get $3 local.get $4 call $~lib/memory/memory.copy - local.get $1 local.get $4 + local.get $5 i32.add - local.get $0 + local.get $2 local.get $6 call $~lib/memory/memory.copy - local.get $0 + local.get $2 call $~lib/rt/pure/__release - local.get $1 + local.get $5 end - local.get $2 + local.get $0 call $~lib/rt/pure/__release - local.get $5 + local.get $1 call $~lib/rt/pure/__release ) (func $~lib/string/String.__ne (param $0 i32) (param $1 i32) (result i32) @@ -4609,13 +4611,13 @@ (local $6 i32) (local $7 i32) (local $8 i32) + local.get $1 + call $~lib/rt/pure/__retain + local.set $1 + local.get $2 + call $~lib/rt/pure/__retain + local.set $2 block $folding-inner0 - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 local.get $0 i32.const 16 i32.sub @@ -4908,17 +4910,11 @@ (local $10 i32) local.get $1 call $~lib/rt/pure/__retain - local.set $8 + local.set $7 local.get $2 call $~lib/rt/pure/__retain - local.set $6 - block $folding-inner0 - local.get $1 - call $~lib/rt/pure/__retain - local.set $7 - local.get $2 - call $~lib/rt/pure/__retain - local.set $5 + local.set $5 + block $folding-inner1 (result i32) local.get $0 i32.const 16 i32.sub @@ -4926,7 +4922,7 @@ i32.const 1 i32.shr_u local.tee $4 - local.get $8 + local.get $7 i32.const 16 i32.sub i32.load offset=12 @@ -4942,298 +4938,292 @@ local.get $0 call $~lib/rt/pure/__retain else - local.get $6 + local.get $5 local.get $0 - local.get $8 + local.get $7 local.get $0 call $~lib/string/String.__eq select call $~lib/rt/pure/__retain end - local.set $0 - br $folding-inner0 + br $folding-inner1 end - local.get $6 + local.get $5 i32.const 16 i32.sub i32.load offset=12 i32.const 1 i32.shr_u local.set $2 - local.get $10 - i32.eqz - if - local.get $2 + block $folding-inner0 + local.get $10 i32.eqz if - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 + local.get $2 + i32.eqz + if + local.get $0 + call $~lib/rt/pure/__retain + br $folding-inner1 + end + call $~lib/rt/tlsf/maybeInitialize + local.get $4 + local.get $2 + local.get $4 + i32.const 1 + i32.add + i32.mul + i32.add + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + local.tee $3 + local.get $5 + local.get $2 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $2 + local.set $1 + loop $for-loop|0 + local.get $9 + local.get $4 + i32.lt_u + if + local.get $3 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.get $0 + local.get $9 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.const 1 + i32.shl + i32.add + local.get $5 + local.get $2 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $1 + local.get $2 + i32.add + local.set $1 + local.get $9 + i32.const 1 + i32.add + local.set $9 + br $for-loop|0 + end + end br $folding-inner0 end - call $~lib/rt/tlsf/maybeInitialize - local.get $4 local.get $2 + local.get $10 + i32.eq + if + call $~lib/rt/tlsf/maybeInitialize + local.get $4 + i32.const 1 + i32.shl + local.tee $3 + i32.const 1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + local.tee $1 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + loop $while-continue|1 + local.get $0 + local.get $7 + local.get $6 + call $~lib/string/String#indexOf + local.tee $3 + i32.const -1 + i32.xor + if + local.get $1 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.get $5 + local.get $2 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $3 + local.get $10 + i32.add + local.set $6 + br $while-continue|1 + end + end + local.get $1 + call $~lib/rt/pure/__retain + br $folding-inner1 + end local.get $4 - i32.const 1 - i32.add - i32.mul - i32.add - i32.const 1 - i32.shl - i32.const 1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - local.tee $3 - local.get $6 - local.get $2 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $2 local.set $1 - loop $for-loop|0 - local.get $9 - local.get $4 - i32.lt_u + loop $while-continue|2 + local.get $0 + local.get $7 + local.get $6 + call $~lib/string/String#indexOf + local.tee $9 + i32.const -1 + i32.xor if local.get $3 + i32.eqz + if + call $~lib/rt/tlsf/maybeInitialize + local.get $4 + i32.const 1 + i32.shl + i32.const 1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + local.set $3 + end + local.get $8 local.get $1 + i32.gt_u + if + local.get $3 + local.get $1 + i32.const 1 + i32.shl + local.tee $1 + i32.const 1 + i32.shl + call $~lib/rt/tlsf/__realloc + local.set $3 + end + local.get $3 + local.get $8 i32.const 1 i32.shl i32.add local.get $0 - local.get $9 + local.get $6 i32.const 1 i32.shl i32.add - i32.load16_u - i32.store16 - local.get $3 - local.get $1 + local.get $9 + local.get $6 + i32.sub + local.tee $6 i32.const 1 + i32.shl + call $~lib/memory/memory.copy + local.get $3 + local.get $6 + local.get $8 i32.add - local.tee $1 + local.tee $6 i32.const 1 i32.shl i32.add - local.get $6 + local.get $5 local.get $2 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $1 local.get $2 + local.get $6 i32.add - local.set $1 + local.set $8 local.get $9 - i32.const 1 + local.get $10 i32.add - local.set $9 - br $for-loop|0 + local.set $6 + br $while-continue|2 end end - local.get $3 - call $~lib/rt/pure/__retain - local.set $0 - br $folding-inner0 - end - local.get $2 - local.get $10 - i32.eq - if - call $~lib/rt/tlsf/maybeInitialize - local.get $4 - i32.const 1 - i32.shl - local.tee $3 - i32.const 1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - local.tee $1 - local.get $0 - local.get $3 - call $~lib/memory/memory.copy - loop $while-continue|1 - local.get $0 + local.get $8 + if local.get $8 - local.get $5 - call $~lib/string/String#indexOf - local.tee $3 - i32.const -1 - i32.xor + local.get $1 + i32.gt_u if - local.get $1 local.get $3 + local.get $1 i32.const 1 i32.shl - i32.add - local.get $6 - local.get $2 + local.tee $1 i32.const 1 i32.shl - call $~lib/memory/memory.copy - local.get $3 - local.get $10 - i32.add - local.set $5 - br $while-continue|1 + call $~lib/rt/tlsf/__realloc + local.set $3 end - end - local.get $1 - call $~lib/rt/pure/__retain - local.set $0 - br $folding-inner0 - end - local.get $4 - local.set $1 - loop $while-continue|2 - local.get $0 - local.get $8 - local.get $5 - call $~lib/string/String#indexOf - local.tee $9 - i32.const -1 - i32.xor - if - local.get $3 - i32.eqz + local.get $4 + local.get $6 + i32.sub + local.tee $2 if - call $~lib/rt/tlsf/maybeInitialize - local.get $4 + local.get $3 + local.get $8 i32.const 1 i32.shl + i32.add + local.get $0 + local.get $6 i32.const 1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 + i32.shl i32.add - local.set $3 + local.get $2 + i32.const 1 + i32.shl + call $~lib/memory/memory.copy end - local.get $7 local.get $1 + local.get $2 + local.get $8 + i32.add + local.tee $0 i32.gt_u if local.get $3 - local.get $1 - i32.const 1 - i32.shl - local.tee $1 + local.get $0 i32.const 1 i32.shl call $~lib/rt/tlsf/__realloc local.set $3 end - local.get $3 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $0 - local.get $5 - i32.const 1 - i32.shl - i32.add - local.get $9 - local.get $5 - i32.sub - local.tee $5 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $3 - local.get $5 - local.get $7 - i32.add - local.tee $5 - i32.const 1 - i32.shl - i32.add - local.get $6 - local.get $2 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - local.get $2 - local.get $5 - i32.add - local.set $7 - local.get $9 - local.get $10 - i32.add - local.set $5 - br $while-continue|2 + br $folding-inner0 end - end - local.get $7 - if + local.get $0 + call $~lib/rt/pure/__retain local.get $7 - local.get $1 - i32.gt_u - if - local.get $3 - local.get $1 - i32.const 1 - i32.shl - local.tee $1 - i32.const 1 - i32.shl - call $~lib/rt/tlsf/__realloc - local.set $3 - end - local.get $4 + call $~lib/rt/pure/__release local.get $5 - i32.sub - local.tee $2 - if - local.get $3 - local.get $7 - i32.const 1 - i32.shl - i32.add - local.get $0 - local.get $5 - i32.const 1 - i32.shl - i32.add - local.get $2 - i32.const 1 - i32.shl - call $~lib/memory/memory.copy - end - local.get $1 - local.get $2 - local.get $7 - i32.add - local.tee $0 - i32.gt_u - if (result i32) - local.get $3 - local.get $0 - i32.const 1 - i32.shl - call $~lib/rt/tlsf/__realloc - else - local.get $3 - end - call $~lib/rt/pure/__retain - local.set $0 - br $folding-inner0 + call $~lib/rt/pure/__release + return end - local.get $0 + local.get $3 call $~lib/rt/pure/__retain - local.get $8 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - return end - local.get $8 + local.get $7 call $~lib/rt/pure/__release - local.get $6 + local.get $5 call $~lib/rt/pure/__release - local.get $0 ) (func $~lib/string/String#slice (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) From 42faca25f740342fdacb4823b91df928be182a7e Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 12 Oct 2020 22:50:02 +0300 Subject: [PATCH 7/9] apply rse later --- src/module.ts | 2 +- tests/compiler/comma.optimized.wat | 7 +- tests/compiler/do.optimized.wat | 129 ++-- .../extends-baseaggregate.optimized.wat | 18 +- tests/compiler/for.optimized.wat | 38 +- .../implicit-getter-setter.optimized.wat | 18 +- tests/compiler/issues/1095.optimized.wat | 18 +- tests/compiler/issues/1225.optimized.wat | 18 +- tests/compiler/logical.optimized.wat | 18 +- tests/compiler/managed-cast.optimized.wat | 18 +- tests/compiler/object-literal.optimized.wat | 18 +- tests/compiler/rc/local-init.optimized.wat | 18 +- .../rc/logical-and-mismatch.optimized.wat | 18 +- .../rc/logical-or-mismatch.optimized.wat | 18 +- tests/compiler/rc/optimize.optimized.wat | 18 +- tests/compiler/rc/rereturn.optimized.wat | 18 +- .../rc/ternary-mismatch.optimized.wat | 18 +- tests/compiler/resolve-ternary.optimized.wat | 18 +- .../retain-release-sanity.optimized.wat | 18 +- tests/compiler/retain-return.optimized.wat | 18 +- tests/compiler/rt/finalize.optimized.wat | 18 +- tests/compiler/runtime-full.optimized.wat | 18 +- tests/compiler/scoped.optimized.wat | 9 +- .../compiler/std/array-literal.optimized.wat | 18 +- tests/compiler/std/array.optimized.wat | 90 ++- tests/compiler/std/arraybuffer.optimized.wat | 18 +- tests/compiler/std/dataview.optimized.wat | 18 +- tests/compiler/std/map.optimized.wat | 18 +- tests/compiler/std/math.optimized.wat | 385 +++++------ tests/compiler/std/mod.optimized.wat | 1 + tests/compiler/std/set.optimized.wat | 18 +- tests/compiler/std/staticarray.optimized.wat | 18 +- .../std/string-casemapping.optimized.wat | 24 +- .../std/string-encoding.optimized.wat | 18 +- tests/compiler/std/string.optimized.wat | 653 +++++++++--------- tests/compiler/std/typedarray.optimized.wat | 582 ++++++++-------- tests/compiler/while.optimized.wat | 22 +- 37 files changed, 1209 insertions(+), 1183 deletions(-) diff --git a/src/module.ts b/src/module.ts index 19076aa509..206ffd95ff 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1519,7 +1519,6 @@ export class Module { if (optimizeLevel >= 3 || shrinkLevel >= 1) { passes.push("simplify-locals-notee-nostructure"); - passes.push("rse"); passes.push("vacuum"); passes.push("ssa-nomerge"); passes.push("simplify-globals-optimizing"); @@ -1547,6 +1546,7 @@ export class Module { // } passes.push("optimize-instructions"); if (optimizeLevel >= 3 || shrinkLevel >= 1) { + passes.push("rse"); passes.push("dce"); } passes.push("remove-unused-brs"); diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index b8197dbcf8..96014cf36e 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -10,13 +10,12 @@ (start $~start) (func $start:comma (local $0 i32) - (local $1 i32) global.get $comma/a - local.tee $1 + local.tee $0 i32.const 1 i32.add global.set $comma/a - local.get $1 + local.get $0 global.set $comma/b global.get $comma/a i32.const 1 @@ -80,6 +79,8 @@ global.set $comma/b i32.const 2 global.set $comma/a + i32.const 0 + local.set $0 loop $for-loop|0 local.get $0 global.get $comma/a diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 8a2442c3f9..86f7d0f728 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -683,11 +683,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1216 @@ -695,14 +695,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -712,17 +712,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end @@ -1028,22 +1028,23 @@ (local $0 i32) (local $1 i32) (local $2 i32) + (local $3 i32) i32.const 0 global.set $do/ran i32.const 10 - local.set $0 + local.set $1 loop $do-continue|0 - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 - local.get $0 + local.set $0 + local.get $1 i32.const 1 i32.sub - local.tee $0 + local.tee $1 br_if $do-continue|0 end - local.get $0 + local.get $1 if i32.const 0 i32.const 1040 @@ -1052,7 +1053,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 10 i32.ne if @@ -1068,17 +1069,17 @@ i32.const 0 global.set $do/ran i32.const 10 - local.set $1 + local.set $0 loop $do-continue|00 - local.get $1 - local.tee $0 + local.get $0 + local.tee $1 i32.const 1 i32.sub - local.set $1 - local.get $0 + local.set $0 + local.get $1 br_if $do-continue|00 end - local.get $1 + local.get $0 i32.const -1 i32.ne if @@ -1108,14 +1109,14 @@ global.set $do/ran i32.const 0 local.set $0 - loop $do-continue|01 + loop $do-continue|001 local.get $0 i32.const 1 i32.add local.tee $0 i32.const 10 i32.ne - br_if $do-continue|01 + br_if $do-continue|001 end local.get $0 i32.const 10 @@ -1132,14 +1133,14 @@ global.set $do/ran i32.const 0 local.set $0 - loop $do-continue|02 + loop $do-continue|01 local.get $0 i32.const 1 i32.add local.tee $0 i32.const 10 i32.ne - br_if $do-continue|02 + br_if $do-continue|01 end local.get $0 i32.const 10 @@ -1168,14 +1169,14 @@ global.set $do/ran i32.const 0 local.set $0 - loop $do-continue|03 + loop $do-continue|02 local.get $0 i32.const 1 i32.add local.tee $0 i32.const 10 i32.ne - br_if $do-continue|03 + br_if $do-continue|02 end local.get $0 i32.const 10 @@ -1193,30 +1194,30 @@ i32.const 0 global.set $do/ran i32.const 0 - local.set $1 - i32.const 0 local.set $0 - loop $do-continue|04 - local.get $1 + i32.const 0 + local.set $1 + loop $do-continue|03 + local.get $0 i32.const 1 i32.add - local.tee $1 + local.tee $0 i32.const 10 i32.ne if loop $do-continue|1 - local.get $0 + local.get $1 i32.const 1 i32.add - local.tee $0 + local.tee $1 i32.const 10 i32.rem_s br_if $do-continue|1 end - br $do-continue|04 + br $do-continue|03 end end - local.get $1 + local.get $0 i32.const 10 i32.ne if @@ -1227,7 +1228,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 90 i32.ne if @@ -1247,8 +1248,8 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $1 - loop $do-continue|05 + local.set $0 + loop $do-continue|04 local.get $2 i32.const 1 i32.add @@ -1257,10 +1258,10 @@ i32.eq if i32.const 0 - local.set $0 - local.get $1 + local.set $1 + local.get $0 if - local.get $1 + local.get $0 call $~lib/rt/pure/__release end else @@ -1269,13 +1270,13 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $0 - local.get $1 + local.set $1 + local.get $0 call $~lib/rt/pure/__release end - local.get $0 - local.tee $1 - br_if $do-continue|05 + local.get $1 + local.tee $0 + br_if $do-continue|04 end local.get $2 i32.const 10 @@ -1288,7 +1289,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 if i32.const 0 i32.const 1040 @@ -1299,7 +1300,7 @@ end i32.const 1 global.set $do/ran - local.get $1 + local.get $0 call $~lib/rt/pure/__release global.get $do/ran i32.eqz @@ -1313,30 +1314,28 @@ end i32.const 0 global.set $do/ran - i32.const 0 - local.set $2 call $~lib/rt/tlsf/maybeInitialize call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $1 - loop $do-continue|06 + local.set $0 + loop $do-continue|05 block $do-break|0 - local.get $2 + local.get $3 i32.const 1 i32.add - local.tee $2 + local.tee $3 i32.const 10 i32.eq if - local.get $1 + local.get $0 if - local.get $1 + local.get $0 call $~lib/rt/pure/__release end i32.const 0 - local.set $1 + local.set $0 br $do-break|0 end call $~lib/rt/tlsf/maybeInitialize @@ -1344,13 +1343,13 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $0 + local.tee $2 call $~lib/rt/pure/__release - local.get $0 - br_if $do-continue|06 + local.get $2 + br_if $do-continue|05 end end - local.get $2 + local.get $3 i32.const 10 i32.ne if @@ -1361,7 +1360,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 if i32.const 0 i32.const 1040 @@ -1372,7 +1371,7 @@ end i32.const 1 global.set $do/ran - local.get $1 + local.get $0 call $~lib/rt/pure/__release global.get $do/ran i32.eqz diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index b11fdea5d1..8a8739bb6c 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -613,11 +613,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1568 @@ -625,14 +625,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -642,17 +642,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 0c685af875..07c9eeb6a1 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -680,11 +680,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1216 @@ -692,14 +692,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -709,17 +709,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end @@ -1035,7 +1035,7 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $1 + local.set $0 call $~lib/rt/pure/__release loop $for-loop|0 block $for-break0 @@ -1044,9 +1044,9 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $0 + local.tee $1 call $~lib/rt/pure/__release - local.get $0 + local.get $1 if local.get $2 i32.const 1 @@ -1055,13 +1055,13 @@ i32.const 10 i32.eq if - local.get $1 + local.get $0 if - local.get $1 + local.get $0 call $~lib/rt/pure/__release end i32.const 0 - local.set $1 + local.set $0 br $for-break0 end call $~lib/rt/tlsf/maybeInitialize @@ -1069,9 +1069,9 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.get $1 + local.get $0 call $~lib/rt/pure/__release - local.set $1 + local.set $0 br $for-loop|0 end end @@ -1087,7 +1087,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 if i32.const 0 i32.const 1040 @@ -1098,7 +1098,7 @@ end i32.const 1 global.set $for/ran - local.get $1 + local.get $0 call $~lib/rt/pure/__release ) (func $start:for diff --git a/tests/compiler/implicit-getter-setter.optimized.wat b/tests/compiler/implicit-getter-setter.optimized.wat index 2a1d1cc31d..c058758266 100644 --- a/tests/compiler/implicit-getter-setter.optimized.wat +++ b/tests/compiler/implicit-getter-setter.optimized.wat @@ -616,11 +616,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1232 @@ -628,14 +628,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -645,17 +645,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index b1142a3589..a025f6fe22 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -601,11 +601,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1312 @@ -613,14 +613,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -630,17 +630,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/issues/1225.optimized.wat b/tests/compiler/issues/1225.optimized.wat index 08a0477c45..dc73b74c26 100644 --- a/tests/compiler/issues/1225.optimized.wat +++ b/tests/compiler/issues/1225.optimized.wat @@ -602,11 +602,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1232 @@ -614,14 +614,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -631,17 +631,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index 1dda007090..0ea0dde415 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1232 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index e8230a9888..87087aef59 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -603,11 +603,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1392 @@ -615,14 +615,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -632,17 +632,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index eb0d3a9405..b33e99d178 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -607,11 +607,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1440 @@ -619,14 +619,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -636,17 +636,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat index 5e6c0bef61..c8bd5e4beb 100644 --- a/tests/compiler/rc/local-init.optimized.wat +++ b/tests/compiler/rc/local-init.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1200 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat index c8d58ebd01..326e2889dc 100644 --- a/tests/compiler/rc/logical-and-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1184 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat index e92a189f1b..818cfc3ff9 100644 --- a/tests/compiler/rc/logical-or-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1184 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index 11ddfde728..d7e595e643 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -688,11 +688,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1216 @@ -700,14 +700,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -717,17 +717,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat index ef7b216752..4aa56c9e99 100644 --- a/tests/compiler/rc/rereturn.optimized.wat +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -607,11 +607,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1232 @@ -619,14 +619,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -636,17 +636,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat index bd2a910f04..0dee96d4fe 100644 --- a/tests/compiler/rc/ternary-mismatch.optimized.wat +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -601,11 +601,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1184 @@ -613,14 +613,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -630,17 +630,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index 299501c546..9c668a330a 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -632,11 +632,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 2880 @@ -644,14 +644,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -661,17 +661,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 1aef9ac5e6..833dcef6eb 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -625,11 +625,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1664 @@ -637,14 +637,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -654,17 +654,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/retain-return.optimized.wat b/tests/compiler/retain-return.optimized.wat index 7ba2cc8a70..f2ed54a9d5 100644 --- a/tests/compiler/retain-return.optimized.wat +++ b/tests/compiler/retain-return.optimized.wat @@ -608,11 +608,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1376 @@ -620,14 +620,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -637,17 +637,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat index 9203a97b41..b94a9877e1 100644 --- a/tests/compiler/rt/finalize.optimized.wat +++ b/tests/compiler/rt/finalize.optimized.wat @@ -628,11 +628,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1600 @@ -640,14 +640,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -657,17 +657,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index a65a8a749a..30650de49e 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -606,11 +606,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1216 @@ -618,14 +618,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -635,17 +635,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/scoped.optimized.wat b/tests/compiler/scoped.optimized.wat index d9bbd8322b..001d9087e1 100644 --- a/tests/compiler/scoped.optimized.wat +++ b/tests/compiler/scoped.optimized.wat @@ -5,6 +5,7 @@ (start $~start) (func $~start (local $0 i32) + (local $1 i32) loop $for-loop|0 local.get $0 i32.const 1 @@ -17,17 +18,15 @@ br $for-loop|0 end end - i32.const 0 - local.set $0 loop $for-loop|1 - local.get $0 + local.get $1 i32.const 1 i32.lt_s if - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|1 end end diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index fa30ba92e5..3e5d207563 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -654,11 +654,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1536 @@ -666,14 +666,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -683,17 +683,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 671182a165..8b090eb513 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -983,11 +983,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 11936 @@ -995,14 +995,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -1012,17 +1012,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end @@ -19360,20 +19360,21 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $1 local.get $0 i32.load offset=12 - local.tee $2 + local.tee $4 local.get $1 i32.load offset=12 i32.const 0 local.get $1 select - local.tee $5 + local.tee $6 i32.add - local.tee $3 + local.tee $2 i32.const 268435452 i32.gt_u if @@ -19384,80 +19385,78 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.const 2 i32.const 29 i32.const 0 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $6 + local.tee $7 i32.load offset=4 - local.set $3 - local.get $2 + local.set $2 + local.get $4 i32.const 2 i32.shl - local.set $2 + local.set $4 local.get $0 i32.load offset=4 local.set $0 loop $for-loop|0 + local.get $3 local.get $4 - local.get $2 i32.lt_u if + local.get $2 local.get $3 - local.get $4 i32.add local.get $0 - local.get $4 + local.get $3 i32.add i32.load call $~lib/rt/pure/__retain i32.store - local.get $4 + local.get $3 i32.const 4 i32.add - local.set $4 + local.set $3 br $for-loop|0 end end local.get $2 - local.get $3 + local.get $4 i32.add - local.set $4 + local.set $0 local.get $1 i32.load offset=4 local.set $3 - local.get $5 + local.get $6 i32.const 2 i32.shl local.set $2 - i32.const 0 - local.set $0 loop $for-loop|1 - local.get $0 + local.get $5 local.get $2 i32.lt_u if local.get $0 - local.get $4 + local.get $5 i32.add - local.get $0 local.get $3 + local.get $5 i32.add i32.load call $~lib/rt/pure/__retain i32.store - local.get $0 + local.get $5 i32.const 4 i32.add - local.set $0 + local.set $5 br $for-loop|1 end end local.get $1 call $~lib/rt/pure/__release - local.get $6 + local.get $7 ) (func $~lib/array/Array<~lib/string/String>#copyWithin (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) @@ -19466,12 +19465,10 @@ local.get $0 i32.load offset=4 local.set $5 + local.get $3 local.get $0 i32.load offset=12 local.tee $4 - local.set $6 - local.get $3 - local.get $4 local.get $3 local.get $4 i32.lt_s @@ -19494,7 +19491,7 @@ local.get $1 local.get $4 local.get $1 - local.get $6 + local.get $4 i32.lt_s select end @@ -19849,6 +19846,7 @@ (func $~lib/array/Array<~lib/string/String>#slice (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) + (local $5 i32) local.get $0 i32.load offset=12 local.set $3 @@ -19911,38 +19909,36 @@ call $~lib/rt/pure/__retain local.tee $3 i32.load offset=4 - local.set $4 + local.set $5 local.get $0 i32.load offset=4 local.get $1 i32.const 2 i32.shl i32.add - local.set $1 - i32.const 0 local.set $0 local.get $2 i32.const 2 i32.shl - local.set $2 + local.set $1 loop $while-continue|0 - local.get $0 - local.get $2 + local.get $4 + local.get $1 i32.lt_u if - local.get $0 local.get $4 + local.get $5 i32.add local.get $0 - local.get $1 + local.get $4 i32.add i32.load call $~lib/rt/pure/__retain i32.store - local.get $0 + local.get $4 i32.const 4 i32.add - local.set $0 + local.set $4 br $while-continue|0 end end diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 8aa69b6183..56f6274f02 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -616,11 +616,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1440 @@ -628,14 +628,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -645,17 +645,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index eea772314f..1dbc024b29 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -624,11 +624,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1520 @@ -636,14 +636,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -653,17 +653,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index f10975ce95..08f4dd4a99 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -622,11 +622,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1568 @@ -634,14 +634,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -651,17 +651,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 204d31447a..3aef007625 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -5282,59 +5282,58 @@ ) (func $~lib/math/NativeMathf.exp2 (param $0 f32) (result f32) (local $1 f64) - (local $2 i32) + (local $2 f32) (local $3 i32) - (local $4 f64) - (local $5 i64) - block $~lib/util/math/exp2f_lut|inlined.0 (result f32) - local.get $0 - f64.promote_f32 - local.set $1 + (local $4 i32) + (local $5 f64) + (local $6 i64) + local.get $0 + f64.promote_f32 + local.set $1 + block $~lib/util/math/exp2f_lut|inlined.0 local.get $0 i32.reinterpret_f32 - local.tee $2 + local.tee $3 i32.const 20 i32.shr_u i32.const 2047 i32.and - local.tee $3 + local.tee $4 i32.const 1072 i32.ge_u if - f32.const 0 - local.get $2 + local.get $3 i32.const -8388608 i32.eq br_if $~lib/util/math/exp2f_lut|inlined.0 - drop local.get $0 local.get $0 f32.add - local.get $3 + local.set $2 + local.get $4 i32.const 2040 i32.ge_u br_if $~lib/util/math/exp2f_lut|inlined.0 - drop local.get $0 f32.const 1701411834604692317316873e14 f32.mul + local.set $2 local.get $0 f32.const 0 f32.gt br_if $~lib/util/math/exp2f_lut|inlined.0 - drop f32.const 0 + local.set $2 local.get $0 f32.const -150 f32.le br_if $~lib/util/math/exp2f_lut|inlined.0 - drop end local.get $1 local.get $1 f64.const 211106232532992 f64.add - local.tee $4 + local.tee $5 f64.const 211106232532992 f64.sub f64.sub @@ -5353,9 +5352,9 @@ f64.mul f64.mul f64.add - local.get $4 + local.get $5 i64.reinterpret_f64 - local.tee $5 + local.tee $6 i32.wrap_i64 i32.const 31 i32.and @@ -5364,14 +5363,16 @@ i32.const 3336 i32.add i64.load - local.get $5 + local.get $6 i64.const 47 i64.shl i64.add f64.reinterpret_i64 f64.mul f32.demote_f64 + local.set $2 end + local.get $2 ) (func $std/math/test_floor (param $0 f64) (param $1 f64) (result i32) local.get $0 @@ -6898,20 +6899,21 @@ (local $3 f64) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 f64) + (local $6 f64) + (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 f64) + (local $9 f64) + (local $10 i32) (local $11 i32) - (local $12 i32) - (local $13 f64) - (local $14 i64) - (local $15 f64) + (local $12 f64) + (local $13 i64) + (local $14 f64) + (local $15 i32) (local $16 i32) (local $17 f64) (local $18 i32) - (local $19 f64) + (local $19 i32) + (local $20 f64) local.get $1 f64.abs f64.const 2 @@ -6966,30 +6968,30 @@ end local.get $0 i64.reinterpret_f64 - local.tee $14 + local.tee $13 i32.wrap_i64 local.set $18 - local.get $14 + local.get $13 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $16 + local.tee $15 i32.const 2147483647 i32.and local.set $4 local.get $1 i64.reinterpret_f64 - local.tee $14 + local.tee $13 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $8 + local.tee $7 i32.const 2147483647 i32.and - local.tee $9 - local.get $14 + local.tee $8 + local.get $13 i32.wrap_i64 - local.tee $6 + local.tee $19 i32.or i32.eqz if @@ -6997,14 +6999,14 @@ return end i32.const 1 - local.get $6 + local.get $19 i32.const 0 - local.get $9 + local.get $8 i32.const 2146435072 i32.eq select i32.const 1 - local.get $9 + local.get $8 i32.const 2146435072 i32.gt_u i32.const 1 @@ -7026,51 +7028,51 @@ f64.add return end - local.get $16 + local.get $15 i32.const 0 i32.lt_s if (result i32) - local.get $9 + local.get $8 i32.const 1128267776 i32.ge_u if (result i32) i32.const 2 else - local.get $9 + local.get $8 i32.const 1072693248 i32.ge_u if (result i32) i32.const 52 i32.const 20 - local.get $9 + local.get $8 i32.const 20 i32.shr_u i32.const 1023 i32.sub - local.tee $11 + local.tee $10 i32.const 20 i32.gt_s local.tee $5 select - local.get $11 + local.get $10 i32.sub - local.set $12 + local.set $11 i32.const 2 - local.get $6 - local.get $9 + local.get $19 + local.get $8 local.get $5 select local.tee $5 - local.get $12 + local.get $11 i32.shr_u - local.tee $11 + local.tee $10 i32.const 1 i32.and i32.sub i32.const 0 local.get $5 + local.get $10 local.get $11 - local.get $12 i32.shl i32.eq select @@ -7082,10 +7084,10 @@ i32.const 0 end local.set $5 - local.get $6 + local.get $19 i32.eqz if - local.get $9 + local.get $8 i32.const 2146435072 i32.eq if @@ -7101,7 +7103,7 @@ if local.get $1 f64.const 0 - local.get $8 + local.get $7 i32.const 0 i32.ge_s select @@ -7110,7 +7112,7 @@ f64.const 0 local.get $1 f64.neg - local.get $8 + local.get $7 i32.const 0 i32.ge_s select @@ -7123,11 +7125,11 @@ end unreachable end - local.get $9 + local.get $8 i32.const 1072693248 i32.eq if - local.get $8 + local.get $7 i32.const 0 i32.ge_s if @@ -7139,7 +7141,7 @@ f64.div return end - local.get $8 + local.get $7 i32.const 1073741824 i32.eq if @@ -7148,11 +7150,11 @@ f64.mul return end - local.get $8 + local.get $7 i32.const 1071644672 i32.eq if - local.get $16 + local.get $15 i32.const 0 i32.ge_s if @@ -7184,12 +7186,12 @@ local.get $3 f64.div local.get $3 - local.get $8 + local.get $7 i32.const 0 i32.lt_s select local.set $3 - local.get $16 + local.get $15 i32.const 0 i32.lt_s if (result f64) @@ -7220,7 +7222,7 @@ return end end - local.get $16 + local.get $15 i32.const 0 i32.lt_s if (result f64) @@ -7244,12 +7246,12 @@ else f64.const 1 end - local.set $10 - local.get $9 + local.set $9 + local.get $8 i32.const 1105199104 i32.gt_u if (result f64) - local.get $9 + local.get $8 i32.const 1139802112 i32.gt_u if @@ -7259,7 +7261,7 @@ if f64.const inf f64.const 0 - local.get $8 + local.get $7 i32.const 0 i32.lt_s select @@ -7271,7 +7273,7 @@ if f64.const inf f64.const 0 - local.get $8 + local.get $7 i32.const 0 i32.gt_s select @@ -7282,17 +7284,17 @@ i32.const 1072693247 i32.lt_s if - local.get $10 + local.get $9 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul - local.get $10 + local.get $9 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul - local.get $8 + local.get $7 i32.const 0 i32.lt_s select @@ -7302,17 +7304,17 @@ i32.const 1072693248 i32.gt_s if - local.get $10 + local.get $9 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul - local.get $10 + local.get $9 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul - local.get $8 + local.get $7 i32.const 0 i32.gt_s select @@ -7350,9 +7352,9 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.set $7 + local.set $6 local.get $0 - local.get $7 + local.get $6 local.get $3 f64.sub f64.sub @@ -7380,7 +7382,7 @@ i32.const 1023 i32.sub i32.add - local.set $6 + local.set $7 local.get $4 i32.const 1048575 i32.and @@ -7390,28 +7392,25 @@ local.set $4 local.get $5 i32.const 235662 - i32.le_s - if (result i32) - i32.const 0 - else + i32.gt_s + if local.get $5 i32.const 767610 i32.lt_s - if (result i32) + if i32.const 1 + local.set $16 else - local.get $6 + local.get $7 i32.const 1 i32.add - local.set $6 + local.set $7 local.get $4 i32.const -1048576 i32.add local.set $4 - i32.const 0 end end - local.set $5 local.get $3 i64.reinterpret_f64 i64.const 4294967295 @@ -7422,16 +7421,16 @@ i64.shl i64.or f64.reinterpret_i64 - local.tee $7 + local.tee $6 f64.const 1.5 f64.const 1 - local.get $5 + local.get $16 select local.tee $2 f64.sub local.tee $3 f64.const 1 - local.get $7 + local.get $6 local.get $2 f64.add f64.div @@ -7442,24 +7441,24 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $15 - local.get $15 - local.get $15 + local.tee $14 + local.get $14 + local.get $14 f64.mul - local.tee $19 + local.tee $20 f64.const 3 f64.add local.get $17 local.get $17 f64.mul - local.tee $13 - local.get $13 + local.tee $12 + local.get $12 f64.mul - local.get $13 - local.get $13 - local.get $13 - local.get $13 - local.get $13 + local.get $12 + local.get $12 + local.get $12 + local.get $12 + local.get $12 f64.const 0.20697501780033842 f64.mul f64.const 0.23066074577556175 @@ -7479,7 +7478,7 @@ f64.mul local.get $0 local.get $3 - local.get $15 + local.get $14 local.get $4 i32.const 1 i32.shr_s @@ -7487,7 +7486,7 @@ i32.or i32.const 524288 i32.add - local.get $5 + local.get $16 i32.const 18 i32.shl i32.add @@ -7498,8 +7497,8 @@ local.tee $0 f64.mul f64.sub - local.get $15 - local.get $7 + local.get $14 + local.get $6 local.get $0 local.get $2 f64.sub @@ -7508,7 +7507,7 @@ f64.sub f64.mul local.tee $2 - local.get $15 + local.get $14 local.get $17 f64.add f64.mul @@ -7519,17 +7518,17 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $7 + local.tee $6 f64.mul local.tee $3 local.get $2 - local.get $7 + local.get $6 f64.mul local.get $0 - local.get $7 + local.get $6 f64.const 3 f64.sub - local.get $19 + local.get $20 f64.sub f64.sub local.get $17 @@ -7544,7 +7543,7 @@ local.tee $2 f64.const 0.9617967009544373 f64.mul - local.tee $19 + local.tee $20 local.get $2 f64.const -7.028461650952758e-09 f64.mul @@ -7558,18 +7557,18 @@ f64.add f64.const 1.350039202129749e-08 f64.const 0 - local.get $5 + local.get $16 select f64.add local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - local.get $5 + local.get $16 select local.tee $3 f64.add - local.get $6 + local.get $7 f64.convert_i32_s local.tee $0 f64.add @@ -7577,14 +7576,14 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.set $7 + local.set $6 local.get $2 - local.get $7 + local.get $6 local.get $0 f64.sub local.get $3 f64.sub - local.get $19 + local.get $20 f64.sub f64.sub end @@ -7597,7 +7596,7 @@ f64.reinterpret_i64 local.tee $0 f64.sub - local.get $7 + local.get $6 f64.mul local.get $1 local.get $3 @@ -7605,27 +7604,27 @@ f64.add local.tee $1 local.get $0 - local.get $7 + local.get $6 f64.mul local.tee $2 f64.add local.tee $0 i64.reinterpret_f64 - local.tee $14 + local.tee $13 i32.wrap_i64 local.set $5 block $folding-inner1 block $folding-inner0 - local.get $14 + local.get $13 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $12 + local.tee $11 i32.const 1083179008 i32.ge_s if local.get $5 - local.get $12 + local.get $11 i32.const 1083179008 i32.sub i32.or @@ -7639,14 +7638,14 @@ i32.or br_if $folding-inner0 else - local.get $12 + local.get $11 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_u i32.const 0 local.get $5 - local.get $12 + local.get $11 i32.const -1064252416 i32.sub i32.or @@ -7659,31 +7658,31 @@ select br_if $folding-inner1 end - local.get $12 + local.get $11 i32.const 2147483647 i32.and - local.tee $11 + local.tee $10 i32.const 20 i32.shr_u i32.const 1023 i32.sub local.set $5 i32.const 0 - local.set $6 + local.set $7 local.get $1 - local.get $11 + local.get $10 i32.const 1071644672 i32.gt_s if i32.const 1048575 - local.get $12 + local.get $11 i32.const 1048576 local.get $5 i32.const 1 i32.add i32.shr_s i32.add - local.tee $11 + local.tee $10 i32.const 2147483647 i32.and i32.const 20 @@ -7694,7 +7693,7 @@ i32.shr_s i32.const -1 i32.xor - local.get $11 + local.get $10 i32.and i64.extend_i32_s i64.const 32 @@ -7702,7 +7701,7 @@ f64.reinterpret_i64 local.set $0 i32.const 0 - local.get $11 + local.get $10 i32.const 1048575 i32.and i32.const 1048576 @@ -7711,14 +7710,14 @@ local.get $5 i32.sub i32.shr_s - local.tee $6 + local.tee $7 i32.sub - local.get $6 - local.get $12 + local.get $7 + local.get $11 i32.const 0 i32.lt_s select - local.set $6 + local.set $7 local.get $2 local.get $0 f64.sub @@ -7751,7 +7750,7 @@ local.get $2 f64.mul local.set $0 - local.get $10 + local.get $9 f64.const 1 local.get $2 local.get $2 @@ -7800,7 +7799,7 @@ i64.const 32 i64.shr_u i32.wrap_i64 - local.get $6 + local.get $7 i32.const 20 i32.shl i32.add @@ -7811,7 +7810,7 @@ i32.le_s if (result f64) local.get $0 - local.get $6 + local.get $7 call $~lib/math/NativeMath.scalbn else local.get $0 @@ -7828,14 +7827,14 @@ f64.mul return end - local.get $10 + local.get $9 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - local.get $10 + local.get $9 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -7863,13 +7862,13 @@ (local $2 f64) (local $3 f64) (local $4 i32) - (local $5 i32) + (local $5 f64) (local $6 i32) - (local $7 i64) - (local $8 f32) - (local $9 i32) - (local $10 i64) - (local $11 f64) + (local $7 i32) + (local $8 i64) + (local $9 f32) + (local $10 i32) + (local $11 i64) local.get $1 f32.abs f32.const 2 @@ -7945,7 +7944,7 @@ local.tee $4 i32.const 2147483647 i32.and - local.set $6 + local.set $7 local.get $1 local.get $1 f32.nearest @@ -7962,28 +7961,28 @@ local.get $1 f32.const 0.5 f32.mul - local.tee $8 - local.get $8 + local.tee $9 + local.get $9 f32.nearest f32.ne i32.const 31 i32.shl - local.set $9 + local.set $10 local.get $0 f32.neg local.set $0 end local.get $1 i32.reinterpret_f32 - local.set $5 - local.get $6 + local.set $6 + local.get $7 i32.const 1065353216 i32.eq if (result i32) i32.const 2143289344 i32.const 1065353216 local.get $4 - local.get $5 + local.get $6 i32.const 2147483647 i32.and i32.const 2139095040 @@ -7991,15 +7990,15 @@ i32.or select else - local.get $6 + local.get $7 if (result i32) - local.get $6 + local.get $7 i32.const 2139095040 i32.eq if (result i32) i32.const 0 i32.const 2139095040 - local.get $5 + local.get $6 i32.const 31 i32.shr_u select @@ -8008,34 +8007,33 @@ if (result i32) i32.const 2143289344 else - block $~lib/math/exp2f|inlined.0 (result f64) - local.get $0 - f64.promote_f32 - i64.reinterpret_f64 - local.tee $10 - i64.const 4604544271217802189 - i64.sub - i64.const 52 - i64.shr_s - local.set $7 - local.get $10 - local.get $7 - i64.const 52 - i64.shl - i64.sub - f64.reinterpret_i64 - local.tee $2 - f64.const 1 - f64.sub - local.get $2 - f64.const 1 - f64.add - f64.div - local.tee $3 - local.get $3 - f64.mul - local.set $2 - f64.const 0 + local.get $0 + f64.promote_f32 + i64.reinterpret_f64 + local.tee $11 + i64.const 4604544271217802189 + i64.sub + i64.const 52 + i64.shr_s + local.set $8 + local.get $11 + local.get $8 + i64.const 52 + i64.shl + i64.sub + f64.reinterpret_i64 + local.tee $2 + f64.const 1 + f64.sub + local.get $2 + f64.const 1 + f64.add + f64.div + local.tee $3 + local.get $3 + f64.mul + local.set $2 + block $~lib/math/exp2f|inlined.0 local.get $1 f64.promote_f32 local.get $3 @@ -8061,7 +8059,7 @@ f64.add f64.const 2.8853900817779268 f64.mul - local.get $7 + local.get $8 f64.convert_i64_s f64.add f64.mul @@ -8069,17 +8067,16 @@ f64.const -1022 f64.lt br_if $~lib/math/exp2f|inlined.0 - drop f64.const inf + local.set $5 local.get $2 f64.const 1024 f64.ge br_if $~lib/math/exp2f|inlined.0 - drop local.get $2 local.get $2 f64.nearest - local.tee $11 + local.tee $5 f64.sub local.tee $2 local.get $2 @@ -8113,13 +8110,15 @@ f64.const 1 f64.add i64.reinterpret_f64 - local.get $11 + local.get $5 i64.trunc_f64_s i64.const 52 i64.shl i64.add f64.reinterpret_i64 + local.set $5 end + local.get $5 f32.demote_f64 i32.reinterpret_f32 end @@ -8127,13 +8126,13 @@ else i32.const 2139095040 i32.const 0 - local.get $5 + local.get $6 i32.const 31 i32.shr_u select end end - local.get $9 + local.get $10 i32.or f32.reinterpret_i32 ) diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index 74e16f90d7..34d5c026c6 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -252,6 +252,7 @@ f64.eq ) (func $std/mod/test_fmod (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (local $3 i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 824e3ffba0..052dace6c3 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -619,11 +619,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1456 @@ -631,14 +631,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -648,17 +648,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index a59abbd018..b32bd2516b 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -653,11 +653,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1472 @@ -665,14 +665,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -682,17 +682,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index 3fb7d0794f..014bcc44ce 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -934,11 +934,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 18912 @@ -946,14 +946,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -963,17 +963,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end @@ -2381,8 +2381,6 @@ i32.add i32.load16_u local.tee $3 - local.set $2 - local.get $3 i32.const 7 i32.shr_u if @@ -2786,8 +2784,8 @@ i32.const 1 i32.shl i32.add - local.get $2 - local.get $2 + local.get $3 + local.get $3 i32.const 65 i32.sub i32.const 26 diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index ec19911a23..9beb24ee19 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -684,11 +684,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 22064 @@ -696,14 +696,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -713,17 +713,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index e680d9a6ff..6f8f2512d7 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -1274,11 +1274,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 22000 @@ -1286,14 +1286,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -1303,17 +1303,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end @@ -3515,9 +3515,11 @@ (local $10 i64) (local $11 f64) (local $12 f64) - (local $13 i32) - (local $14 i64) - (local $15 i64) + (local $13 f64) + (local $14 i32) + (local $15 i32) + (local $16 i64) + (local $17 i64) block $folding-inner0 local.get $0 call $~lib/rt/pure/__retain @@ -3535,7 +3537,7 @@ i32.load16_u local.set $8 f64.const 1 - local.set $12 + local.set $13 loop $while-continue|0 local.get $6 if (result i32) @@ -3572,7 +3574,7 @@ i32.eqz br_if $folding-inner0 f64.const -1 - local.set $12 + local.set $13 local.get $0 i32.const 2 i32.add @@ -3622,7 +3624,7 @@ if local.get $4 call $~lib/rt/pure/__release - local.get $12 + local.get $13 f64.const inf f64.mul return @@ -3691,7 +3693,7 @@ select br_if $folding-inner0 i32.const 1 - local.set $13 + local.set $14 loop $for-loop|2 local.get $0 i32.load16_u @@ -3742,7 +3744,7 @@ local.set $2 loop $for-loop|3 i32.const 1 - local.get $13 + local.get $14 i32.eqz i32.const 0 local.get $8 @@ -3784,7 +3786,7 @@ local.get $1 local.set $5 i32.const 1 - local.set $13 + local.set $14 end local.get $6 i32.const 1 @@ -3805,51 +3807,61 @@ end end end - block $~lib/util/string/scientific|inlined.0 (result f64) - f64.const 0 - i32.const 1 - local.get $5 - local.get $1 - local.get $13 - select - i32.const 19 - local.get $1 - i32.const 19 - local.get $1 - i32.lt_s - select - i32.sub - block $~lib/util/string/parseExp|inlined.0 (result i32) + local.get $5 + local.get $1 + local.get $14 + select + i32.const 19 + local.get $1 + i32.const 19 + local.get $1 + i32.lt_s + select + i32.sub + local.set $8 + i32.const 1 + local.set $1 + block $~lib/util/string/parseExp|inlined.0 + local.get $0 + i32.load16_u + i32.const 32 + i32.or + i32.const 101 + i32.ne + br_if $~lib/util/string/parseExp|inlined.0 + local.get $0 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + local.tee $0 + i32.const 45 + i32.eq + if (result i32) + local.get $6 i32.const 1 - local.set $1 - i32.const 0 - local.get $0 - i32.load16_u - i32.const 32 - i32.or - i32.const 101 - i32.ne + i32.sub + local.tee $6 + i32.eqz br_if $~lib/util/string/parseExp|inlined.0 - drop - local.get $0 + i32.const -1 + local.set $1 + local.get $2 i32.const 2 i32.add local.tee $2 i32.load16_u - local.tee $0 - i32.const 45 + else + local.get $0 + i32.const 43 i32.eq if (result i32) - i32.const 0 local.get $6 i32.const 1 i32.sub local.tee $6 i32.eqz br_if $~lib/util/string/parseExp|inlined.0 - drop - i32.const -1 - local.set $1 local.get $2 i32.const 2 i32.add @@ -3857,94 +3869,79 @@ i32.load16_u else local.get $0 - i32.const 43 - i32.eq - if (result i32) - i32.const 0 - local.get $6 - i32.const 1 - i32.sub - local.tee $6 - i32.eqz - br_if $~lib/util/string/parseExp|inlined.0 - drop - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - else - local.get $0 - end - end - local.set $0 - loop $while-continue|4 - local.get $0 - i32.const 48 - i32.eq - if - i32.const 0 - local.get $6 - i32.const 1 - i32.sub - local.tee $6 - i32.eqz - br_if $~lib/util/string/parseExp|inlined.0 - drop - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - local.set $0 - br $while-continue|4 - end end + end + local.set $0 + loop $while-continue|4 local.get $0 i32.const 48 - i32.sub - local.set $0 - loop $for-loop|5 + i32.eq + if + local.get $6 + i32.const 1 + i32.sub + local.tee $6 + i32.eqz + br_if $~lib/util/string/parseExp|inlined.0 + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + local.set $0 + br $while-continue|4 + end + end + local.get $0 + i32.const 48 + i32.sub + local.set $0 + loop $for-loop|5 + local.get $0 + i32.const 10 + i32.lt_u + i32.const 0 + local.get $6 + select + if + local.get $1 + i32.const 3200 + i32.mul + local.set $15 + local.get $3 + i32.const 3200 + i32.ge_s + br_if $~lib/util/string/parseExp|inlined.0 local.get $0 + local.get $3 i32.const 10 - i32.lt_u - i32.const 0 + i32.mul + i32.add + local.set $3 local.get $6 - select - if - local.get $1 - i32.const 3200 - i32.mul - local.get $3 - i32.const 3200 - i32.ge_s - br_if $~lib/util/string/parseExp|inlined.0 - drop - local.get $0 - local.get $3 - i32.const 10 - i32.mul - i32.add - local.set $3 - local.get $6 - i32.const 1 - i32.sub - local.set $6 - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - i32.const 48 - i32.sub - local.set $0 - br $for-loop|5 - end + i32.const 1 + i32.sub + local.set $6 + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + i32.const 48 + i32.sub + local.set $0 + br $for-loop|5 end - local.get $1 - local.get $3 - i32.mul end + local.get $1 + local.get $3 + i32.mul + local.set $15 + end + block $~lib/util/string/scientific|inlined.0 + i32.const 1 + local.get $8 + local.get $15 i32.add local.tee $0 i32.const -342 @@ -3953,20 +3950,19 @@ i64.eqz select br_if $~lib/util/string/scientific|inlined.0 - drop f64.const inf + local.set $11 local.get $0 i32.const 308 i32.gt_s br_if $~lib/util/string/scientific|inlined.0 - drop local.get $7 f64.convert_i64_u - local.tee $11 + local.tee $12 + local.set $11 local.get $0 i32.eqz br_if $~lib/util/string/scientific|inlined.0 - drop local.get $0 i32.const 37 i32.le_s @@ -3976,7 +3972,7 @@ i32.gt_s select if - local.get $11 + local.get $12 local.get $0 i32.const 3 i32.shl @@ -3984,7 +3980,7 @@ i32.add f64.load f64.mul - local.set $11 + local.set $12 i32.const 22 local.set $0 end @@ -4010,7 +4006,7 @@ i32.const 0 i32.gt_s if - local.get $11 + local.get $12 local.get $0 i32.const 3 i32.shl @@ -4018,9 +4014,10 @@ i32.add f64.load f64.mul + local.set $11 br $~lib/util/string/scientific|inlined.0 end - local.get $11 + local.get $12 i32.const 0 local.get $0 i32.sub @@ -4091,13 +4088,13 @@ i32.sub call $~lib/math/ipow32 i64.extend_i32_s - local.tee $14 + local.tee $16 i64.div_u - local.tee $15 + local.tee $17 i64.clz local.set $10 local.get $7 - local.get $14 + local.get $16 i64.rem_u f64.convert_i64_u i64.reinterpret_f64 @@ -4106,11 +4103,11 @@ i64.shl i64.add f64.reinterpret_i64 - local.get $14 + local.get $16 f64.convert_i64_u f64.div i64.trunc_f64_u - local.get $15 + local.get $17 local.get $10 i64.shl i64.add @@ -4249,10 +4246,12 @@ call $~lib/math/NativeMath.scalbn end end + local.set $11 end local.get $4 call $~lib/rt/pure/__release - local.get $12 + local.get $11 + local.get $13 f64.copysign return end @@ -5772,7 +5771,7 @@ i32.const 0 i32.lt_s select - local.set $6 + local.set $5 local.get $1 i32.const 16 i32.sub @@ -5803,20 +5802,22 @@ i32.eqz br_if $folding-inner0 local.get $3 - local.get $6 + local.get $5 local.get $3 - local.get $6 + local.get $5 i32.lt_s select - local.tee $5 + local.tee $3 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $3 + local.tee $5 i32.load offset=4 local.set $6 + i32.const 0 + local.set $2 loop $for-loop|0 - local.get $4 - local.get $5 + local.get $2 + local.get $3 i32.lt_s if call $~lib/rt/tlsf/maybeInitialize @@ -5825,34 +5826,34 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.tee $2 + local.tee $4 local.get $0 - local.get $4 + local.get $2 i32.const 1 i32.shl i32.add i32.load16_u i32.store16 local.get $6 - local.get $4 + local.get $2 i32.const 2 i32.shl i32.add - local.get $2 + local.get $4 i32.store - local.get $2 + local.get $4 call $~lib/rt/pure/__retain drop - local.get $4 + local.get $2 i32.const 1 i32.add - local.set $4 + local.set $2 br $for-loop|0 end end local.get $1 call $~lib/rt/pure/__release - local.get $3 + local.get $5 return end i32.const 0 @@ -5862,14 +5863,14 @@ loop $while-continue|1 local.get $0 local.get $1 - local.get $5 + local.get $4 call $~lib/string/String#indexOf - local.tee $4 + local.tee $6 i32.const -1 i32.xor if + local.get $6 local.get $4 - local.get $5 i32.sub local.tee $7 i32.const 0 @@ -5886,7 +5887,7 @@ i32.add local.tee $9 local.get $0 - local.get $5 + local.get $4 i32.const 1 i32.shl i32.add @@ -5904,17 +5905,17 @@ i32.const 1 i32.add local.tee $10 - local.get $6 + local.get $5 i32.eq br_if $folding-inner1 - local.get $4 + local.get $6 local.get $8 i32.add - local.set $5 + local.set $4 br $while-continue|1 end end - local.get $5 + local.get $4 i32.eqz if local.get $2 @@ -5923,7 +5924,7 @@ br $folding-inner1 end local.get $3 - local.get $5 + local.get $4 i32.sub local.tee $3 i32.const 0 @@ -5938,16 +5939,16 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.tee $4 + local.tee $5 local.get $0 - local.get $5 + local.get $4 i32.const 1 i32.shl i32.add local.get $3 call $~lib/memory/memory.copy local.get $2 - local.get $4 + local.get $5 call $~lib/array/Array<~lib/string/String>#push else local.get $2 @@ -7814,8 +7815,8 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 f32) - (local $9 i32) + (local $8 i32) + (local $9 f32) (local $10 i32) (local $11 i32) (local $12 i32) @@ -7845,8 +7846,8 @@ (local $36 i32) (local $37 i32) (local $38 i32) - (local $39 i64) - (local $40 i32) + (local $39 i32) + (local $40 i64) (local $41 i32) (local $42 i32) (local $43 i32) @@ -8230,7 +8231,7 @@ global.set $~argumentsLength i32.const 0 call $~lib/string/String.fromCharCode@varargs - local.tee $9 + local.tee $10 i32.const 1296 call $~lib/string/String.__eq i32.eqz @@ -8246,7 +8247,7 @@ global.set $~argumentsLength i32.const 54 call $~lib/string/String.fromCharCode@varargs - local.tee $10 + local.tee $11 i32.const 1472 call $~lib/string/String.__eq i32.eqz @@ -8262,7 +8263,7 @@ global.set $~argumentsLength i32.const 65590 call $~lib/string/String.fromCharCode@varargs - local.tee $11 + local.tee $12 i32.const 1472 call $~lib/string/String.__eq i32.eqz @@ -8277,7 +8278,7 @@ i32.const 55296 i32.const 57088 call $~lib/string/String.fromCharCode - local.tee $12 + local.tee $13 i32.const 1504 call $~lib/string/String.__eq i32.eqz @@ -8291,7 +8292,7 @@ end i32.const 0 call $~lib/string/String.fromCodePoint - local.tee $13 + local.tee $14 i32.const 1296 call $~lib/string/String.__eq i32.eqz @@ -8305,7 +8306,7 @@ end i32.const 54 call $~lib/string/String.fromCodePoint - local.tee $14 + local.tee $15 i32.const 1472 call $~lib/string/String.__eq i32.eqz @@ -8319,7 +8320,7 @@ end i32.const 119558 call $~lib/string/String.fromCodePoint - local.tee $15 + local.tee $16 i32.const 1584 call $~lib/string/String.__eq i32.eqz @@ -8496,7 +8497,7 @@ i32.const 3 i32.const 1744 call $~lib/string/String#padStart - local.tee $16 + local.tee $17 i32.const 1776 call $~lib/string/String.__eq i32.eqz @@ -8512,7 +8513,7 @@ i32.const 10 i32.const 1280 call $~lib/string/String#padStart - local.tee $17 + local.tee $18 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -8528,7 +8529,7 @@ i32.const 100 i32.const 1280 call $~lib/string/String#padStart - local.tee $18 + local.tee $19 i32.const 1328 call $~lib/string/String.__eq i32.eqz @@ -8544,7 +8545,7 @@ i32.const 5 i32.const 1744 call $~lib/string/String#padStart - local.tee $19 + local.tee $20 i32.const 1840 call $~lib/string/String.__eq i32.eqz @@ -8560,7 +8561,7 @@ i32.const 6 i32.const 1872 call $~lib/string/String#padStart - local.tee $20 + local.tee $21 i32.const 1904 call $~lib/string/String.__eq i32.eqz @@ -8576,7 +8577,7 @@ i32.const 8 i32.const 1872 call $~lib/string/String#padStart - local.tee $21 + local.tee $22 i32.const 1936 call $~lib/string/String.__eq i32.eqz @@ -8592,7 +8593,7 @@ i32.const 0 i32.const 1744 call $~lib/string/String#padEnd - local.tee $22 + local.tee $23 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -8608,7 +8609,7 @@ i32.const 15 i32.const 1744 call $~lib/string/String#padEnd - local.tee $23 + local.tee $24 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -8624,7 +8625,7 @@ i32.const 3 i32.const 1744 call $~lib/string/String#padEnd - local.tee $24 + local.tee $25 i32.const 1776 call $~lib/string/String.__eq i32.eqz @@ -8640,7 +8641,7 @@ i32.const 10 i32.const 1280 call $~lib/string/String#padEnd - local.tee $25 + local.tee $26 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -8656,7 +8657,7 @@ i32.const 100 i32.const 1280 call $~lib/string/String#padEnd - local.tee $26 + local.tee $27 i32.const 1328 call $~lib/string/String.__eq i32.eqz @@ -8672,7 +8673,7 @@ i32.const 5 i32.const 1744 call $~lib/string/String#padEnd - local.tee $27 + local.tee $28 i32.const 1968 call $~lib/string/String.__eq i32.eqz @@ -8688,7 +8689,7 @@ i32.const 6 i32.const 1808 call $~lib/string/String#padEnd - local.tee $28 + local.tee $29 i32.const 2000 call $~lib/string/String.__eq i32.eqz @@ -8704,7 +8705,7 @@ i32.const 8 i32.const 1808 call $~lib/string/String#padEnd - local.tee $29 + local.tee $30 i32.const 2032 call $~lib/string/String.__eq i32.eqz @@ -9131,7 +9132,7 @@ end i32.const 1280 call $~lib/string/String#trimStart - local.tee $30 + local.tee $31 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -9145,7 +9146,7 @@ end i32.const 2288 call $~lib/string/String#trimStart - local.tee $31 + local.tee $32 i32.const 2288 call $~lib/string/String.__eq i32.eqz @@ -9159,7 +9160,7 @@ end i32.const 2320 call $~lib/string/String#trimStart - local.tee $32 + local.tee $33 i32.const 2368 call $~lib/string/String.__eq i32.eqz @@ -9173,7 +9174,7 @@ end i32.const 1280 call $~lib/string/String#trimEnd - local.tee $33 + local.tee $34 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -9187,7 +9188,7 @@ end i32.const 2288 call $~lib/string/String#trimEnd - local.tee $34 + local.tee $35 i32.const 2288 call $~lib/string/String.__eq i32.eqz @@ -9201,7 +9202,7 @@ end i32.const 2320 call $~lib/string/String#trimEnd - local.tee $35 + local.tee $36 i32.const 2400 call $~lib/string/String.__eq i32.eqz @@ -9215,7 +9216,7 @@ end i32.const 1280 call $~lib/string/String#trim - local.tee $36 + local.tee $37 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -9229,7 +9230,7 @@ end i32.const 2288 call $~lib/string/String#trim - local.tee $37 + local.tee $38 i32.const 2288 call $~lib/string/String.__eq i32.eqz @@ -9243,7 +9244,7 @@ end i32.const 2320 call $~lib/string/String#trim - local.tee $38 + local.tee $39 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -9724,11 +9725,11 @@ i32.const 0 call $~lib/util/string/strtol f32.demote_f64 - local.set $8 + local.set $9 i32.const 3536 call $~lib/rt/pure/__release - local.get $8 - local.get $8 + local.get $9 + local.get $9 f32.eq if i32.const 0 @@ -11243,16 +11244,16 @@ i32.const 8368 i32.const 8528 call $~lib/string/String.__concat - local.tee $40 + local.tee $41 i32.const 8688 call $~lib/string/String.__concat - local.tee $41 + local.tee $42 i32.const 8848 call $~lib/string/String.__concat - local.tee $42 + local.tee $43 i32.const 9008 call $~lib/string/String.__concat - local.tee $43 + local.tee $44 call $~lib/string/parseFloat f64.const 1797693134862315708145274e284 f64.ne @@ -12029,7 +12030,7 @@ i32.const 1328 i32.const 1 call $~lib/string/String#repeat - local.tee $44 + local.tee $45 i32.const 1328 call $~lib/string/String.__eq i32.eqz @@ -12044,7 +12045,7 @@ i32.const 1328 i32.const 2 call $~lib/string/String#repeat - local.tee $45 + local.tee $46 i32.const 12368 call $~lib/string/String.__eq i32.eqz @@ -12059,7 +12060,7 @@ i32.const 1328 i32.const 3 call $~lib/string/String#repeat - local.tee $46 + local.tee $47 i32.const 12448 call $~lib/string/String.__eq i32.eqz @@ -12074,7 +12075,7 @@ i32.const 11952 i32.const 4 call $~lib/string/String#repeat - local.tee $47 + local.tee $48 i32.const 12480 call $~lib/string/String.__eq i32.eqz @@ -12089,7 +12090,7 @@ i32.const 1328 i32.const 5 call $~lib/string/String#repeat - local.tee $48 + local.tee $49 i32.const 12512 call $~lib/string/String.__eq i32.eqz @@ -12104,7 +12105,7 @@ i32.const 1328 i32.const 6 call $~lib/string/String#repeat - local.tee $49 + local.tee $50 i32.const 12544 call $~lib/string/String.__eq i32.eqz @@ -12119,7 +12120,7 @@ i32.const 1328 i32.const 7 call $~lib/string/String#repeat - local.tee $50 + local.tee $51 i32.const 12576 call $~lib/string/String.__eq i32.eqz @@ -12135,7 +12136,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replace - local.tee $51 + local.tee $52 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12151,7 +12152,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replace - local.tee $52 + local.tee $53 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12167,7 +12168,7 @@ i32.const 3472 i32.const 1280 call $~lib/string/String#replace - local.tee $53 + local.tee $54 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12183,7 +12184,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replace - local.tee $54 + local.tee $55 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12199,7 +12200,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replace - local.tee $55 + local.tee $56 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12215,7 +12216,7 @@ i32.const 1808 i32.const 3472 call $~lib/string/String#replace - local.tee $56 + local.tee $57 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12231,7 +12232,7 @@ i32.const 2256 i32.const 3472 call $~lib/string/String#replace - local.tee $57 + local.tee $58 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12247,7 +12248,7 @@ i32.const 11952 i32.const 11952 call $~lib/string/String#replace - local.tee $58 + local.tee $59 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12263,7 +12264,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replace - local.tee $59 + local.tee $60 i32.const 12640 call $~lib/string/String.__eq i32.eqz @@ -12279,7 +12280,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replace - local.tee $60 + local.tee $61 i32.const 12672 call $~lib/string/String.__eq i32.eqz @@ -12295,7 +12296,7 @@ i32.const 12736 i32.const 3472 call $~lib/string/String#replace - local.tee $61 + local.tee $62 i32.const 12672 call $~lib/string/String.__eq i32.eqz @@ -12311,7 +12312,7 @@ i32.const 12768 i32.const 12800 call $~lib/string/String#replace - local.tee $62 + local.tee $63 i32.const 12832 call $~lib/string/String.__eq i32.eqz @@ -12327,7 +12328,7 @@ i32.const 12768 i32.const 1280 call $~lib/string/String#replace - local.tee $63 + local.tee $64 i32.const 11952 call $~lib/string/String.__eq i32.eqz @@ -12343,7 +12344,7 @@ i32.const 1280 i32.const 1808 call $~lib/string/String#replaceAll - local.tee $64 + local.tee $65 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12359,7 +12360,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $65 + local.tee $66 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12375,7 +12376,7 @@ i32.const 1808 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $66 + local.tee $67 i32.const 12800 call $~lib/string/String.__eq i32.eqz @@ -12391,7 +12392,7 @@ i32.const 1808 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $67 + local.tee $68 i32.const 12912 call $~lib/string/String.__eq i32.eqz @@ -12407,7 +12408,7 @@ i32.const 11952 i32.const 11952 call $~lib/string/String#replaceAll - local.tee $68 + local.tee $69 i32.const 2000 call $~lib/string/String.__eq i32.eqz @@ -12423,7 +12424,7 @@ i32.const 1328 i32.const 12912 call $~lib/string/String#replaceAll - local.tee $69 + local.tee $70 i32.const 12976 call $~lib/string/String.__eq i32.eqz @@ -12439,7 +12440,7 @@ i32.const 11952 i32.const 12800 call $~lib/string/String#replaceAll - local.tee $70 + local.tee $71 i32.const 13024 call $~lib/string/String.__eq i32.eqz @@ -12455,7 +12456,7 @@ i32.const 13088 i32.const 12800 call $~lib/string/String#replaceAll - local.tee $71 + local.tee $72 i32.const 13120 call $~lib/string/String.__eq i32.eqz @@ -12471,7 +12472,7 @@ i32.const 2256 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $72 + local.tee $73 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12487,7 +12488,7 @@ i32.const 13152 i32.const 12800 call $~lib/string/String#replaceAll - local.tee $73 + local.tee $74 i32.const 2256 call $~lib/string/String.__eq i32.eqz @@ -12503,7 +12504,7 @@ i32.const 13184 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $74 + local.tee $75 i32.const 13216 call $~lib/string/String.__eq i32.eqz @@ -12519,7 +12520,7 @@ i32.const 11952 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $75 + local.tee $76 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12535,7 +12536,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $76 + local.tee $77 i32.const 13248 call $~lib/string/String.__eq i32.eqz @@ -12551,7 +12552,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $77 + local.tee $78 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12567,7 +12568,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $78 + local.tee $79 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12583,7 +12584,7 @@ i32.const 3472 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $79 + local.tee $80 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12599,7 +12600,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $80 + local.tee $81 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12615,7 +12616,7 @@ i32.const 1808 i32.const 3440 call $~lib/string/String#replaceAll - local.tee $81 + local.tee $82 i32.const 3440 call $~lib/string/String.__eq i32.eqz @@ -12631,7 +12632,7 @@ i32.const 2224 i32.const 3440 call $~lib/string/String#replaceAll - local.tee $82 + local.tee $83 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12647,7 +12648,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $83 + local.tee $84 i32.const 13280 call $~lib/string/String.__eq i32.eqz @@ -12663,7 +12664,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $84 + local.tee $85 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12683,7 +12684,7 @@ i32.const 0 i32.const 2147483647 call $~lib/string/String#slice - local.tee $85 + local.tee $86 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12699,7 +12700,7 @@ i32.const -1 i32.const 2147483647 call $~lib/string/String#slice - local.tee $86 + local.tee $87 i32.const 13360 call $~lib/string/String.__eq i32.eqz @@ -12715,7 +12716,7 @@ i32.const -5 i32.const 2147483647 call $~lib/string/String#slice - local.tee $87 + local.tee $88 i32.const 13392 call $~lib/string/String.__eq i32.eqz @@ -12731,7 +12732,7 @@ i32.const 2 i32.const 7 call $~lib/string/String#slice - local.tee $88 + local.tee $89 i32.const 13424 call $~lib/string/String.__eq i32.eqz @@ -12747,7 +12748,7 @@ i32.const -11 i32.const -6 call $~lib/string/String#slice - local.tee $89 + local.tee $90 i32.const 13456 call $~lib/string/String.__eq i32.eqz @@ -12763,7 +12764,7 @@ i32.const 4 i32.const 3 call $~lib/string/String#slice - local.tee $90 + local.tee $91 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12779,7 +12780,7 @@ i32.const 0 i32.const -1 call $~lib/string/String#slice - local.tee $91 + local.tee $92 i32.const 13488 call $~lib/string/String.__eq i32.eqz @@ -12795,7 +12796,7 @@ i32.const 0 i32.const 2147483647 call $~lib/string/String#substr - local.tee $92 + local.tee $93 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12811,7 +12812,7 @@ i32.const -1 i32.const 2147483647 call $~lib/string/String#substr - local.tee $93 + local.tee $94 i32.const 13360 call $~lib/string/String.__eq i32.eqz @@ -12827,7 +12828,7 @@ i32.const -5 i32.const 2147483647 call $~lib/string/String#substr - local.tee $94 + local.tee $95 i32.const 13392 call $~lib/string/String.__eq i32.eqz @@ -12843,7 +12844,7 @@ i32.const 2 i32.const 7 call $~lib/string/String#substr - local.tee $95 + local.tee $96 i32.const 13536 call $~lib/string/String.__eq i32.eqz @@ -12859,7 +12860,7 @@ i32.const -11 i32.const -6 call $~lib/string/String#substr - local.tee $96 + local.tee $97 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12875,7 +12876,7 @@ i32.const 4 i32.const 3 call $~lib/string/String#substr - local.tee $97 + local.tee $98 i32.const 13568 call $~lib/string/String.__eq i32.eqz @@ -12891,7 +12892,7 @@ i32.const 0 i32.const -1 call $~lib/string/String#substr - local.tee $98 + local.tee $99 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12907,7 +12908,7 @@ i32.const 0 i32.const 100 call $~lib/string/String#substr - local.tee $99 + local.tee $100 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12923,7 +12924,7 @@ i32.const 4 i32.const 4 call $~lib/string/String#substr - local.tee $100 + local.tee $101 i32.const 13600 call $~lib/string/String.__eq i32.eqz @@ -12939,7 +12940,7 @@ i32.const 4 i32.const -3 call $~lib/string/String#substr - local.tee $101 + local.tee $102 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12955,7 +12956,7 @@ i32.const 0 i32.const 2147483647 call $~lib/string/String#substring - local.tee $102 + local.tee $103 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12971,7 +12972,7 @@ i32.const -1 i32.const 2147483647 call $~lib/string/String#substring - local.tee $103 + local.tee $104 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12987,7 +12988,7 @@ i32.const -5 i32.const 2147483647 call $~lib/string/String#substring - local.tee $104 + local.tee $105 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -13003,7 +13004,7 @@ i32.const 2 i32.const 7 call $~lib/string/String#substring - local.tee $105 + local.tee $106 i32.const 13424 call $~lib/string/String.__eq i32.eqz @@ -13019,7 +13020,7 @@ i32.const -11 i32.const -6 call $~lib/string/String#substring - local.tee $106 + local.tee $107 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -13035,7 +13036,7 @@ i32.const 4 i32.const 3 call $~lib/string/String#substring - local.tee $107 + local.tee $108 i32.const 13632 call $~lib/string/String.__eq i32.eqz @@ -13051,7 +13052,7 @@ i32.const 0 i32.const -1 call $~lib/string/String#substring - local.tee $108 + local.tee $109 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -13067,7 +13068,7 @@ i32.const 0 i32.const 100 call $~lib/string/String#substring - local.tee $109 + local.tee $110 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -13083,7 +13084,7 @@ i32.const 4 i32.const 4 call $~lib/string/String#substring - local.tee $110 + local.tee $111 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -13099,7 +13100,7 @@ i32.const 4 i32.const -3 call $~lib/string/String#substring - local.tee $111 + local.tee $112 i32.const 2256 call $~lib/string/String.__eq i32.eqz @@ -13123,17 +13124,14 @@ local.get $1 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $0 i32.const 1280 call $~lib/string/String.__eq - local.set $0 - local.get $2 + local.set $8 + local.get $0 call $~lib/rt/pure/__release - else - i32.const 0 - local.set $0 end - local.get $0 + local.get $8 i32.eqz if i32.const 0 @@ -13598,22 +13596,21 @@ i32.const 1280 i32.const 2147483647 call $~lib/string/String#split - local.set $2 local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.tee $1 i32.load offset=12 i32.const 3 i32.eq if - local.get $2 + local.get $1 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $1 + local.tee $2 i32.const 1328 call $~lib/string/String.__eq local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release else i32.const 0 @@ -13621,14 +13618,14 @@ end local.get $0 if - local.get $2 + local.get $1 i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - local.tee $1 + local.tee $2 i32.const 11920 call $~lib/string/String.__eq local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release else i32.const 0 @@ -13636,14 +13633,14 @@ end local.get $0 if - local.get $2 + local.get $1 i32.const 2 call $~lib/array/Array<~lib/string/String>#__get - local.tee $1 + local.tee $2 i32.const 12768 call $~lib/string/String.__eq local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release else i32.const 0 @@ -13664,7 +13661,7 @@ i32.const 0 call $~lib/string/String#split local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release local.get $0 i32.load offset=12 @@ -13680,22 +13677,22 @@ i32.const 1280 i32.const 1 call $~lib/string/String#split - local.set $1 + local.set $2 local.get $0 call $~lib/rt/pure/__release - local.get $1 + local.get $2 i32.load offset=12 i32.const 1 i32.eq if - local.get $1 + local.get $2 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $1 i32.const 1328 call $~lib/string/String.__eq local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release else i32.const 0 @@ -13715,9 +13712,10 @@ i32.const 2064 i32.const 1 call $~lib/string/String#split - local.get $1 + local.set $1 + local.get $2 call $~lib/rt/pure/__release - local.tee $1 + local.get $1 i32.load offset=12 i32.const 1 i32.eq @@ -13877,22 +13875,21 @@ i32.const 2064 i32.const -1 call $~lib/string/String#split - local.set $2 local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.tee $1 i32.load offset=12 i32.const 3 i32.eq if - local.get $2 + local.get $1 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $1 + local.tee $2 i32.const 1328 call $~lib/string/String.__eq local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release else i32.const 0 @@ -13900,14 +13897,14 @@ end local.get $0 if - local.get $2 + local.get $1 i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - local.tee $1 + local.tee $2 i32.const 11920 call $~lib/string/String.__eq local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release else i32.const 0 @@ -13915,14 +13912,14 @@ end local.get $0 if - local.get $2 + local.get $1 i32.const 2 call $~lib/array/Array<~lib/string/String>#__get - local.tee $1 + local.tee $2 i32.const 12768 call $~lib/string/String.__eq local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release else i32.const 0 @@ -13938,7 +13935,7 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $1 call $~lib/rt/pure/__release i32.const 0 i32.const 10 @@ -13988,7 +13985,7 @@ i32.const 12 i32.const 10 call $~lib/util/number/itoa32 - local.tee $112 + local.tee $8 i32.const 14400 call $~lib/string/String.__eq i32.eqz @@ -16757,8 +16754,6 @@ end global.get $std/string/str call $~lib/rt/pure/__release - local.get $9 - call $~lib/rt/pure/__release local.get $10 call $~lib/rt/pure/__release local.get $11 @@ -16771,12 +16766,12 @@ call $~lib/rt/pure/__release local.get $15 call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release local.get $4 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release - local.get $16 - call $~lib/rt/pure/__release local.get $17 call $~lib/rt/pure/__release local.get $18 @@ -16821,7 +16816,7 @@ call $~lib/rt/pure/__release local.get $38 call $~lib/rt/pure/__release - local.get $40 + local.get $39 call $~lib/rt/pure/__release local.get $41 call $~lib/rt/pure/__release @@ -16829,18 +16824,18 @@ call $~lib/rt/pure/__release local.get $43 call $~lib/rt/pure/__release - local.get $45 + local.get $44 call $~lib/rt/pure/__release local.get $46 call $~lib/rt/pure/__release - local.get $44 + local.get $47 + call $~lib/rt/pure/__release + local.get $45 call $~lib/rt/pure/__release local.get $7 call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release - local.get $47 - call $~lib/rt/pure/__release local.get $48 call $~lib/rt/pure/__release local.get $49 @@ -16969,13 +16964,15 @@ call $~lib/rt/pure/__release local.get $111 call $~lib/rt/pure/__release + local.get $112 + call $~lib/rt/pure/__release local.get $1 call $~lib/rt/pure/__release local.get $2 call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - local.get $112 + local.get $8 call $~lib/rt/pure/__release local.get $113 call $~lib/rt/pure/__release diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index c01f9c00c3..1616d474e6 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -917,11 +917,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 12528 @@ -929,14 +929,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -946,17 +946,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end @@ -8053,22 +8053,23 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8091,6 +8092,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 end local.get $2 @@ -8104,10 +8106,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8121,22 +8123,23 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8159,6 +8162,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 end local.get $2 @@ -8172,10 +8176,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8190,24 +8194,25 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8232,6 +8237,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 end local.get $2 @@ -8245,10 +8251,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8262,24 +8268,25 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8304,6 +8311,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 end local.get $2 @@ -8317,10 +8325,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8333,24 +8341,25 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8375,6 +8384,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 end local.get $2 @@ -8388,10 +8398,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8408,24 +8418,25 @@ (local $4 i32) (local $5 i32) (local $6 i64) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8450,6 +8461,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 end local.get $2 @@ -8463,10 +8475,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8483,24 +8495,25 @@ (local $4 i32) (local $5 i32) (local $6 f32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8525,6 +8538,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $2 @@ -8538,10 +8552,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (param $0 f32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8559,24 +8573,25 @@ (local $4 i32) (local $5 i32) (local $6 f64) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 + block $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -8601,6 +8616,7 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $2 @@ -8614,10 +8630,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (param $0 f64) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -9205,22 +9221,23 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -9243,7 +9260,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 end local.get $2 @@ -9258,9 +9274,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -9274,22 +9292,23 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -9312,7 +9331,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 end local.get $2 @@ -9327,9 +9345,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 @@ -9350,24 +9370,25 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -9392,7 +9413,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 end local.get $2 @@ -9407,9 +9427,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $~lib/typedarray/Uint16Array#every (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9417,24 +9439,25 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -9459,7 +9482,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 end local.get $2 @@ -9474,9 +9496,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 @@ -9493,24 +9517,25 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -9535,7 +9560,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 end local.get $2 @@ -9550,9 +9574,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 @@ -9569,24 +9595,25 @@ (local $4 i32) (local $5 i32) (local $6 i64) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -9611,7 +9638,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 end local.get $2 @@ -9626,9 +9652,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -9797,24 +9825,25 @@ (local $4 i32) (local $5 i32) (local $6 f32) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -9839,7 +9868,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $2 @@ -9854,9 +9882,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $~lib/math/NativeMath.mod (param $0 f64) (result f64) (local $1 i64) @@ -10026,24 +10056,25 @@ (local $4 i32) (local $5 i32) (local $6 f64) + (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - block $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 + block $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 loop $for-loop|0 local.get $2 local.get $5 @@ -10068,7 +10099,6 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $2 @@ -10083,9 +10113,11 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 + local.set $7 end local.get $3 call $~lib/rt/pure/__release + local.get $7 ) (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 @@ -35587,7 +35619,9 @@ end i32.const 0 local.set $0 - block $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + i32.const 0 + local.set $3 + block $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 i32.const 0 local.get $2 call $~lib/rt/pure/__retain @@ -35595,27 +35629,26 @@ i32.load offset=8 i32.const 3 i32.shr_u - local.tee $3 + local.tee $4 i32.ge_s i32.const 1 - local.get $3 + local.get $4 select if local.get $1 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $1 i32.load offset=4 - local.set $4 + local.set $5 loop $while-continue|0 local.get $0 - local.get $3 + local.get $4 i32.lt_s if i32.const 1 - local.get $4 + local.get $5 local.get $0 i32.const 3 i32.shl @@ -35632,6 +35665,7 @@ local.get $1 call $~lib/rt/pure/__release i32.const 1 + local.set $3 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $0 @@ -35643,8 +35677,8 @@ end local.get $1 call $~lib/rt/pure/__release - i32.const 0 end + local.get $3 i32.eqz if i32.const 0 @@ -35676,7 +35710,9 @@ end i32.const 0 local.set $0 - block $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + i32.const 0 + local.set $4 + block $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 i32.const 0 local.get $3 call $~lib/rt/pure/__retain @@ -35684,27 +35720,26 @@ i32.load offset=8 i32.const 2 i32.shr_u - local.tee $4 + local.tee $5 i32.ge_s i32.const 1 - local.get $4 + local.get $5 select if local.get $1 call $~lib/rt/pure/__release - i32.const 0 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $1 i32.load offset=4 - local.set $5 + local.set $6 loop $while-continue|014 local.get $0 - local.get $4 + local.get $5 i32.lt_s if i32.const 1 - local.get $5 + local.get $6 local.get $0 i32.const 2 i32.shl @@ -35721,6 +35756,7 @@ local.get $1 call $~lib/rt/pure/__release i32.const 1 + local.set $4 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $0 @@ -35732,8 +35768,8 @@ end local.get $1 call $~lib/rt/pure/__release - i32.const 0 end + local.get $4 i32.eqz if i32.const 0 diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 5da15c926e..e29a251538 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -688,11 +688,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $0 + local.get $2 i32.const 23 i32.lt_u if - local.get $0 + local.get $2 i32.const 2 i32.shl i32.const 1216 @@ -700,14 +700,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $2 + local.set $0 loop $for-loop|1 - local.get $2 + local.get $0 i32.const 16 i32.lt_u if - local.get $2 local.get $0 + local.get $2 i32.const 4 i32.shl i32.add @@ -717,17 +717,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|1 end end - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|0 end end @@ -1354,9 +1354,9 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $1 + local.tee $3 call $~lib/rt/pure/__release - local.get $1 + local.get $3 if local.get $2 i32.const 1 From 41021352b790d477719084de23d6a9cf68fae5d8 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 12 Oct 2020 22:50:02 +0300 Subject: [PATCH 8/9] Revert "apply rse later" This reverts commit 42faca25f740342fdacb4823b91df928be182a7e. --- src/module.ts | 2 +- tests/compiler/comma.optimized.wat | 7 +- tests/compiler/do.optimized.wat | 129 ++-- .../extends-baseaggregate.optimized.wat | 18 +- tests/compiler/for.optimized.wat | 38 +- .../implicit-getter-setter.optimized.wat | 18 +- tests/compiler/issues/1095.optimized.wat | 18 +- tests/compiler/issues/1225.optimized.wat | 18 +- tests/compiler/logical.optimized.wat | 18 +- tests/compiler/managed-cast.optimized.wat | 18 +- tests/compiler/object-literal.optimized.wat | 18 +- tests/compiler/rc/local-init.optimized.wat | 18 +- .../rc/logical-and-mismatch.optimized.wat | 18 +- .../rc/logical-or-mismatch.optimized.wat | 18 +- tests/compiler/rc/optimize.optimized.wat | 18 +- tests/compiler/rc/rereturn.optimized.wat | 18 +- .../rc/ternary-mismatch.optimized.wat | 18 +- tests/compiler/resolve-ternary.optimized.wat | 18 +- .../retain-release-sanity.optimized.wat | 18 +- tests/compiler/retain-return.optimized.wat | 18 +- tests/compiler/rt/finalize.optimized.wat | 18 +- tests/compiler/runtime-full.optimized.wat | 18 +- tests/compiler/scoped.optimized.wat | 9 +- .../compiler/std/array-literal.optimized.wat | 18 +- tests/compiler/std/array.optimized.wat | 90 +-- tests/compiler/std/arraybuffer.optimized.wat | 18 +- tests/compiler/std/dataview.optimized.wat | 18 +- tests/compiler/std/map.optimized.wat | 18 +- tests/compiler/std/math.optimized.wat | 385 ++++++----- tests/compiler/std/mod.optimized.wat | 1 - tests/compiler/std/set.optimized.wat | 18 +- tests/compiler/std/staticarray.optimized.wat | 18 +- .../std/string-casemapping.optimized.wat | 24 +- .../std/string-encoding.optimized.wat | 18 +- tests/compiler/std/string.optimized.wat | 653 +++++++++--------- tests/compiler/std/typedarray.optimized.wat | 582 ++++++++-------- tests/compiler/while.optimized.wat | 22 +- 37 files changed, 1183 insertions(+), 1209 deletions(-) diff --git a/src/module.ts b/src/module.ts index 206ffd95ff..19076aa509 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1519,6 +1519,7 @@ export class Module { if (optimizeLevel >= 3 || shrinkLevel >= 1) { passes.push("simplify-locals-notee-nostructure"); + passes.push("rse"); passes.push("vacuum"); passes.push("ssa-nomerge"); passes.push("simplify-globals-optimizing"); @@ -1546,7 +1547,6 @@ export class Module { // } passes.push("optimize-instructions"); if (optimizeLevel >= 3 || shrinkLevel >= 1) { - passes.push("rse"); passes.push("dce"); } passes.push("remove-unused-brs"); diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index 96014cf36e..b8197dbcf8 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -10,12 +10,13 @@ (start $~start) (func $start:comma (local $0 i32) + (local $1 i32) global.get $comma/a - local.tee $0 + local.tee $1 i32.const 1 i32.add global.set $comma/a - local.get $0 + local.get $1 global.set $comma/b global.get $comma/a i32.const 1 @@ -79,8 +80,6 @@ global.set $comma/b i32.const 2 global.set $comma/a - i32.const 0 - local.set $0 loop $for-loop|0 local.get $0 global.get $comma/a diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 86f7d0f728..8a2442c3f9 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -683,11 +683,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1216 @@ -695,14 +695,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -712,17 +712,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end @@ -1028,23 +1028,22 @@ (local $0 i32) (local $1 i32) (local $2 i32) - (local $3 i32) i32.const 0 global.set $do/ran i32.const 10 - local.set $1 + local.set $0 loop $do-continue|0 - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 - local.get $1 + local.set $1 + local.get $0 i32.const 1 i32.sub - local.tee $1 + local.tee $0 br_if $do-continue|0 end - local.get $1 + local.get $0 if i32.const 0 i32.const 1040 @@ -1053,7 +1052,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 i32.const 10 i32.ne if @@ -1069,17 +1068,17 @@ i32.const 0 global.set $do/ran i32.const 10 - local.set $0 + local.set $1 loop $do-continue|00 - local.get $0 - local.tee $1 + local.get $1 + local.tee $0 i32.const 1 i32.sub - local.set $0 - local.get $1 + local.set $1 + local.get $0 br_if $do-continue|00 end - local.get $0 + local.get $1 i32.const -1 i32.ne if @@ -1109,14 +1108,14 @@ global.set $do/ran i32.const 0 local.set $0 - loop $do-continue|001 + loop $do-continue|01 local.get $0 i32.const 1 i32.add local.tee $0 i32.const 10 i32.ne - br_if $do-continue|001 + br_if $do-continue|01 end local.get $0 i32.const 10 @@ -1133,14 +1132,14 @@ global.set $do/ran i32.const 0 local.set $0 - loop $do-continue|01 + loop $do-continue|02 local.get $0 i32.const 1 i32.add local.tee $0 i32.const 10 i32.ne - br_if $do-continue|01 + br_if $do-continue|02 end local.get $0 i32.const 10 @@ -1169,14 +1168,14 @@ global.set $do/ran i32.const 0 local.set $0 - loop $do-continue|02 + loop $do-continue|03 local.get $0 i32.const 1 i32.add local.tee $0 i32.const 10 i32.ne - br_if $do-continue|02 + br_if $do-continue|03 end local.get $0 i32.const 10 @@ -1194,30 +1193,30 @@ i32.const 0 global.set $do/ran i32.const 0 - local.set $0 - i32.const 0 local.set $1 - loop $do-continue|03 - local.get $0 + i32.const 0 + local.set $0 + loop $do-continue|04 + local.get $1 i32.const 1 i32.add - local.tee $0 + local.tee $1 i32.const 10 i32.ne if loop $do-continue|1 - local.get $1 + local.get $0 i32.const 1 i32.add - local.tee $1 + local.tee $0 i32.const 10 i32.rem_s br_if $do-continue|1 end - br $do-continue|03 + br $do-continue|04 end end - local.get $0 + local.get $1 i32.const 10 i32.ne if @@ -1228,7 +1227,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 i32.const 90 i32.ne if @@ -1248,8 +1247,8 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $0 - loop $do-continue|04 + local.set $1 + loop $do-continue|05 local.get $2 i32.const 1 i32.add @@ -1258,10 +1257,10 @@ i32.eq if i32.const 0 - local.set $1 - local.get $0 + local.set $0 + local.get $1 if - local.get $0 + local.get $1 call $~lib/rt/pure/__release end else @@ -1270,13 +1269,13 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $1 - local.get $0 + local.set $0 + local.get $1 call $~lib/rt/pure/__release end - local.get $1 - local.tee $0 - br_if $do-continue|04 + local.get $0 + local.tee $1 + br_if $do-continue|05 end local.get $2 i32.const 10 @@ -1289,7 +1288,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 if i32.const 0 i32.const 1040 @@ -1300,7 +1299,7 @@ end i32.const 1 global.set $do/ran - local.get $0 + local.get $1 call $~lib/rt/pure/__release global.get $do/ran i32.eqz @@ -1314,28 +1313,30 @@ end i32.const 0 global.set $do/ran + i32.const 0 + local.set $2 call $~lib/rt/tlsf/maybeInitialize call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $0 - loop $do-continue|05 + local.set $1 + loop $do-continue|06 block $do-break|0 - local.get $3 + local.get $2 i32.const 1 i32.add - local.tee $3 + local.tee $2 i32.const 10 i32.eq if - local.get $0 + local.get $1 if - local.get $0 + local.get $1 call $~lib/rt/pure/__release end i32.const 0 - local.set $0 + local.set $1 br $do-break|0 end call $~lib/rt/tlsf/maybeInitialize @@ -1343,13 +1344,13 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $2 + local.tee $0 call $~lib/rt/pure/__release - local.get $2 - br_if $do-continue|05 + local.get $0 + br_if $do-continue|06 end end - local.get $3 + local.get $2 i32.const 10 i32.ne if @@ -1360,7 +1361,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 if i32.const 0 i32.const 1040 @@ -1371,7 +1372,7 @@ end i32.const 1 global.set $do/ran - local.get $0 + local.get $1 call $~lib/rt/pure/__release global.get $do/ran i32.eqz diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index 8a8739bb6c..b11fdea5d1 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -613,11 +613,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1568 @@ -625,14 +625,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -642,17 +642,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 07c9eeb6a1..0c685af875 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -680,11 +680,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1216 @@ -692,14 +692,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -709,17 +709,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end @@ -1035,7 +1035,7 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.set $0 + local.set $1 call $~lib/rt/pure/__release loop $for-loop|0 block $for-break0 @@ -1044,9 +1044,9 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $1 + local.tee $0 call $~lib/rt/pure/__release - local.get $1 + local.get $0 if local.get $2 i32.const 1 @@ -1055,13 +1055,13 @@ i32.const 10 i32.eq if - local.get $0 + local.get $1 if - local.get $0 + local.get $1 call $~lib/rt/pure/__release end i32.const 0 - local.set $0 + local.set $1 br $for-break0 end call $~lib/rt/tlsf/maybeInitialize @@ -1069,9 +1069,9 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.get $0 + local.get $1 call $~lib/rt/pure/__release - local.set $0 + local.set $1 br $for-loop|0 end end @@ -1087,7 +1087,7 @@ call $~lib/builtins/abort unreachable end - local.get $0 + local.get $1 if i32.const 0 i32.const 1040 @@ -1098,7 +1098,7 @@ end i32.const 1 global.set $for/ran - local.get $0 + local.get $1 call $~lib/rt/pure/__release ) (func $start:for diff --git a/tests/compiler/implicit-getter-setter.optimized.wat b/tests/compiler/implicit-getter-setter.optimized.wat index c058758266..2a1d1cc31d 100644 --- a/tests/compiler/implicit-getter-setter.optimized.wat +++ b/tests/compiler/implicit-getter-setter.optimized.wat @@ -616,11 +616,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1232 @@ -628,14 +628,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -645,17 +645,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index a025f6fe22..b1142a3589 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -601,11 +601,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1312 @@ -613,14 +613,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -630,17 +630,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/issues/1225.optimized.wat b/tests/compiler/issues/1225.optimized.wat index dc73b74c26..08a0477c45 100644 --- a/tests/compiler/issues/1225.optimized.wat +++ b/tests/compiler/issues/1225.optimized.wat @@ -602,11 +602,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1232 @@ -614,14 +614,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -631,17 +631,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index 0ea0dde415..1dda007090 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1232 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 87087aef59..e8230a9888 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -603,11 +603,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1392 @@ -615,14 +615,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -632,17 +632,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index b33e99d178..eb0d3a9405 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -607,11 +607,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1440 @@ -619,14 +619,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -636,17 +636,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/rc/local-init.optimized.wat b/tests/compiler/rc/local-init.optimized.wat index c8bd5e4beb..5e6c0bef61 100644 --- a/tests/compiler/rc/local-init.optimized.wat +++ b/tests/compiler/rc/local-init.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1200 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/rc/logical-and-mismatch.optimized.wat b/tests/compiler/rc/logical-and-mismatch.optimized.wat index 326e2889dc..c8d58ebd01 100644 --- a/tests/compiler/rc/logical-and-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-and-mismatch.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1184 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/rc/logical-or-mismatch.optimized.wat b/tests/compiler/rc/logical-or-mismatch.optimized.wat index 818cfc3ff9..e92a189f1b 100644 --- a/tests/compiler/rc/logical-or-mismatch.optimized.wat +++ b/tests/compiler/rc/logical-or-mismatch.optimized.wat @@ -599,11 +599,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1184 @@ -611,14 +611,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -628,17 +628,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/rc/optimize.optimized.wat b/tests/compiler/rc/optimize.optimized.wat index d7e595e643..11ddfde728 100644 --- a/tests/compiler/rc/optimize.optimized.wat +++ b/tests/compiler/rc/optimize.optimized.wat @@ -688,11 +688,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1216 @@ -700,14 +700,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -717,17 +717,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/rc/rereturn.optimized.wat b/tests/compiler/rc/rereturn.optimized.wat index 4aa56c9e99..ef7b216752 100644 --- a/tests/compiler/rc/rereturn.optimized.wat +++ b/tests/compiler/rc/rereturn.optimized.wat @@ -607,11 +607,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1232 @@ -619,14 +619,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -636,17 +636,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/rc/ternary-mismatch.optimized.wat b/tests/compiler/rc/ternary-mismatch.optimized.wat index 0dee96d4fe..bd2a910f04 100644 --- a/tests/compiler/rc/ternary-mismatch.optimized.wat +++ b/tests/compiler/rc/ternary-mismatch.optimized.wat @@ -601,11 +601,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1184 @@ -613,14 +613,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -630,17 +630,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index 9c668a330a..299501c546 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -632,11 +632,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 2880 @@ -644,14 +644,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -661,17 +661,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 833dcef6eb..1aef9ac5e6 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -625,11 +625,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1664 @@ -637,14 +637,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -654,17 +654,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/retain-return.optimized.wat b/tests/compiler/retain-return.optimized.wat index f2ed54a9d5..7ba2cc8a70 100644 --- a/tests/compiler/retain-return.optimized.wat +++ b/tests/compiler/retain-return.optimized.wat @@ -608,11 +608,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1376 @@ -620,14 +620,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -637,17 +637,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat index b94a9877e1..9203a97b41 100644 --- a/tests/compiler/rt/finalize.optimized.wat +++ b/tests/compiler/rt/finalize.optimized.wat @@ -628,11 +628,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1600 @@ -640,14 +640,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -657,17 +657,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/runtime-full.optimized.wat b/tests/compiler/runtime-full.optimized.wat index 30650de49e..a65a8a749a 100644 --- a/tests/compiler/runtime-full.optimized.wat +++ b/tests/compiler/runtime-full.optimized.wat @@ -606,11 +606,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1216 @@ -618,14 +618,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -635,17 +635,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/scoped.optimized.wat b/tests/compiler/scoped.optimized.wat index 001d9087e1..d9bbd8322b 100644 --- a/tests/compiler/scoped.optimized.wat +++ b/tests/compiler/scoped.optimized.wat @@ -5,7 +5,6 @@ (start $~start) (func $~start (local $0 i32) - (local $1 i32) loop $for-loop|0 local.get $0 i32.const 1 @@ -18,15 +17,17 @@ br $for-loop|0 end end + i32.const 0 + local.set $0 loop $for-loop|1 - local.get $1 + local.get $0 i32.const 1 i32.lt_s if - local.get $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $for-loop|1 end end diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 3e5d207563..fa30ba92e5 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -654,11 +654,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1536 @@ -666,14 +666,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -683,17 +683,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 8b090eb513..671182a165 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -983,11 +983,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 11936 @@ -995,14 +995,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -1012,17 +1012,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end @@ -19360,21 +19360,20 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $1 local.get $0 i32.load offset=12 - local.tee $4 + local.tee $2 local.get $1 i32.load offset=12 i32.const 0 local.get $1 select - local.tee $6 + local.tee $5 i32.add - local.tee $2 + local.tee $3 i32.const 268435452 i32.gt_u if @@ -19385,78 +19384,80 @@ call $~lib/builtins/abort unreachable end - local.get $2 + local.get $3 i32.const 2 i32.const 29 i32.const 0 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $7 + local.tee $6 i32.load offset=4 - local.set $2 - local.get $4 + local.set $3 + local.get $2 i32.const 2 i32.shl - local.set $4 + local.set $2 local.get $0 i32.load offset=4 local.set $0 loop $for-loop|0 - local.get $3 local.get $4 + local.get $2 i32.lt_u if - local.get $2 local.get $3 + local.get $4 i32.add local.get $0 - local.get $3 + local.get $4 i32.add i32.load call $~lib/rt/pure/__retain i32.store - local.get $3 + local.get $4 i32.const 4 i32.add - local.set $3 + local.set $4 br $for-loop|0 end end local.get $2 - local.get $4 + local.get $3 i32.add - local.set $0 + local.set $4 local.get $1 i32.load offset=4 local.set $3 - local.get $6 + local.get $5 i32.const 2 i32.shl local.set $2 + i32.const 0 + local.set $0 loop $for-loop|1 - local.get $5 + local.get $0 local.get $2 i32.lt_u if local.get $0 - local.get $5 + local.get $4 i32.add + local.get $0 local.get $3 - local.get $5 i32.add i32.load call $~lib/rt/pure/__retain i32.store - local.get $5 + local.get $0 i32.const 4 i32.add - local.set $5 + local.set $0 br $for-loop|1 end end local.get $1 call $~lib/rt/pure/__release - local.get $7 + local.get $6 ) (func $~lib/array/Array<~lib/string/String>#copyWithin (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) @@ -19465,10 +19466,12 @@ local.get $0 i32.load offset=4 local.set $5 - local.get $3 local.get $0 i32.load offset=12 local.tee $4 + local.set $6 + local.get $3 + local.get $4 local.get $3 local.get $4 i32.lt_s @@ -19491,7 +19494,7 @@ local.get $1 local.get $4 local.get $1 - local.get $4 + local.get $6 i32.lt_s select end @@ -19846,7 +19849,6 @@ (func $~lib/array/Array<~lib/string/String>#slice (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) - (local $5 i32) local.get $0 i32.load offset=12 local.set $3 @@ -19909,36 +19911,38 @@ call $~lib/rt/pure/__retain local.tee $3 i32.load offset=4 - local.set $5 + local.set $4 local.get $0 i32.load offset=4 local.get $1 i32.const 2 i32.shl i32.add + local.set $1 + i32.const 0 local.set $0 local.get $2 i32.const 2 i32.shl - local.set $1 + local.set $2 loop $while-continue|0 - local.get $4 - local.get $1 + local.get $0 + local.get $2 i32.lt_u if + local.get $0 local.get $4 - local.get $5 i32.add local.get $0 - local.get $4 + local.get $1 i32.add i32.load call $~lib/rt/pure/__retain i32.store - local.get $4 + local.get $0 i32.const 4 i32.add - local.set $4 + local.set $0 br $while-continue|0 end end diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 56f6274f02..8aa69b6183 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -616,11 +616,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1440 @@ -628,14 +628,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -645,17 +645,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 1dbc024b29..eea772314f 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -624,11 +624,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1520 @@ -636,14 +636,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -653,17 +653,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 08f4dd4a99..f10975ce95 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -622,11 +622,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1568 @@ -634,14 +634,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -651,17 +651,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 3aef007625..204d31447a 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -5282,58 +5282,59 @@ ) (func $~lib/math/NativeMathf.exp2 (param $0 f32) (result f32) (local $1 f64) - (local $2 f32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 f64) - (local $6 i64) - local.get $0 - f64.promote_f32 - local.set $1 - block $~lib/util/math/exp2f_lut|inlined.0 + (local $4 f64) + (local $5 i64) + block $~lib/util/math/exp2f_lut|inlined.0 (result f32) + local.get $0 + f64.promote_f32 + local.set $1 local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 20 i32.shr_u i32.const 2047 i32.and - local.tee $4 + local.tee $3 i32.const 1072 i32.ge_u if - local.get $3 + f32.const 0 + local.get $2 i32.const -8388608 i32.eq br_if $~lib/util/math/exp2f_lut|inlined.0 + drop local.get $0 local.get $0 f32.add - local.set $2 - local.get $4 + local.get $3 i32.const 2040 i32.ge_u br_if $~lib/util/math/exp2f_lut|inlined.0 + drop local.get $0 f32.const 1701411834604692317316873e14 f32.mul - local.set $2 local.get $0 f32.const 0 f32.gt br_if $~lib/util/math/exp2f_lut|inlined.0 + drop f32.const 0 - local.set $2 local.get $0 f32.const -150 f32.le br_if $~lib/util/math/exp2f_lut|inlined.0 + drop end local.get $1 local.get $1 f64.const 211106232532992 f64.add - local.tee $5 + local.tee $4 f64.const 211106232532992 f64.sub f64.sub @@ -5352,9 +5353,9 @@ f64.mul f64.mul f64.add - local.get $5 + local.get $4 i64.reinterpret_f64 - local.tee $6 + local.tee $5 i32.wrap_i64 i32.const 31 i32.and @@ -5363,16 +5364,14 @@ i32.const 3336 i32.add i64.load - local.get $6 + local.get $5 i64.const 47 i64.shl i64.add f64.reinterpret_i64 f64.mul f32.demote_f64 - local.set $2 end - local.get $2 ) (func $std/math/test_floor (param $0 f64) (param $1 f64) (result i32) local.get $0 @@ -6899,21 +6898,20 @@ (local $3 f64) (local $4 i32) (local $5 i32) - (local $6 f64) - (local $7 i32) + (local $6 i32) + (local $7 f64) (local $8 i32) - (local $9 f64) - (local $10 i32) + (local $9 i32) + (local $10 f64) (local $11 i32) - (local $12 f64) - (local $13 i64) - (local $14 f64) - (local $15 i32) + (local $12 i32) + (local $13 f64) + (local $14 i64) + (local $15 f64) (local $16 i32) (local $17 f64) (local $18 i32) - (local $19 i32) - (local $20 f64) + (local $19 f64) local.get $1 f64.abs f64.const 2 @@ -6968,30 +6966,30 @@ end local.get $0 i64.reinterpret_f64 - local.tee $13 + local.tee $14 i32.wrap_i64 local.set $18 - local.get $13 + local.get $14 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $15 + local.tee $16 i32.const 2147483647 i32.and local.set $4 local.get $1 i64.reinterpret_f64 - local.tee $13 + local.tee $14 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $7 + local.tee $8 i32.const 2147483647 i32.and - local.tee $8 - local.get $13 + local.tee $9 + local.get $14 i32.wrap_i64 - local.tee $19 + local.tee $6 i32.or i32.eqz if @@ -6999,14 +6997,14 @@ return end i32.const 1 - local.get $19 + local.get $6 i32.const 0 - local.get $8 + local.get $9 i32.const 2146435072 i32.eq select i32.const 1 - local.get $8 + local.get $9 i32.const 2146435072 i32.gt_u i32.const 1 @@ -7028,51 +7026,51 @@ f64.add return end - local.get $15 + local.get $16 i32.const 0 i32.lt_s if (result i32) - local.get $8 + local.get $9 i32.const 1128267776 i32.ge_u if (result i32) i32.const 2 else - local.get $8 + local.get $9 i32.const 1072693248 i32.ge_u if (result i32) i32.const 52 i32.const 20 - local.get $8 + local.get $9 i32.const 20 i32.shr_u i32.const 1023 i32.sub - local.tee $10 + local.tee $11 i32.const 20 i32.gt_s local.tee $5 select - local.get $10 + local.get $11 i32.sub - local.set $11 + local.set $12 i32.const 2 - local.get $19 - local.get $8 + local.get $6 + local.get $9 local.get $5 select local.tee $5 - local.get $11 + local.get $12 i32.shr_u - local.tee $10 + local.tee $11 i32.const 1 i32.and i32.sub i32.const 0 local.get $5 - local.get $10 local.get $11 + local.get $12 i32.shl i32.eq select @@ -7084,10 +7082,10 @@ i32.const 0 end local.set $5 - local.get $19 + local.get $6 i32.eqz if - local.get $8 + local.get $9 i32.const 2146435072 i32.eq if @@ -7103,7 +7101,7 @@ if local.get $1 f64.const 0 - local.get $7 + local.get $8 i32.const 0 i32.ge_s select @@ -7112,7 +7110,7 @@ f64.const 0 local.get $1 f64.neg - local.get $7 + local.get $8 i32.const 0 i32.ge_s select @@ -7125,11 +7123,11 @@ end unreachable end - local.get $8 + local.get $9 i32.const 1072693248 i32.eq if - local.get $7 + local.get $8 i32.const 0 i32.ge_s if @@ -7141,7 +7139,7 @@ f64.div return end - local.get $7 + local.get $8 i32.const 1073741824 i32.eq if @@ -7150,11 +7148,11 @@ f64.mul return end - local.get $7 + local.get $8 i32.const 1071644672 i32.eq if - local.get $15 + local.get $16 i32.const 0 i32.ge_s if @@ -7186,12 +7184,12 @@ local.get $3 f64.div local.get $3 - local.get $7 + local.get $8 i32.const 0 i32.lt_s select local.set $3 - local.get $15 + local.get $16 i32.const 0 i32.lt_s if (result f64) @@ -7222,7 +7220,7 @@ return end end - local.get $15 + local.get $16 i32.const 0 i32.lt_s if (result f64) @@ -7246,12 +7244,12 @@ else f64.const 1 end - local.set $9 - local.get $8 + local.set $10 + local.get $9 i32.const 1105199104 i32.gt_u if (result f64) - local.get $8 + local.get $9 i32.const 1139802112 i32.gt_u if @@ -7261,7 +7259,7 @@ if f64.const inf f64.const 0 - local.get $7 + local.get $8 i32.const 0 i32.lt_s select @@ -7273,7 +7271,7 @@ if f64.const inf f64.const 0 - local.get $7 + local.get $8 i32.const 0 i32.gt_s select @@ -7284,17 +7282,17 @@ i32.const 1072693247 i32.lt_s if - local.get $9 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul - local.get $9 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul - local.get $7 + local.get $8 i32.const 0 i32.lt_s select @@ -7304,17 +7302,17 @@ i32.const 1072693248 i32.gt_s if - local.get $9 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul - local.get $9 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 f64.mul - local.get $7 + local.get $8 i32.const 0 i32.gt_s select @@ -7352,9 +7350,9 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.set $6 + local.set $7 local.get $0 - local.get $6 + local.get $7 local.get $3 f64.sub f64.sub @@ -7382,7 +7380,7 @@ i32.const 1023 i32.sub i32.add - local.set $7 + local.set $6 local.get $4 i32.const 1048575 i32.and @@ -7392,25 +7390,28 @@ local.set $4 local.get $5 i32.const 235662 - i32.gt_s - if + i32.le_s + if (result i32) + i32.const 0 + else local.get $5 i32.const 767610 i32.lt_s - if + if (result i32) i32.const 1 - local.set $16 else - local.get $7 + local.get $6 i32.const 1 i32.add - local.set $7 + local.set $6 local.get $4 i32.const -1048576 i32.add local.set $4 + i32.const 0 end end + local.set $5 local.get $3 i64.reinterpret_f64 i64.const 4294967295 @@ -7421,16 +7422,16 @@ i64.shl i64.or f64.reinterpret_i64 - local.tee $6 + local.tee $7 f64.const 1.5 f64.const 1 - local.get $16 + local.get $5 select local.tee $2 f64.sub local.tee $3 f64.const 1 - local.get $6 + local.get $7 local.get $2 f64.add f64.div @@ -7441,24 +7442,24 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $14 - local.get $14 - local.get $14 + local.tee $15 + local.get $15 + local.get $15 f64.mul - local.tee $20 + local.tee $19 f64.const 3 f64.add local.get $17 local.get $17 f64.mul - local.tee $12 - local.get $12 + local.tee $13 + local.get $13 f64.mul - local.get $12 - local.get $12 - local.get $12 - local.get $12 - local.get $12 + local.get $13 + local.get $13 + local.get $13 + local.get $13 + local.get $13 f64.const 0.20697501780033842 f64.mul f64.const 0.23066074577556175 @@ -7478,7 +7479,7 @@ f64.mul local.get $0 local.get $3 - local.get $14 + local.get $15 local.get $4 i32.const 1 i32.shr_s @@ -7486,7 +7487,7 @@ i32.or i32.const 524288 i32.add - local.get $16 + local.get $5 i32.const 18 i32.shl i32.add @@ -7497,8 +7498,8 @@ local.tee $0 f64.mul f64.sub - local.get $14 - local.get $6 + local.get $15 + local.get $7 local.get $0 local.get $2 f64.sub @@ -7507,7 +7508,7 @@ f64.sub f64.mul local.tee $2 - local.get $14 + local.get $15 local.get $17 f64.add f64.mul @@ -7518,17 +7519,17 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.tee $6 + local.tee $7 f64.mul local.tee $3 local.get $2 - local.get $6 + local.get $7 f64.mul local.get $0 - local.get $6 + local.get $7 f64.const 3 f64.sub - local.get $20 + local.get $19 f64.sub f64.sub local.get $17 @@ -7543,7 +7544,7 @@ local.tee $2 f64.const 0.9617967009544373 f64.mul - local.tee $20 + local.tee $19 local.get $2 f64.const -7.028461650952758e-09 f64.mul @@ -7557,18 +7558,18 @@ f64.add f64.const 1.350039202129749e-08 f64.const 0 - local.get $16 + local.get $5 select f64.add local.tee $2 f64.add f64.const 0.5849624872207642 f64.const 0 - local.get $16 + local.get $5 select local.tee $3 f64.add - local.get $7 + local.get $6 f64.convert_i32_s local.tee $0 f64.add @@ -7576,14 +7577,14 @@ i64.const -4294967296 i64.and f64.reinterpret_i64 - local.set $6 + local.set $7 local.get $2 - local.get $6 + local.get $7 local.get $0 f64.sub local.get $3 f64.sub - local.get $20 + local.get $19 f64.sub f64.sub end @@ -7596,7 +7597,7 @@ f64.reinterpret_i64 local.tee $0 f64.sub - local.get $6 + local.get $7 f64.mul local.get $1 local.get $3 @@ -7604,27 +7605,27 @@ f64.add local.tee $1 local.get $0 - local.get $6 + local.get $7 f64.mul local.tee $2 f64.add local.tee $0 i64.reinterpret_f64 - local.tee $13 + local.tee $14 i32.wrap_i64 local.set $5 block $folding-inner1 block $folding-inner0 - local.get $13 + local.get $14 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $11 + local.tee $12 i32.const 1083179008 i32.ge_s if local.get $5 - local.get $11 + local.get $12 i32.const 1083179008 i32.sub i32.or @@ -7638,14 +7639,14 @@ i32.or br_if $folding-inner0 else - local.get $11 + local.get $12 i32.const 2147483647 i32.and i32.const 1083231232 i32.ge_u i32.const 0 local.get $5 - local.get $11 + local.get $12 i32.const -1064252416 i32.sub i32.or @@ -7658,31 +7659,31 @@ select br_if $folding-inner1 end - local.get $11 + local.get $12 i32.const 2147483647 i32.and - local.tee $10 + local.tee $11 i32.const 20 i32.shr_u i32.const 1023 i32.sub local.set $5 i32.const 0 - local.set $7 + local.set $6 local.get $1 - local.get $10 + local.get $11 i32.const 1071644672 i32.gt_s if i32.const 1048575 - local.get $11 + local.get $12 i32.const 1048576 local.get $5 i32.const 1 i32.add i32.shr_s i32.add - local.tee $10 + local.tee $11 i32.const 2147483647 i32.and i32.const 20 @@ -7693,7 +7694,7 @@ i32.shr_s i32.const -1 i32.xor - local.get $10 + local.get $11 i32.and i64.extend_i32_s i64.const 32 @@ -7701,7 +7702,7 @@ f64.reinterpret_i64 local.set $0 i32.const 0 - local.get $10 + local.get $11 i32.const 1048575 i32.and i32.const 1048576 @@ -7710,14 +7711,14 @@ local.get $5 i32.sub i32.shr_s - local.tee $7 + local.tee $6 i32.sub - local.get $7 - local.get $11 + local.get $6 + local.get $12 i32.const 0 i32.lt_s select - local.set $7 + local.set $6 local.get $2 local.get $0 f64.sub @@ -7750,7 +7751,7 @@ local.get $2 f64.mul local.set $0 - local.get $9 + local.get $10 f64.const 1 local.get $2 local.get $2 @@ -7799,7 +7800,7 @@ i64.const 32 i64.shr_u i32.wrap_i64 - local.get $7 + local.get $6 i32.const 20 i32.shl i32.add @@ -7810,7 +7811,7 @@ i32.le_s if (result f64) local.get $0 - local.get $7 + local.get $6 call $~lib/math/NativeMath.scalbn else local.get $0 @@ -7827,14 +7828,14 @@ f64.mul return end - local.get $9 + local.get $10 f64.const 1.e+300 f64.mul f64.const 1.e+300 f64.mul return end - local.get $9 + local.get $10 f64.const 1e-300 f64.mul f64.const 1e-300 @@ -7862,13 +7863,13 @@ (local $2 f64) (local $3 f64) (local $4 i32) - (local $5 f64) + (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 f32) - (local $10 i32) - (local $11 i64) + (local $7 i64) + (local $8 f32) + (local $9 i32) + (local $10 i64) + (local $11 f64) local.get $1 f32.abs f32.const 2 @@ -7944,7 +7945,7 @@ local.tee $4 i32.const 2147483647 i32.and - local.set $7 + local.set $6 local.get $1 local.get $1 f32.nearest @@ -7961,28 +7962,28 @@ local.get $1 f32.const 0.5 f32.mul - local.tee $9 - local.get $9 + local.tee $8 + local.get $8 f32.nearest f32.ne i32.const 31 i32.shl - local.set $10 + local.set $9 local.get $0 f32.neg local.set $0 end local.get $1 i32.reinterpret_f32 - local.set $6 - local.get $7 + local.set $5 + local.get $6 i32.const 1065353216 i32.eq if (result i32) i32.const 2143289344 i32.const 1065353216 local.get $4 - local.get $6 + local.get $5 i32.const 2147483647 i32.and i32.const 2139095040 @@ -7990,15 +7991,15 @@ i32.or select else - local.get $7 + local.get $6 if (result i32) - local.get $7 + local.get $6 i32.const 2139095040 i32.eq if (result i32) i32.const 0 i32.const 2139095040 - local.get $6 + local.get $5 i32.const 31 i32.shr_u select @@ -8007,33 +8008,34 @@ if (result i32) i32.const 2143289344 else - local.get $0 - f64.promote_f32 - i64.reinterpret_f64 - local.tee $11 - i64.const 4604544271217802189 - i64.sub - i64.const 52 - i64.shr_s - local.set $8 - local.get $11 - local.get $8 - i64.const 52 - i64.shl - i64.sub - f64.reinterpret_i64 - local.tee $2 - f64.const 1 - f64.sub - local.get $2 - f64.const 1 - f64.add - f64.div - local.tee $3 - local.get $3 - f64.mul - local.set $2 - block $~lib/math/exp2f|inlined.0 + block $~lib/math/exp2f|inlined.0 (result f64) + local.get $0 + f64.promote_f32 + i64.reinterpret_f64 + local.tee $10 + i64.const 4604544271217802189 + i64.sub + i64.const 52 + i64.shr_s + local.set $7 + local.get $10 + local.get $7 + i64.const 52 + i64.shl + i64.sub + f64.reinterpret_i64 + local.tee $2 + f64.const 1 + f64.sub + local.get $2 + f64.const 1 + f64.add + f64.div + local.tee $3 + local.get $3 + f64.mul + local.set $2 + f64.const 0 local.get $1 f64.promote_f32 local.get $3 @@ -8059,7 +8061,7 @@ f64.add f64.const 2.8853900817779268 f64.mul - local.get $8 + local.get $7 f64.convert_i64_s f64.add f64.mul @@ -8067,16 +8069,17 @@ f64.const -1022 f64.lt br_if $~lib/math/exp2f|inlined.0 + drop f64.const inf - local.set $5 local.get $2 f64.const 1024 f64.ge br_if $~lib/math/exp2f|inlined.0 + drop local.get $2 local.get $2 f64.nearest - local.tee $5 + local.tee $11 f64.sub local.tee $2 local.get $2 @@ -8110,15 +8113,13 @@ f64.const 1 f64.add i64.reinterpret_f64 - local.get $5 + local.get $11 i64.trunc_f64_s i64.const 52 i64.shl i64.add f64.reinterpret_i64 - local.set $5 end - local.get $5 f32.demote_f64 i32.reinterpret_f32 end @@ -8126,13 +8127,13 @@ else i32.const 2139095040 i32.const 0 - local.get $6 + local.get $5 i32.const 31 i32.shr_u select end end - local.get $10 + local.get $9 i32.or f32.reinterpret_i32 ) diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index 34d5c026c6..74e16f90d7 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -252,7 +252,6 @@ f64.eq ) (func $std/mod/test_fmod (param $0 f64) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 052dace6c3..824e3ffba0 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -619,11 +619,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1456 @@ -631,14 +631,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -648,17 +648,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index b32bd2516b..a59abbd018 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -653,11 +653,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1472 @@ -665,14 +665,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -682,17 +682,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index 014bcc44ce..3fb7d0794f 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -934,11 +934,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 18912 @@ -946,14 +946,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -963,17 +963,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end @@ -2381,6 +2381,8 @@ i32.add i32.load16_u local.tee $3 + local.set $2 + local.get $3 i32.const 7 i32.shr_u if @@ -2784,8 +2786,8 @@ i32.const 1 i32.shl i32.add - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.const 65 i32.sub i32.const 26 diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index 9beb24ee19..ec19911a23 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -684,11 +684,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 22064 @@ -696,14 +696,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -713,17 +713,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 6f8f2512d7..e680d9a6ff 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -1274,11 +1274,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 22000 @@ -1286,14 +1286,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -1303,17 +1303,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end @@ -3515,11 +3515,9 @@ (local $10 i64) (local $11 f64) (local $12 f64) - (local $13 f64) - (local $14 i32) - (local $15 i32) - (local $16 i64) - (local $17 i64) + (local $13 i32) + (local $14 i64) + (local $15 i64) block $folding-inner0 local.get $0 call $~lib/rt/pure/__retain @@ -3537,7 +3535,7 @@ i32.load16_u local.set $8 f64.const 1 - local.set $13 + local.set $12 loop $while-continue|0 local.get $6 if (result i32) @@ -3574,7 +3572,7 @@ i32.eqz br_if $folding-inner0 f64.const -1 - local.set $13 + local.set $12 local.get $0 i32.const 2 i32.add @@ -3624,7 +3622,7 @@ if local.get $4 call $~lib/rt/pure/__release - local.get $13 + local.get $12 f64.const inf f64.mul return @@ -3693,7 +3691,7 @@ select br_if $folding-inner0 i32.const 1 - local.set $14 + local.set $13 loop $for-loop|2 local.get $0 i32.load16_u @@ -3744,7 +3742,7 @@ local.set $2 loop $for-loop|3 i32.const 1 - local.get $14 + local.get $13 i32.eqz i32.const 0 local.get $8 @@ -3786,7 +3784,7 @@ local.get $1 local.set $5 i32.const 1 - local.set $14 + local.set $13 end local.get $6 i32.const 1 @@ -3807,61 +3805,51 @@ end end end - local.get $5 - local.get $1 - local.get $14 - select - i32.const 19 - local.get $1 - i32.const 19 - local.get $1 - i32.lt_s - select - i32.sub - local.set $8 - i32.const 1 - local.set $1 - block $~lib/util/string/parseExp|inlined.0 - local.get $0 - i32.load16_u - i32.const 32 - i32.or - i32.const 101 - i32.ne - br_if $~lib/util/string/parseExp|inlined.0 - local.get $0 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - local.tee $0 - i32.const 45 - i32.eq - if (result i32) - local.get $6 + block $~lib/util/string/scientific|inlined.0 (result f64) + f64.const 0 + i32.const 1 + local.get $5 + local.get $1 + local.get $13 + select + i32.const 19 + local.get $1 + i32.const 19 + local.get $1 + i32.lt_s + select + i32.sub + block $~lib/util/string/parseExp|inlined.0 (result i32) i32.const 1 - i32.sub - local.tee $6 - i32.eqz - br_if $~lib/util/string/parseExp|inlined.0 - i32.const -1 local.set $1 - local.get $2 + i32.const 0 + local.get $0 + i32.load16_u + i32.const 32 + i32.or + i32.const 101 + i32.ne + br_if $~lib/util/string/parseExp|inlined.0 + drop + local.get $0 i32.const 2 i32.add local.tee $2 i32.load16_u - else - local.get $0 - i32.const 43 + local.tee $0 + i32.const 45 i32.eq if (result i32) + i32.const 0 local.get $6 i32.const 1 i32.sub local.tee $6 i32.eqz br_if $~lib/util/string/parseExp|inlined.0 + drop + i32.const -1 + local.set $1 local.get $2 i32.const 2 i32.add @@ -3869,79 +3857,94 @@ i32.load16_u else local.get $0 + i32.const 43 + i32.eq + if (result i32) + i32.const 0 + local.get $6 + i32.const 1 + i32.sub + local.tee $6 + i32.eqz + br_if $~lib/util/string/parseExp|inlined.0 + drop + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + else + local.get $0 + end end - end - local.set $0 - loop $while-continue|4 - local.get $0 - i32.const 48 - i32.eq - if - local.get $6 - i32.const 1 - i32.sub - local.tee $6 - i32.eqz - br_if $~lib/util/string/parseExp|inlined.0 - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - local.set $0 - br $while-continue|4 + local.set $0 + loop $while-continue|4 + local.get $0 + i32.const 48 + i32.eq + if + i32.const 0 + local.get $6 + i32.const 1 + i32.sub + local.tee $6 + i32.eqz + br_if $~lib/util/string/parseExp|inlined.0 + drop + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + local.set $0 + br $while-continue|4 + end end - end - local.get $0 - i32.const 48 - i32.sub - local.set $0 - loop $for-loop|5 local.get $0 - i32.const 10 - i32.lt_u - i32.const 0 - local.get $6 - select - if - local.get $1 - i32.const 3200 - i32.mul - local.set $15 - local.get $3 - i32.const 3200 - i32.ge_s - br_if $~lib/util/string/parseExp|inlined.0 + i32.const 48 + i32.sub + local.set $0 + loop $for-loop|5 local.get $0 - local.get $3 i32.const 10 - i32.mul - i32.add - local.set $3 + i32.lt_u + i32.const 0 local.get $6 - i32.const 1 - i32.sub - local.set $6 - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - i32.const 48 - i32.sub - local.set $0 - br $for-loop|5 + select + if + local.get $1 + i32.const 3200 + i32.mul + local.get $3 + i32.const 3200 + i32.ge_s + br_if $~lib/util/string/parseExp|inlined.0 + drop + local.get $0 + local.get $3 + i32.const 10 + i32.mul + i32.add + local.set $3 + local.get $6 + i32.const 1 + i32.sub + local.set $6 + local.get $2 + i32.const 2 + i32.add + local.tee $2 + i32.load16_u + i32.const 48 + i32.sub + local.set $0 + br $for-loop|5 + end end + local.get $1 + local.get $3 + i32.mul end - local.get $1 - local.get $3 - i32.mul - local.set $15 - end - block $~lib/util/string/scientific|inlined.0 - i32.const 1 - local.get $8 - local.get $15 i32.add local.tee $0 i32.const -342 @@ -3950,19 +3953,20 @@ i64.eqz select br_if $~lib/util/string/scientific|inlined.0 + drop f64.const inf - local.set $11 local.get $0 i32.const 308 i32.gt_s br_if $~lib/util/string/scientific|inlined.0 + drop local.get $7 f64.convert_i64_u - local.tee $12 - local.set $11 + local.tee $11 local.get $0 i32.eqz br_if $~lib/util/string/scientific|inlined.0 + drop local.get $0 i32.const 37 i32.le_s @@ -3972,7 +3976,7 @@ i32.gt_s select if - local.get $12 + local.get $11 local.get $0 i32.const 3 i32.shl @@ -3980,7 +3984,7 @@ i32.add f64.load f64.mul - local.set $12 + local.set $11 i32.const 22 local.set $0 end @@ -4006,7 +4010,7 @@ i32.const 0 i32.gt_s if - local.get $12 + local.get $11 local.get $0 i32.const 3 i32.shl @@ -4014,10 +4018,9 @@ i32.add f64.load f64.mul - local.set $11 br $~lib/util/string/scientific|inlined.0 end - local.get $12 + local.get $11 i32.const 0 local.get $0 i32.sub @@ -4088,13 +4091,13 @@ i32.sub call $~lib/math/ipow32 i64.extend_i32_s - local.tee $16 + local.tee $14 i64.div_u - local.tee $17 + local.tee $15 i64.clz local.set $10 local.get $7 - local.get $16 + local.get $14 i64.rem_u f64.convert_i64_u i64.reinterpret_f64 @@ -4103,11 +4106,11 @@ i64.shl i64.add f64.reinterpret_i64 - local.get $16 + local.get $14 f64.convert_i64_u f64.div i64.trunc_f64_u - local.get $17 + local.get $15 local.get $10 i64.shl i64.add @@ -4246,12 +4249,10 @@ call $~lib/math/NativeMath.scalbn end end - local.set $11 end local.get $4 call $~lib/rt/pure/__release - local.get $11 - local.get $13 + local.get $12 f64.copysign return end @@ -5771,7 +5772,7 @@ i32.const 0 i32.lt_s select - local.set $5 + local.set $6 local.get $1 i32.const 16 i32.sub @@ -5802,22 +5803,20 @@ i32.eqz br_if $folding-inner0 local.get $3 - local.get $5 + local.get $6 local.get $3 - local.get $5 + local.get $6 i32.lt_s select - local.tee $3 + local.tee $5 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $5 + local.tee $3 i32.load offset=4 local.set $6 - i32.const 0 - local.set $2 loop $for-loop|0 - local.get $2 - local.get $3 + local.get $4 + local.get $5 i32.lt_s if call $~lib/rt/tlsf/maybeInitialize @@ -5826,34 +5825,34 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.tee $4 + local.tee $2 local.get $0 - local.get $2 + local.get $4 i32.const 1 i32.shl i32.add i32.load16_u i32.store16 local.get $6 - local.get $2 + local.get $4 i32.const 2 i32.shl i32.add - local.get $4 + local.get $2 i32.store - local.get $4 + local.get $2 call $~lib/rt/pure/__retain drop - local.get $2 + local.get $4 i32.const 1 i32.add - local.set $2 + local.set $4 br $for-loop|0 end end local.get $1 call $~lib/rt/pure/__release - local.get $5 + local.get $3 return end i32.const 0 @@ -5863,14 +5862,14 @@ loop $while-continue|1 local.get $0 local.get $1 - local.get $4 + local.get $5 call $~lib/string/String#indexOf - local.tee $6 + local.tee $4 i32.const -1 i32.xor if - local.get $6 local.get $4 + local.get $5 i32.sub local.tee $7 i32.const 0 @@ -5887,7 +5886,7 @@ i32.add local.tee $9 local.get $0 - local.get $4 + local.get $5 i32.const 1 i32.shl i32.add @@ -5905,17 +5904,17 @@ i32.const 1 i32.add local.tee $10 - local.get $5 + local.get $6 i32.eq br_if $folding-inner1 - local.get $6 + local.get $4 local.get $8 i32.add - local.set $4 + local.set $5 br $while-continue|1 end end - local.get $4 + local.get $5 i32.eqz if local.get $2 @@ -5924,7 +5923,7 @@ br $folding-inner1 end local.get $3 - local.get $4 + local.get $5 i32.sub local.tee $3 i32.const 0 @@ -5939,16 +5938,16 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.tee $5 + local.tee $4 local.get $0 - local.get $4 + local.get $5 i32.const 1 i32.shl i32.add local.get $3 call $~lib/memory/memory.copy local.get $2 - local.get $5 + local.get $4 call $~lib/array/Array<~lib/string/String>#push else local.get $2 @@ -7815,8 +7814,8 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 f32) + (local $8 f32) + (local $9 i32) (local $10 i32) (local $11 i32) (local $12 i32) @@ -7846,8 +7845,8 @@ (local $36 i32) (local $37 i32) (local $38 i32) - (local $39 i32) - (local $40 i64) + (local $39 i64) + (local $40 i32) (local $41 i32) (local $42 i32) (local $43 i32) @@ -8231,7 +8230,7 @@ global.set $~argumentsLength i32.const 0 call $~lib/string/String.fromCharCode@varargs - local.tee $10 + local.tee $9 i32.const 1296 call $~lib/string/String.__eq i32.eqz @@ -8247,7 +8246,7 @@ global.set $~argumentsLength i32.const 54 call $~lib/string/String.fromCharCode@varargs - local.tee $11 + local.tee $10 i32.const 1472 call $~lib/string/String.__eq i32.eqz @@ -8263,7 +8262,7 @@ global.set $~argumentsLength i32.const 65590 call $~lib/string/String.fromCharCode@varargs - local.tee $12 + local.tee $11 i32.const 1472 call $~lib/string/String.__eq i32.eqz @@ -8278,7 +8277,7 @@ i32.const 55296 i32.const 57088 call $~lib/string/String.fromCharCode - local.tee $13 + local.tee $12 i32.const 1504 call $~lib/string/String.__eq i32.eqz @@ -8292,7 +8291,7 @@ end i32.const 0 call $~lib/string/String.fromCodePoint - local.tee $14 + local.tee $13 i32.const 1296 call $~lib/string/String.__eq i32.eqz @@ -8306,7 +8305,7 @@ end i32.const 54 call $~lib/string/String.fromCodePoint - local.tee $15 + local.tee $14 i32.const 1472 call $~lib/string/String.__eq i32.eqz @@ -8320,7 +8319,7 @@ end i32.const 119558 call $~lib/string/String.fromCodePoint - local.tee $16 + local.tee $15 i32.const 1584 call $~lib/string/String.__eq i32.eqz @@ -8497,7 +8496,7 @@ i32.const 3 i32.const 1744 call $~lib/string/String#padStart - local.tee $17 + local.tee $16 i32.const 1776 call $~lib/string/String.__eq i32.eqz @@ -8513,7 +8512,7 @@ i32.const 10 i32.const 1280 call $~lib/string/String#padStart - local.tee $18 + local.tee $17 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -8529,7 +8528,7 @@ i32.const 100 i32.const 1280 call $~lib/string/String#padStart - local.tee $19 + local.tee $18 i32.const 1328 call $~lib/string/String.__eq i32.eqz @@ -8545,7 +8544,7 @@ i32.const 5 i32.const 1744 call $~lib/string/String#padStart - local.tee $20 + local.tee $19 i32.const 1840 call $~lib/string/String.__eq i32.eqz @@ -8561,7 +8560,7 @@ i32.const 6 i32.const 1872 call $~lib/string/String#padStart - local.tee $21 + local.tee $20 i32.const 1904 call $~lib/string/String.__eq i32.eqz @@ -8577,7 +8576,7 @@ i32.const 8 i32.const 1872 call $~lib/string/String#padStart - local.tee $22 + local.tee $21 i32.const 1936 call $~lib/string/String.__eq i32.eqz @@ -8593,7 +8592,7 @@ i32.const 0 i32.const 1744 call $~lib/string/String#padEnd - local.tee $23 + local.tee $22 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -8609,7 +8608,7 @@ i32.const 15 i32.const 1744 call $~lib/string/String#padEnd - local.tee $24 + local.tee $23 global.get $std/string/str call $~lib/string/String.__eq i32.eqz @@ -8625,7 +8624,7 @@ i32.const 3 i32.const 1744 call $~lib/string/String#padEnd - local.tee $25 + local.tee $24 i32.const 1776 call $~lib/string/String.__eq i32.eqz @@ -8641,7 +8640,7 @@ i32.const 10 i32.const 1280 call $~lib/string/String#padEnd - local.tee $26 + local.tee $25 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -8657,7 +8656,7 @@ i32.const 100 i32.const 1280 call $~lib/string/String#padEnd - local.tee $27 + local.tee $26 i32.const 1328 call $~lib/string/String.__eq i32.eqz @@ -8673,7 +8672,7 @@ i32.const 5 i32.const 1744 call $~lib/string/String#padEnd - local.tee $28 + local.tee $27 i32.const 1968 call $~lib/string/String.__eq i32.eqz @@ -8689,7 +8688,7 @@ i32.const 6 i32.const 1808 call $~lib/string/String#padEnd - local.tee $29 + local.tee $28 i32.const 2000 call $~lib/string/String.__eq i32.eqz @@ -8705,7 +8704,7 @@ i32.const 8 i32.const 1808 call $~lib/string/String#padEnd - local.tee $30 + local.tee $29 i32.const 2032 call $~lib/string/String.__eq i32.eqz @@ -9132,7 +9131,7 @@ end i32.const 1280 call $~lib/string/String#trimStart - local.tee $31 + local.tee $30 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -9146,7 +9145,7 @@ end i32.const 2288 call $~lib/string/String#trimStart - local.tee $32 + local.tee $31 i32.const 2288 call $~lib/string/String.__eq i32.eqz @@ -9160,7 +9159,7 @@ end i32.const 2320 call $~lib/string/String#trimStart - local.tee $33 + local.tee $32 i32.const 2368 call $~lib/string/String.__eq i32.eqz @@ -9174,7 +9173,7 @@ end i32.const 1280 call $~lib/string/String#trimEnd - local.tee $34 + local.tee $33 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -9188,7 +9187,7 @@ end i32.const 2288 call $~lib/string/String#trimEnd - local.tee $35 + local.tee $34 i32.const 2288 call $~lib/string/String.__eq i32.eqz @@ -9202,7 +9201,7 @@ end i32.const 2320 call $~lib/string/String#trimEnd - local.tee $36 + local.tee $35 i32.const 2400 call $~lib/string/String.__eq i32.eqz @@ -9216,7 +9215,7 @@ end i32.const 1280 call $~lib/string/String#trim - local.tee $37 + local.tee $36 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -9230,7 +9229,7 @@ end i32.const 2288 call $~lib/string/String#trim - local.tee $38 + local.tee $37 i32.const 2288 call $~lib/string/String.__eq i32.eqz @@ -9244,7 +9243,7 @@ end i32.const 2320 call $~lib/string/String#trim - local.tee $39 + local.tee $38 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -9725,11 +9724,11 @@ i32.const 0 call $~lib/util/string/strtol f32.demote_f64 - local.set $9 + local.set $8 i32.const 3536 call $~lib/rt/pure/__release - local.get $9 - local.get $9 + local.get $8 + local.get $8 f32.eq if i32.const 0 @@ -11244,16 +11243,16 @@ i32.const 8368 i32.const 8528 call $~lib/string/String.__concat - local.tee $41 + local.tee $40 i32.const 8688 call $~lib/string/String.__concat - local.tee $42 + local.tee $41 i32.const 8848 call $~lib/string/String.__concat - local.tee $43 + local.tee $42 i32.const 9008 call $~lib/string/String.__concat - local.tee $44 + local.tee $43 call $~lib/string/parseFloat f64.const 1797693134862315708145274e284 f64.ne @@ -12030,7 +12029,7 @@ i32.const 1328 i32.const 1 call $~lib/string/String#repeat - local.tee $45 + local.tee $44 i32.const 1328 call $~lib/string/String.__eq i32.eqz @@ -12045,7 +12044,7 @@ i32.const 1328 i32.const 2 call $~lib/string/String#repeat - local.tee $46 + local.tee $45 i32.const 12368 call $~lib/string/String.__eq i32.eqz @@ -12060,7 +12059,7 @@ i32.const 1328 i32.const 3 call $~lib/string/String#repeat - local.tee $47 + local.tee $46 i32.const 12448 call $~lib/string/String.__eq i32.eqz @@ -12075,7 +12074,7 @@ i32.const 11952 i32.const 4 call $~lib/string/String#repeat - local.tee $48 + local.tee $47 i32.const 12480 call $~lib/string/String.__eq i32.eqz @@ -12090,7 +12089,7 @@ i32.const 1328 i32.const 5 call $~lib/string/String#repeat - local.tee $49 + local.tee $48 i32.const 12512 call $~lib/string/String.__eq i32.eqz @@ -12105,7 +12104,7 @@ i32.const 1328 i32.const 6 call $~lib/string/String#repeat - local.tee $50 + local.tee $49 i32.const 12544 call $~lib/string/String.__eq i32.eqz @@ -12120,7 +12119,7 @@ i32.const 1328 i32.const 7 call $~lib/string/String#repeat - local.tee $51 + local.tee $50 i32.const 12576 call $~lib/string/String.__eq i32.eqz @@ -12136,7 +12135,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replace - local.tee $52 + local.tee $51 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12152,7 +12151,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replace - local.tee $53 + local.tee $52 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12168,7 +12167,7 @@ i32.const 3472 i32.const 1280 call $~lib/string/String#replace - local.tee $54 + local.tee $53 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12184,7 +12183,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replace - local.tee $55 + local.tee $54 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12200,7 +12199,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replace - local.tee $56 + local.tee $55 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12216,7 +12215,7 @@ i32.const 1808 i32.const 3472 call $~lib/string/String#replace - local.tee $57 + local.tee $56 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12232,7 +12231,7 @@ i32.const 2256 i32.const 3472 call $~lib/string/String#replace - local.tee $58 + local.tee $57 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12248,7 +12247,7 @@ i32.const 11952 i32.const 11952 call $~lib/string/String#replace - local.tee $59 + local.tee $58 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12264,7 +12263,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replace - local.tee $60 + local.tee $59 i32.const 12640 call $~lib/string/String.__eq i32.eqz @@ -12280,7 +12279,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replace - local.tee $61 + local.tee $60 i32.const 12672 call $~lib/string/String.__eq i32.eqz @@ -12296,7 +12295,7 @@ i32.const 12736 i32.const 3472 call $~lib/string/String#replace - local.tee $62 + local.tee $61 i32.const 12672 call $~lib/string/String.__eq i32.eqz @@ -12312,7 +12311,7 @@ i32.const 12768 i32.const 12800 call $~lib/string/String#replace - local.tee $63 + local.tee $62 i32.const 12832 call $~lib/string/String.__eq i32.eqz @@ -12328,7 +12327,7 @@ i32.const 12768 i32.const 1280 call $~lib/string/String#replace - local.tee $64 + local.tee $63 i32.const 11952 call $~lib/string/String.__eq i32.eqz @@ -12344,7 +12343,7 @@ i32.const 1280 i32.const 1808 call $~lib/string/String#replaceAll - local.tee $65 + local.tee $64 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12360,7 +12359,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $66 + local.tee $65 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12376,7 +12375,7 @@ i32.const 1808 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $67 + local.tee $66 i32.const 12800 call $~lib/string/String.__eq i32.eqz @@ -12392,7 +12391,7 @@ i32.const 1808 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $68 + local.tee $67 i32.const 12912 call $~lib/string/String.__eq i32.eqz @@ -12408,7 +12407,7 @@ i32.const 11952 i32.const 11952 call $~lib/string/String#replaceAll - local.tee $69 + local.tee $68 i32.const 2000 call $~lib/string/String.__eq i32.eqz @@ -12424,7 +12423,7 @@ i32.const 1328 i32.const 12912 call $~lib/string/String#replaceAll - local.tee $70 + local.tee $69 i32.const 12976 call $~lib/string/String.__eq i32.eqz @@ -12440,7 +12439,7 @@ i32.const 11952 i32.const 12800 call $~lib/string/String#replaceAll - local.tee $71 + local.tee $70 i32.const 13024 call $~lib/string/String.__eq i32.eqz @@ -12456,7 +12455,7 @@ i32.const 13088 i32.const 12800 call $~lib/string/String#replaceAll - local.tee $72 + local.tee $71 i32.const 13120 call $~lib/string/String.__eq i32.eqz @@ -12472,7 +12471,7 @@ i32.const 2256 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $73 + local.tee $72 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12488,7 +12487,7 @@ i32.const 13152 i32.const 12800 call $~lib/string/String#replaceAll - local.tee $74 + local.tee $73 i32.const 2256 call $~lib/string/String.__eq i32.eqz @@ -12504,7 +12503,7 @@ i32.const 13184 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $75 + local.tee $74 i32.const 13216 call $~lib/string/String.__eq i32.eqz @@ -12520,7 +12519,7 @@ i32.const 11952 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $76 + local.tee $75 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12536,7 +12535,7 @@ i32.const 3440 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $77 + local.tee $76 i32.const 13248 call $~lib/string/String.__eq i32.eqz @@ -12552,7 +12551,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $78 + local.tee $77 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12568,7 +12567,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $79 + local.tee $78 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12584,7 +12583,7 @@ i32.const 3472 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $80 + local.tee $79 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12600,7 +12599,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $81 + local.tee $80 i32.const 3472 call $~lib/string/String.__eq i32.eqz @@ -12616,7 +12615,7 @@ i32.const 1808 i32.const 3440 call $~lib/string/String#replaceAll - local.tee $82 + local.tee $81 i32.const 3440 call $~lib/string/String.__eq i32.eqz @@ -12632,7 +12631,7 @@ i32.const 2224 i32.const 3440 call $~lib/string/String#replaceAll - local.tee $83 + local.tee $82 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12648,7 +12647,7 @@ i32.const 1280 i32.const 3472 call $~lib/string/String#replaceAll - local.tee $84 + local.tee $83 i32.const 13280 call $~lib/string/String.__eq i32.eqz @@ -12664,7 +12663,7 @@ i32.const 1280 i32.const 1280 call $~lib/string/String#replaceAll - local.tee $85 + local.tee $84 i32.const 1808 call $~lib/string/String.__eq i32.eqz @@ -12684,7 +12683,7 @@ i32.const 0 i32.const 2147483647 call $~lib/string/String#slice - local.tee $86 + local.tee $85 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12700,7 +12699,7 @@ i32.const -1 i32.const 2147483647 call $~lib/string/String#slice - local.tee $87 + local.tee $86 i32.const 13360 call $~lib/string/String.__eq i32.eqz @@ -12716,7 +12715,7 @@ i32.const -5 i32.const 2147483647 call $~lib/string/String#slice - local.tee $88 + local.tee $87 i32.const 13392 call $~lib/string/String.__eq i32.eqz @@ -12732,7 +12731,7 @@ i32.const 2 i32.const 7 call $~lib/string/String#slice - local.tee $89 + local.tee $88 i32.const 13424 call $~lib/string/String.__eq i32.eqz @@ -12748,7 +12747,7 @@ i32.const -11 i32.const -6 call $~lib/string/String#slice - local.tee $90 + local.tee $89 i32.const 13456 call $~lib/string/String.__eq i32.eqz @@ -12764,7 +12763,7 @@ i32.const 4 i32.const 3 call $~lib/string/String#slice - local.tee $91 + local.tee $90 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12780,7 +12779,7 @@ i32.const 0 i32.const -1 call $~lib/string/String#slice - local.tee $92 + local.tee $91 i32.const 13488 call $~lib/string/String.__eq i32.eqz @@ -12796,7 +12795,7 @@ i32.const 0 i32.const 2147483647 call $~lib/string/String#substr - local.tee $93 + local.tee $92 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12812,7 +12811,7 @@ i32.const -1 i32.const 2147483647 call $~lib/string/String#substr - local.tee $94 + local.tee $93 i32.const 13360 call $~lib/string/String.__eq i32.eqz @@ -12828,7 +12827,7 @@ i32.const -5 i32.const 2147483647 call $~lib/string/String#substr - local.tee $95 + local.tee $94 i32.const 13392 call $~lib/string/String.__eq i32.eqz @@ -12844,7 +12843,7 @@ i32.const 2 i32.const 7 call $~lib/string/String#substr - local.tee $96 + local.tee $95 i32.const 13536 call $~lib/string/String.__eq i32.eqz @@ -12860,7 +12859,7 @@ i32.const -11 i32.const -6 call $~lib/string/String#substr - local.tee $97 + local.tee $96 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12876,7 +12875,7 @@ i32.const 4 i32.const 3 call $~lib/string/String#substr - local.tee $98 + local.tee $97 i32.const 13568 call $~lib/string/String.__eq i32.eqz @@ -12892,7 +12891,7 @@ i32.const 0 i32.const -1 call $~lib/string/String#substr - local.tee $99 + local.tee $98 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12908,7 +12907,7 @@ i32.const 0 i32.const 100 call $~lib/string/String#substr - local.tee $100 + local.tee $99 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12924,7 +12923,7 @@ i32.const 4 i32.const 4 call $~lib/string/String#substr - local.tee $101 + local.tee $100 i32.const 13600 call $~lib/string/String.__eq i32.eqz @@ -12940,7 +12939,7 @@ i32.const 4 i32.const -3 call $~lib/string/String#substr - local.tee $102 + local.tee $101 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -12956,7 +12955,7 @@ i32.const 0 i32.const 2147483647 call $~lib/string/String#substring - local.tee $103 + local.tee $102 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12972,7 +12971,7 @@ i32.const -1 i32.const 2147483647 call $~lib/string/String#substring - local.tee $104 + local.tee $103 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -12988,7 +12987,7 @@ i32.const -5 i32.const 2147483647 call $~lib/string/String#substring - local.tee $105 + local.tee $104 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -13004,7 +13003,7 @@ i32.const 2 i32.const 7 call $~lib/string/String#substring - local.tee $106 + local.tee $105 i32.const 13424 call $~lib/string/String.__eq i32.eqz @@ -13020,7 +13019,7 @@ i32.const -11 i32.const -6 call $~lib/string/String#substring - local.tee $107 + local.tee $106 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -13036,7 +13035,7 @@ i32.const 4 i32.const 3 call $~lib/string/String#substring - local.tee $108 + local.tee $107 i32.const 13632 call $~lib/string/String.__eq i32.eqz @@ -13052,7 +13051,7 @@ i32.const 0 i32.const -1 call $~lib/string/String#substring - local.tee $109 + local.tee $108 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -13068,7 +13067,7 @@ i32.const 0 i32.const 100 call $~lib/string/String#substring - local.tee $110 + local.tee $109 i32.const 13312 call $~lib/string/String.__eq i32.eqz @@ -13084,7 +13083,7 @@ i32.const 4 i32.const 4 call $~lib/string/String#substring - local.tee $111 + local.tee $110 i32.const 1280 call $~lib/string/String.__eq i32.eqz @@ -13100,7 +13099,7 @@ i32.const 4 i32.const -3 call $~lib/string/String#substring - local.tee $112 + local.tee $111 i32.const 2256 call $~lib/string/String.__eq i32.eqz @@ -13124,14 +13123,17 @@ local.get $1 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $0 + local.tee $2 i32.const 1280 call $~lib/string/String.__eq - local.set $8 - local.get $0 + local.set $0 + local.get $2 call $~lib/rt/pure/__release + else + i32.const 0 + local.set $0 end - local.get $8 + local.get $0 i32.eqz if i32.const 0 @@ -13596,21 +13598,22 @@ i32.const 1280 i32.const 2147483647 call $~lib/string/String#split + local.set $2 local.get $1 call $~lib/rt/pure/__release - local.tee $1 + local.get $2 i32.load offset=12 i32.const 3 i32.eq if - local.get $1 + local.get $2 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $1 i32.const 1328 call $~lib/string/String.__eq local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release else i32.const 0 @@ -13618,14 +13621,14 @@ end local.get $0 if - local.get $1 + local.get $2 i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $1 i32.const 11920 call $~lib/string/String.__eq local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release else i32.const 0 @@ -13633,14 +13636,14 @@ end local.get $0 if - local.get $1 + local.get $2 i32.const 2 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $1 i32.const 12768 call $~lib/string/String.__eq local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release else i32.const 0 @@ -13661,7 +13664,7 @@ i32.const 0 call $~lib/string/String#split local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release local.get $0 i32.load offset=12 @@ -13677,22 +13680,22 @@ i32.const 1280 i32.const 1 call $~lib/string/String#split - local.set $2 + local.set $1 local.get $0 call $~lib/rt/pure/__release - local.get $2 + local.get $1 i32.load offset=12 i32.const 1 i32.eq if - local.get $2 + local.get $1 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $1 + local.tee $2 i32.const 1328 call $~lib/string/String.__eq local.set $0 - local.get $1 + local.get $2 call $~lib/rt/pure/__release else i32.const 0 @@ -13712,10 +13715,9 @@ i32.const 2064 i32.const 1 call $~lib/string/String#split - local.set $1 - local.get $2 - call $~lib/rt/pure/__release local.get $1 + call $~lib/rt/pure/__release + local.tee $1 i32.load offset=12 i32.const 1 i32.eq @@ -13875,21 +13877,22 @@ i32.const 2064 i32.const -1 call $~lib/string/String#split + local.set $2 local.get $1 call $~lib/rt/pure/__release - local.tee $1 + local.get $2 i32.load offset=12 i32.const 3 i32.eq if - local.get $1 + local.get $2 i32.const 0 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $1 i32.const 1328 call $~lib/string/String.__eq local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release else i32.const 0 @@ -13897,14 +13900,14 @@ end local.get $0 if - local.get $1 + local.get $2 i32.const 1 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $1 i32.const 11920 call $~lib/string/String.__eq local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release else i32.const 0 @@ -13912,14 +13915,14 @@ end local.get $0 if - local.get $1 + local.get $2 i32.const 2 call $~lib/array/Array<~lib/string/String>#__get - local.tee $2 + local.tee $1 i32.const 12768 call $~lib/string/String.__eq local.set $0 - local.get $2 + local.get $1 call $~lib/rt/pure/__release else i32.const 0 @@ -13935,7 +13938,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $2 call $~lib/rt/pure/__release i32.const 0 i32.const 10 @@ -13985,7 +13988,7 @@ i32.const 12 i32.const 10 call $~lib/util/number/itoa32 - local.tee $8 + local.tee $112 i32.const 14400 call $~lib/string/String.__eq i32.eqz @@ -16754,6 +16757,8 @@ end global.get $std/string/str call $~lib/rt/pure/__release + local.get $9 + call $~lib/rt/pure/__release local.get $10 call $~lib/rt/pure/__release local.get $11 @@ -16766,12 +16771,12 @@ call $~lib/rt/pure/__release local.get $15 call $~lib/rt/pure/__release - local.get $16 - call $~lib/rt/pure/__release local.get $4 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release + local.get $16 + call $~lib/rt/pure/__release local.get $17 call $~lib/rt/pure/__release local.get $18 @@ -16816,7 +16821,7 @@ call $~lib/rt/pure/__release local.get $38 call $~lib/rt/pure/__release - local.get $39 + local.get $40 call $~lib/rt/pure/__release local.get $41 call $~lib/rt/pure/__release @@ -16824,18 +16829,18 @@ call $~lib/rt/pure/__release local.get $43 call $~lib/rt/pure/__release - local.get $44 + local.get $45 call $~lib/rt/pure/__release local.get $46 call $~lib/rt/pure/__release - local.get $47 - call $~lib/rt/pure/__release - local.get $45 + local.get $44 call $~lib/rt/pure/__release local.get $7 call $~lib/rt/pure/__release local.get $6 call $~lib/rt/pure/__release + local.get $47 + call $~lib/rt/pure/__release local.get $48 call $~lib/rt/pure/__release local.get $49 @@ -16964,15 +16969,13 @@ call $~lib/rt/pure/__release local.get $111 call $~lib/rt/pure/__release - local.get $112 - call $~lib/rt/pure/__release local.get $1 call $~lib/rt/pure/__release local.get $2 call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release - local.get $8 + local.get $112 call $~lib/rt/pure/__release local.get $113 call $~lib/rt/pure/__release diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 1616d474e6..c01f9c00c3 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -917,11 +917,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 12528 @@ -929,14 +929,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -946,17 +946,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end @@ -8053,23 +8053,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8092,7 +8091,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int8Array,i8>|inlined.0 end local.get $2 @@ -8106,10 +8104,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8123,23 +8121,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8162,7 +8159,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Uint8Array,u8>|inlined.0 end local.get $2 @@ -8176,10 +8172,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8194,25 +8190,24 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8237,7 +8232,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int16Array,i16>|inlined.0 end local.get $2 @@ -8251,10 +8245,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8268,25 +8262,24 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8311,7 +8304,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Uint16Array,u16>|inlined.0 end local.get $2 @@ -8325,10 +8317,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8341,25 +8333,24 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8384,7 +8375,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int32Array,i32>|inlined.0 end local.get $2 @@ -8398,10 +8388,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8418,25 +8408,24 @@ (local $4 i32) (local $5 i32) (local $6 i64) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8461,7 +8450,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Int64Array,i64>|inlined.0 end local.get $2 @@ -8475,10 +8463,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8495,25 +8483,24 @@ (local $4 i32) (local $5 i32) (local $6 f32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8538,7 +8525,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $2 @@ -8552,10 +8538,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (param $0 f32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -8573,25 +8559,24 @@ (local $4 i32) (local $5 i32) (local $6 f64) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 - block $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 + block $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -8616,7 +8601,6 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 br $~lib/typedarray/SOME<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $2 @@ -8630,10 +8614,10 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (param $0 f64) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -9221,23 +9205,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -9260,6 +9243,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int8Array,i8>|inlined.0 end local.get $2 @@ -9274,11 +9258,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -9292,23 +9274,22 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -9331,6 +9312,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Uint8Array,u8>|inlined.0 end local.get $2 @@ -9345,11 +9327,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 @@ -9370,25 +9350,24 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -9413,6 +9392,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 end local.get $2 @@ -9427,11 +9407,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $~lib/typedarray/Uint16Array#every (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9439,25 +9417,24 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -9482,6 +9459,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 end local.get $2 @@ -9496,11 +9474,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 @@ -9517,25 +9493,24 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -9560,6 +9535,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 end local.get $2 @@ -9574,11 +9550,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 @@ -9595,25 +9569,24 @@ (local $4 i32) (local $5 i32) (local $6 i64) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -9638,6 +9611,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 end local.get $2 @@ -9652,11 +9626,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -9825,25 +9797,24 @@ (local $4 i32) (local $5 i32) (local $6 f32) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -9868,6 +9839,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $2 @@ -9882,11 +9854,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $~lib/math/NativeMath.mod (param $0 f64) (result f64) (local $1 i64) @@ -10056,25 +10026,24 @@ (local $4 i32) (local $5 i32) (local $6 f64) - (local $7 i32) local.get $1 call $~lib/rt/pure/__retain local.set $3 - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $3 - call $~lib/rt/pure/__retain - local.set $1 - local.get $0 - i32.load offset=4 - local.set $4 - local.get $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - local.set $5 - block $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 + block $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $3 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $5 loop $for-loop|0 local.get $2 local.get $5 @@ -10099,6 +10068,7 @@ call $~lib/rt/pure/__release local.get $0 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $2 @@ -10113,11 +10083,9 @@ local.get $0 call $~lib/rt/pure/__release i32.const 1 - local.set $7 end local.get $3 call $~lib/rt/pure/__release - local.get $7 ) (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 @@ -35619,9 +35587,7 @@ end i32.const 0 local.set $0 - i32.const 0 - local.set $3 - block $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 + block $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 (result i32) i32.const 0 local.get $2 call $~lib/rt/pure/__retain @@ -35629,26 +35595,27 @@ i32.load offset=8 i32.const 3 i32.shr_u - local.tee $4 + local.tee $3 i32.ge_s i32.const 1 - local.get $4 + local.get $3 select if local.get $1 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $1 i32.load offset=4 - local.set $5 + local.set $4 loop $while-continue|0 local.get $0 - local.get $4 + local.get $3 i32.lt_s if i32.const 1 - local.get $5 + local.get $4 local.get $0 i32.const 3 i32.shl @@ -35665,7 +35632,6 @@ local.get $1 call $~lib/rt/pure/__release i32.const 1 - local.set $3 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 end local.get $0 @@ -35677,8 +35643,8 @@ end local.get $1 call $~lib/rt/pure/__release + i32.const 0 end - local.get $3 i32.eqz if i32.const 0 @@ -35710,9 +35676,7 @@ end i32.const 0 local.set $0 - i32.const 0 - local.set $4 - block $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 + block $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 (result i32) i32.const 0 local.get $3 call $~lib/rt/pure/__retain @@ -35720,26 +35684,27 @@ i32.load offset=8 i32.const 2 i32.shr_u - local.tee $5 + local.tee $4 i32.ge_s i32.const 1 - local.get $5 + local.get $4 select if local.get $1 call $~lib/rt/pure/__release + i32.const 0 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $1 i32.load offset=4 - local.set $6 + local.set $5 loop $while-continue|014 local.get $0 - local.get $5 + local.get $4 i32.lt_s if i32.const 1 - local.get $6 + local.get $5 local.get $0 i32.const 2 i32.shl @@ -35756,7 +35721,6 @@ local.get $1 call $~lib/rt/pure/__release i32.const 1 - local.set $4 br $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 end local.get $0 @@ -35768,8 +35732,8 @@ end local.get $1 call $~lib/rt/pure/__release + i32.const 0 end - local.get $4 i32.eqz if i32.const 0 diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index e29a251538..5da15c926e 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -688,11 +688,11 @@ i32.const 0 i32.store loop $for-loop|0 - local.get $2 + local.get $0 i32.const 23 i32.lt_u if - local.get $2 + local.get $0 i32.const 2 i32.shl i32.const 1216 @@ -700,14 +700,14 @@ i32.const 0 i32.store offset=4 i32.const 0 - local.set $0 + local.set $2 loop $for-loop|1 - local.get $0 + local.get $2 i32.const 16 i32.lt_u if - local.get $0 local.get $2 + local.get $0 i32.const 4 i32.shl i32.add @@ -717,17 +717,17 @@ i32.add i32.const 0 i32.store offset=96 - local.get $0 + local.get $2 i32.const 1 i32.add - local.set $0 + local.set $2 br $for-loop|1 end end - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $for-loop|0 end end @@ -1354,9 +1354,9 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $3 + local.tee $1 call $~lib/rt/pure/__release - local.get $3 + local.get $1 if local.get $2 i32.const 1 From 956644cb7f3d7f21a5abeac2ead45c09eedd6e9a Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 12 Oct 2020 23:12:15 +0300 Subject: [PATCH 9/9] add early merge-locals --- src/module.ts | 1 + tests/compiler/issues/1095.optimized.wat | 28 +- .../retain-release-sanity.optimized.wat | 217 +++--- tests/compiler/std/array.optimized.wat | 6 +- tests/compiler/std/map.optimized.wat | 736 +++++++++--------- tests/compiler/std/math.optimized.wat | 218 +++--- tests/compiler/std/set.optimized.wat | 378 +++++---- .../std/string-casemapping.optimized.wat | 174 ++--- .../std/string-encoding.optimized.wat | 12 +- tests/compiler/std/string.optimized.wat | 383 ++++----- tests/compiler/std/symbol.optimized.wat | 62 +- 11 files changed, 1085 insertions(+), 1130 deletions(-) diff --git a/src/module.ts b/src/module.ts index 19076aa509..82416c412c 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1531,6 +1531,7 @@ export class Module { if (optimizeLevel >= 3) { passes.push("flatten"); passes.push("simplify-locals-notee-nostructure"); + passes.push("merge-locals"); passes.push("vacuum"); passes.push("code-folding"); diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index b1142a3589..5460f37373 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -952,16 +952,16 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $3 + local.tee $2 i32.const 1200 i32.store - local.get $3 + local.get $2 call $~lib/rt/pure/__retain - local.tee $1 - local.set $2 - local.get $1 - i32.load local.tee $0 + local.set $3 + local.get $0 + i32.load + local.tee $1 i32.eqz if i32.const 1232 @@ -971,25 +971,25 @@ call $~lib/builtins/abort unreachable end + local.get $1 local.get $0 - local.get $2 i32.load - local.tee $2 + local.tee $0 i32.ne if - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $0 - local.get $2 + local.set $1 + local.get $0 call $~lib/rt/pure/__release end + local.get $3 local.get $1 - local.get $0 i32.store - local.get $1 - call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 1aef9ac5e6..be58f46ecd 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -1761,16 +1761,16 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $2 + local.tee $1 i32.const 0 i32.store - local.get $2 + local.get $1 i32.const 0 i32.store offset=4 - local.get $2 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $1 i32.const 0 i32.store offset=12 call $~lib/rt/tlsf/maybeInitialize @@ -1779,42 +1779,42 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.tee $1 + local.tee $0 i32.const 12 call $~lib/memory/memory.fill + local.get $0 + local.set $2 + local.get $0 local.get $1 - local.set $0 - local.get $1 - local.get $2 i32.load local.tee $4 i32.ne if - local.get $0 + local.get $2 call $~lib/rt/pure/__retain - local.set $0 + local.set $2 local.get $4 call $~lib/rt/pure/__release end + local.get $1 local.get $2 - local.get $0 i32.store - local.get $2 local.get $1 + local.get $0 i32.store offset=4 - local.get $2 + local.get $1 i32.const 12 i32.store offset=8 - local.get $2 + local.get $1 i32.const 3 i32.store offset=12 - local.get $2 + local.get $1 call $~lib/array/Array#push - local.get $2 + local.get $1 call $~lib/array/Array#push - local.get $2 + local.get $1 i32.load offset=12 - local.tee $1 + local.tee $0 i32.const 1 i32.lt_s if @@ -1825,21 +1825,21 @@ call $~lib/builtins/abort unreachable end - local.get $2 - i32.load offset=4 local.get $1 + i32.load offset=4 + local.get $0 i32.const 1 i32.sub - local.tee $1 + local.tee $0 i32.const 2 i32.shl i32.add i32.load drop - local.get $2 local.get $1 + local.get $0 i32.store offset=12 - local.get $2 + local.get $1 call $~lib/rt/pure/__release call $~lib/rt/tlsf/maybeInitialize i32.const 16 @@ -1848,16 +1848,16 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $2 + local.tee $1 i32.const 0 i32.store - local.get $2 + local.get $1 i32.const 0 i32.store offset=4 - local.get $2 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $1 i32.const 0 i32.store offset=12 call $~lib/rt/tlsf/maybeInitialize @@ -1866,36 +1866,36 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.tee $1 + local.tee $0 i32.const 0 call $~lib/memory/memory.fill + local.get $0 + local.set $2 + local.get $0 local.get $1 - local.set $0 - local.get $1 - local.get $2 i32.load local.tee $4 i32.ne if - local.get $0 + local.get $2 call $~lib/rt/pure/__retain - local.set $0 + local.set $2 local.get $4 call $~lib/rt/pure/__release end + local.get $1 local.get $2 - local.get $0 i32.store - local.get $2 local.get $1 + local.get $0 i32.store offset=4 - local.get $2 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $1 i32.const 0 i32.store offset=12 - local.get $2 + local.get $1 loop $for-loop|0 local.get $3 i32.const 10 @@ -1908,16 +1908,16 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $2 + local.tee $1 i32.const 0 i32.store - local.get $2 + local.get $1 i32.const 0 i32.store offset=4 - local.get $2 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $1 i32.const 0 i32.store offset=12 call $~lib/rt/tlsf/maybeInitialize @@ -1926,51 +1926,53 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.tee $1 + local.tee $0 i32.const 0 call $~lib/memory/memory.fill + local.get $0 + local.set $2 + local.get $0 local.get $1 - local.set $0 - local.get $1 - local.get $2 i32.load local.tee $5 i32.ne if - local.get $0 + local.get $2 call $~lib/rt/pure/__retain - local.set $0 + local.set $2 local.get $5 call $~lib/rt/pure/__release end + local.get $1 local.get $2 - local.get $0 i32.store - local.get $2 local.get $1 + local.get $0 i32.store offset=4 - local.get $2 + local.get $1 i32.const 0 i32.store offset=8 - local.get $2 + local.get $1 i32.const 0 i32.store offset=12 - i32.const 0 + local.get $1 local.set $0 + i32.const 0 + local.set $1 loop $for-loop|1 - local.get $0 + local.get $1 i32.const 10 i32.lt_s if - local.get $2 - local.get $2 + local.get $0 + local.get $0 i32.load offset=12 local.tee $5 i32.const 1 i32.add - local.tee $1 + local.tee $2 call $~lib/array/ensureSize - local.get $2 + local.get $0 i32.load offset=4 local.get $5 i32.const 2 @@ -1979,19 +1981,19 @@ i32.const 1344 call $~lib/rt/pure/__retain i32.store + local.get $0 local.get $2 - local.get $1 i32.store offset=12 i32.const 1344 call $~lib/rt/pure/__release - local.get $0 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $for-loop|1 end end - local.get $2 + local.get $0 call $~lib/rt/pure/__release local.get $3 i32.const 1 @@ -2004,14 +2006,14 @@ i32.const 1360 i32.const 1392 call $~lib/string/String.__concat - local.tee $3 + local.tee $1 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $0 i32.const 1456 call $~lib/string/String.__concat - local.get $3 + local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.get $0 call $~lib/rt/pure/__release call $~lib/rt/pure/__release call $~lib/rt/tlsf/maybeInitialize @@ -2021,7 +2023,7 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.const 0 i32.store call $~lib/rt/tlsf/maybeInitialize @@ -2031,31 +2033,30 @@ i32.const 16 i32.add call $~lib/rt/pure/__retain - local.tee $2 + local.tee $0 i32.const 0 i32.store + local.get $0 + local.tee $1 local.get $2 - local.set $0 - local.get $2 - local.get $1 i32.load local.tee $3 i32.ne if - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $0 + local.set $1 local.get $3 call $~lib/rt/pure/__release end + local.get $2 local.get $1 - local.get $0 i32.store - local.get $1 - local.set $0 + local.get $0 + local.set $3 + local.get $0 local.get $2 - local.tee $3 - local.get $1 + local.tee $1 i32.load local.tee $4 i32.ne @@ -2066,79 +2067,77 @@ local.get $4 call $~lib/rt/pure/__release end - local.get $0 + local.get $1 local.get $3 i32.store - local.get $0 - local.set $3 - local.get $1 local.get $2 + local.get $0 i32.load - local.tee $0 + local.tee $3 i32.ne if - local.get $3 + local.get $1 call $~lib/rt/pure/__retain - local.set $3 - local.get $0 + local.set $1 + local.get $3 call $~lib/rt/pure/__release end - local.get $2 - local.get $3 - i32.store + local.get $0 local.get $1 - local.tee $3 + i32.store local.get $2 + local.tee $1 + local.get $0 i32.load - local.tee $0 + local.tee $3 i32.ne if - local.get $3 + local.get $1 call $~lib/rt/pure/__retain - local.set $3 - local.get $0 + local.set $1 + local.get $3 call $~lib/rt/pure/__release end - local.get $2 - local.get $3 + local.get $0 + local.get $1 i32.store + local.get $0 + local.tee $1 local.get $2 - local.set $0 - local.get $2 - local.get $1 i32.load local.tee $3 i32.ne if - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $0 + local.set $1 local.get $3 call $~lib/rt/pure/__release end + local.get $2 local.get $1 - local.get $0 i32.store - local.get $1 - local.tee $3 local.get $2 + local.set $3 + local.get $2 + local.get $0 i32.load - local.tee $0 + local.tee $1 i32.ne if local.get $3 call $~lib/rt/pure/__retain local.set $3 - local.get $0 + local.get $1 call $~lib/rt/pure/__release end - local.get $2 + local.get $0 local.get $3 i32.store - local.get $1 - call $~lib/rt/pure/__release local.get $2 call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/pure/__release call $~lib/rt/pure/__collect ) (func $~start diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 671182a165..ec202c1064 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -19466,12 +19466,10 @@ local.get $0 i32.load offset=4 local.set $5 + local.get $3 local.get $0 i32.load offset=12 local.tee $4 - local.set $6 - local.get $3 - local.get $4 local.get $3 local.get $4 i32.lt_s @@ -19494,7 +19492,7 @@ local.get $1 local.get $4 local.get $1 - local.get $6 + local.get $4 i32.lt_s select end diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index f10975ce95..9adbb76781 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1359,51 +1359,51 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $6 + local.set $7 local.get $3 local.set $2 loop $while-continue|0 - local.get $6 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $8 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $4 i32.load8_s i32.store8 local.get $2 - local.get $8 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $4 + local.get $5 local.get $1 - local.get $8 + local.get $4 i32.load8_s i32.const -2128831035 i32.xor @@ -1413,10 +1413,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=8 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -1424,28 +1424,28 @@ i32.add local.set $2 end - local.get $8 + local.get $4 i32.const 12 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $8 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $8 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -1454,26 +1454,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -2356,51 +2356,51 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $6 + local.set $7 local.get $3 local.set $2 loop $while-continue|0 - local.get $6 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $8 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $4 i32.load8_s i32.store8 local.get $2 - local.get $8 + local.get $4 i32.load8_s offset=1 i32.store8 offset=1 local.get $2 - local.get $4 + local.get $5 local.get $1 - local.get $8 + local.get $4 i32.load8_s i32.const -2128831035 i32.xor @@ -2410,10 +2410,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=4 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -2421,28 +2421,28 @@ i32.add local.set $2 end - local.get $8 + local.get $4 i32.const 8 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $8 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $8 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -2451,26 +2451,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -2702,20 +2702,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 @@ -2725,29 +2725,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 i32.load i32.store local.get $2 - local.get $5 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $4 local.get $5 + local.get $4 i32.load call $~lib/util/hash/hash32 local.get $1 @@ -2755,10 +2753,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=8 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -2766,28 +2764,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 12 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -2796,26 +2794,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -3615,51 +3613,51 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 i32.mul i32.add - local.set $6 + local.set $7 local.get $3 local.set $2 loop $while-continue|0 - local.get $6 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $8 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $4 i32.load8_u i32.store8 local.get $2 - local.get $8 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $4 + local.get $5 local.get $1 - local.get $8 + local.get $4 i32.load8_u i32.const -2128831035 i32.xor @@ -3669,10 +3667,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=8 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -3680,28 +3678,28 @@ i32.add local.set $2 end - local.get $8 + local.get $4 i32.const 12 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $8 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $8 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -3710,26 +3708,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -3947,51 +3945,51 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $6 + local.set $7 local.get $3 local.set $2 loop $while-continue|0 - local.get $6 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $8 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $4 i32.load8_u i32.store8 local.get $2 - local.get $8 + local.get $4 i32.load8_u offset=1 i32.store8 offset=1 local.get $2 - local.get $4 + local.get $5 local.get $1 - local.get $8 + local.get $4 i32.load8_u i32.const -2128831035 i32.xor @@ -4001,10 +3999,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=4 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -4012,28 +4010,28 @@ i32.add local.set $2 end - local.get $8 + local.get $4 i32.const 8 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $8 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $8 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -4042,26 +4040,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -4904,20 +4902,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 @@ -4927,29 +4925,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 i32.load16_s i32.store16 local.get $2 - local.get $5 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $4 local.get $5 + local.get $4 i32.load16_s call $~lib/util/hash/hash16 local.get $1 @@ -4957,10 +4953,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=8 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -4968,28 +4964,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 12 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -4998,26 +4994,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -5285,20 +5281,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 @@ -5308,29 +5304,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 i32.load16_s i32.store16 local.get $2 - local.get $5 + local.get $4 i32.load16_s offset=2 i32.store16 offset=2 local.get $2 - local.get $4 local.get $5 + local.get $4 i32.load16_s call $~lib/util/hash/hash16 local.get $1 @@ -5338,10 +5332,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=4 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -5349,28 +5343,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 8 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -5379,26 +5373,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -6202,20 +6196,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 @@ -6225,29 +6219,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 i32.load16_u i32.store16 local.get $2 - local.get $5 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $4 local.get $5 + local.get $4 i32.load16_u call $~lib/util/hash/hash16 local.get $1 @@ -6255,10 +6247,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=8 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -6266,28 +6258,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 12 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -6296,26 +6288,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -6529,20 +6521,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 @@ -6552,29 +6544,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 i32.load16_u i32.store16 local.get $2 - local.get $5 + local.get $4 i32.load16_u offset=2 i32.store16 offset=2 local.get $2 - local.get $4 local.get $5 + local.get $4 i32.load16_u call $~lib/util/hash/hash16 local.get $1 @@ -6582,10 +6572,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=4 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -6593,28 +6583,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 8 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -6623,26 +6613,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -8662,20 +8652,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 4 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 4 @@ -8685,29 +8675,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=12 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 i64.load i64.store local.get $2 - local.get $5 + local.get $4 i32.load offset=8 i32.store offset=8 local.get $2 - local.get $4 local.get $5 + local.get $4 i64.load call $~lib/util/hash/hash64 local.get $1 @@ -8715,10 +8703,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=12 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -8726,28 +8714,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 16 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -8756,26 +8744,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -9108,20 +9096,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 24 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 24 @@ -9131,29 +9119,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=16 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 i64.load i64.store local.get $2 - local.get $5 + local.get $4 i64.load offset=8 i64.store offset=8 local.get $2 - local.get $4 local.get $5 + local.get $4 i64.load call $~lib/util/hash/hash64 local.get $1 @@ -9161,10 +9147,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=16 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -9172,28 +9158,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 24 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -9202,26 +9188,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -10634,20 +10620,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 @@ -10657,29 +10643,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 f32.load f32.store local.get $2 - local.get $5 + local.get $4 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $4 local.get $5 + local.get $4 f32.load i32.reinterpret_f32 call $~lib/util/hash/hash32 @@ -10688,10 +10672,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=8 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -10699,28 +10683,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 12 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -10729,26 +10713,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -11046,20 +11030,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 12 @@ -11069,29 +11053,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 f32.load f32.store local.get $2 - local.get $5 + local.get $4 f32.load offset=4 f32.store offset=4 local.get $2 - local.get $4 local.get $5 + local.get $4 f32.load i32.reinterpret_f32 call $~lib/util/hash/hash32 @@ -11100,10 +11082,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=8 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -11111,28 +11093,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 12 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -11141,26 +11123,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -11883,20 +11865,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 4 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 4 @@ -11906,29 +11888,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=12 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 f64.load f64.store local.get $2 - local.get $5 + local.get $4 i32.load offset=8 i32.store offset=8 local.get $2 - local.get $4 local.get $5 + local.get $4 f64.load i64.reinterpret_f64 call $~lib/util/hash/hash64 @@ -11937,10 +11917,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=12 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -11948,28 +11928,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 16 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -11978,26 +11958,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -12295,20 +12275,20 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $8 + local.tee $6 i32.const 24 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $6 + local.tee $4 local.get $0 i32.load offset=16 i32.const 24 @@ -12318,29 +12298,27 @@ local.get $3 local.set $2 loop $while-continue|0 - local.get $6 + local.get $4 local.get $7 i32.ne if - local.get $6 - local.set $5 - local.get $6 + local.get $4 i32.load offset=16 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $5 + local.get $4 f64.load f64.store local.get $2 - local.get $5 + local.get $4 f64.load offset=8 f64.store offset=8 local.get $2 - local.get $4 local.get $5 + local.get $4 f64.load i64.reinterpret_f64 call $~lib/util/hash/hash64 @@ -12349,10 +12327,10 @@ i32.const 2 i32.shl i32.add - local.tee $5 + local.tee $8 i32.load i32.store offset=16 - local.get $5 + local.get $8 local.get $2 i32.store local.get $2 @@ -12360,28 +12338,28 @@ i32.add local.set $2 end - local.get $6 + local.get $4 i32.const 24 i32.add - local.set $6 + local.set $4 br $while-continue|0 end end - local.get $4 - local.tee $2 + local.get $5 + local.tee $4 local.get $0 i32.load - local.tee $6 + local.tee $2 i32.ne if - local.get $2 + local.get $4 call $~lib/rt/pure/__retain - local.set $2 - local.get $6 + local.set $4 + local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $2 + local.get $4 i32.store local.get $0 local.get $1 @@ -12390,26 +12368,26 @@ local.tee $1 local.get $0 i32.load offset=8 - local.tee $2 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $2 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $8 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 204d31447a..a4fdf778e8 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -1734,23 +1734,22 @@ end ) (func $~lib/math/NativeMathf.asin (param $0 f32) (result f32) - (local $1 f32) - (local $2 i32) + (local $1 i32) + (local $2 f32) (local $3 f64) local.get $0 - local.tee $1 i32.reinterpret_f32 i32.const 2147483647 i32.and - local.tee $2 + local.tee $1 i32.const 1065353216 i32.ge_u if - local.get $2 + local.get $1 i32.const 1065353216 i32.eq if - local.get $1 + local.get $0 f32.const 1.5707963705062866 f32.mul f32.const 7.52316384526264e-37 @@ -1758,32 +1757,32 @@ return end f32.const 0 - local.get $1 - local.get $1 + local.get $0 + local.get $0 f32.sub f32.div return end - local.get $2 + local.get $1 i32.const 1056964608 i32.lt_u if - local.get $2 + local.get $1 i32.const 8388608 i32.ge_u i32.const 0 - local.get $2 + local.get $1 i32.const 964689920 i32.lt_u select if - local.get $1 + local.get $0 return end - local.get $1 - local.get $1 - local.get $1 - local.get $1 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f32.mul call $~lib/math/Rf f32.mul @@ -1792,17 +1791,17 @@ end f64.const 1.5707963705062866 f32.const 0.5 - local.get $1 + local.get $0 f32.abs f32.const 0.5 f32.mul f32.sub - local.tee $0 + local.tee $2 f64.promote_f32 f64.sqrt local.tee $3 local.get $3 - local.get $0 + local.get $2 call $~lib/math/Rf f64.promote_f32 f64.mul @@ -1811,7 +1810,7 @@ f64.mul f64.sub f32.demote_f64 - local.get $1 + local.get $0 f32.copysign ) (func $std/math/test_asinh (param $0 f64) (param $1 f64) (param $2 f64) (result i32) @@ -2739,6 +2738,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) i32.const 1 local.get $0 local.get $0 @@ -2753,12 +2753,9 @@ f32.add return end - local.get $0 - i32.reinterpret_f32 - local.set $3 local.get $1 i32.reinterpret_f32 - local.tee $4 + local.tee $3 i32.const 1065353216 i32.eq if @@ -2766,21 +2763,23 @@ call $~lib/math/NativeMathf.atan return end - local.get $4 + local.get $3 i32.const 30 i32.shr_u i32.const 2 i32.and - local.get $3 + local.get $0 + i32.reinterpret_f32 + local.tee $5 i32.const 31 i32.shr_u i32.or local.set $2 - local.get $4 + local.get $3 i32.const 2147483647 i32.and local.set $4 - local.get $3 + local.get $5 i32.const 2147483647 i32.and local.tee $3 @@ -8544,41 +8543,39 @@ (func $~lib/math/NativeMathf.rem (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) - (local $4 f32) + (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i32) + (local $8 f32) local.get $1 i32.reinterpret_f32 - local.tee $6 + local.tee $4 i32.const 23 i32.shr_u i32.const 255 i32.and - local.set $8 + local.set $5 local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 31 i32.shr_u - local.set $5 + local.set $7 i32.const 1 local.get $1 local.get $1 f32.ne - local.get $3 - local.tee $2 + local.get $2 i32.const 23 i32.shr_u i32.const 255 i32.and - local.tee $9 + local.tee $3 i32.const 255 i32.eq i32.const 1 - local.get $6 + local.get $4 i32.const 1 i32.shl select @@ -8600,7 +8597,7 @@ local.get $0 return end - local.get $9 + local.get $3 if (result i32) local.get $2 i32.const 8388607 @@ -8610,45 +8607,45 @@ else local.get $2 i32.const 1 - local.get $9 + local.get $3 local.get $2 i32.const 9 i32.shl i32.clz i32.sub - local.tee $9 + local.tee $3 i32.sub i32.shl end local.set $2 - local.get $8 + local.get $5 if (result i32) - local.get $6 + local.get $4 i32.const 8388607 i32.and i32.const 8388608 i32.or else - local.get $6 + local.get $4 i32.const 1 - local.get $8 - local.get $6 + local.get $5 + local.get $4 i32.const 9 i32.shl i32.clz i32.sub - local.tee $8 + local.tee $5 i32.sub i32.shl end - local.set $3 + local.set $4 block $do-break|0 - local.get $9 - local.get $8 + local.get $3 + local.get $5 i32.lt_s if - local.get $8 - local.get $9 + local.get $5 + local.get $3 i32.const 1 i32.add i32.eq @@ -8657,20 +8654,20 @@ return end loop $while-continue|1 - local.get $9 - local.get $8 + local.get $3 + local.get $5 i32.gt_s if local.get $2 - local.get $3 + local.get $4 i32.ge_u if (result i32) - local.get $7 + local.get $6 i32.const 1 i32.add - local.set $7 + local.set $6 local.get $2 - local.get $3 + local.get $4 i32.sub else local.get $2 @@ -8678,52 +8675,52 @@ i32.const 1 i32.shl local.set $2 - local.get $7 + local.get $6 i32.const 1 i32.shl - local.set $7 - local.get $9 + local.set $6 + local.get $3 i32.const 1 i32.sub - local.set $9 + local.set $3 br $while-continue|1 end end local.get $2 - local.get $3 + local.get $4 i32.ge_u if - local.get $7 + local.get $6 i32.const 1 i32.add - local.set $7 + local.set $6 local.get $2 - local.get $3 + local.get $4 i32.sub local.set $2 end local.get $2 if - local.get $9 + local.get $3 local.get $2 i32.const 8 i32.shl i32.clz - local.tee $3 + local.tee $4 i32.sub - local.set $9 + local.set $3 local.get $2 - local.get $3 + local.get $4 i32.shl local.set $2 else i32.const -30 - local.set $9 + local.set $3 end end i32.const 1 i32.const 1 - local.get $7 + local.get $6 i32.const 1 i32.and i32.const 0 @@ -8733,16 +8730,16 @@ local.get $2 i32.const 8388608 i32.sub - local.get $9 + local.get $3 i32.const 23 i32.shl i32.or local.get $2 i32.const 1 - local.get $9 + local.get $3 i32.sub i32.shr_u - local.get $9 + local.get $3 i32.const 0 i32.gt_s select @@ -8750,22 +8747,22 @@ local.tee $0 local.get $0 f32.add - local.tee $4 + local.tee $8 f32.eq select - local.get $4 + local.get $8 local.get $1 f32.gt select i32.const 0 - local.get $8 - local.get $9 + local.get $5 + local.get $3 i32.const 1 i32.add i32.eq select - local.get $8 - local.get $9 + local.get $3 + local.get $5 i32.eq select if @@ -8777,7 +8774,7 @@ local.get $0 f32.neg local.get $0 - local.get $5 + local.get $7 select ) (func $~lib/math/NativeMath.sin (param $0 f64) (result f64) @@ -10628,19 +10625,19 @@ local.tee $4 local.get $4 f64.mul - local.tee $2 + local.tee $0 local.get $4 f64.mul - local.set $0 + local.set $2 local.get $4 - local.get $2 + local.get $0 global.get $~lib/math/rempio2_y1 local.tee $1 f64.const 0.5 f64.mul - local.get $0 - local.get $2 local.get $2 + local.get $0 + local.get $0 f64.const 2.7557313707070068e-06 f64.mul f64.const -1.984126982985795e-04 @@ -10648,13 +10645,13 @@ f64.mul f64.const 0.00833333333332249 f64.add - local.get $2 - local.get $2 - local.get $2 + local.get $0 + local.get $0 + local.get $0 f64.mul local.tee $7 f64.mul - local.get $2 + local.get $0 f64.const 1.58969099521155e-10 f64.mul f64.const -2.5050760253406863e-08 @@ -10666,15 +10663,15 @@ f64.mul local.get $1 f64.sub - local.get $0 + local.get $2 f64.const -0.16666666666666632 f64.mul f64.sub f64.sub local.tee $8 - local.set $0 + local.set $2 f64.const 1 - local.get $2 + local.get $0 f64.const 0.5 f64.mul local.tee $9 @@ -10685,10 +10682,10 @@ f64.sub local.get $9 f64.sub - local.get $2 - local.get $2 - local.get $2 - local.get $2 + local.get $0 + local.get $0 + local.get $0 + local.get $0 f64.const 2.480158728947673e-05 f64.mul f64.const -0.001388888888887411 @@ -10700,8 +10697,8 @@ local.get $7 local.get $7 f64.mul - local.get $2 - local.get $2 + local.get $0 + local.get $0 f64.const -1.1359647557788195e-11 f64.mul f64.const 2.087572321298175e-09 @@ -10718,32 +10715,31 @@ f64.sub f64.add f64.add - local.tee $2 - local.set $4 + local.set $0 local.get $6 i32.const 1 i32.and if + local.get $0 + local.set $2 local.get $8 f64.neg - local.set $4 - local.get $2 local.set $0 end local.get $6 i32.const 2 i32.and - if (result f64) - local.get $4 + if + local.get $2 f64.neg - local.set $4 + local.set $2 local.get $0 f64.neg - else - local.get $0 + local.set $0 end + local.get $2 global.set $~lib/math/NativeMath.sincos_sin - local.get $4 + local.get $0 global.set $~lib/math/NativeMath.sincos_cos ) (func $std/math/test_sincos (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 824e3ffba0..6b8e4d3669 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -3464,51 +3464,50 @@ local.get $1 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $5 + local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $3 local.get $0 i32.load offset=8 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 - local.get $4 + local.set $7 + local.get $3 local.set $2 loop $while-continue|0 - local.get $5 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $5 - local.tee $3 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $3 + local.get $4 i32.load16_s i32.store16 local.get $2 - local.get $6 - local.get $3 + local.get $5 + local.get $4 i32.load16_s call $~lib/util/hash/hash16 local.get $1 @@ -3516,10 +3515,10 @@ i32.const 2 i32.shl i32.add - local.tee $3 + local.tee $8 i32.load i32.store offset=4 - local.get $3 + local.get $8 local.get $2 i32.store local.get $2 @@ -3527,58 +3526,58 @@ i32.add local.set $2 end - local.get $5 + local.get $4 i32.const 8 i32.add - local.set $5 + local.set $4 br $while-continue|0 end end - local.get $6 - local.tee $3 + local.get $5 + local.tee $4 local.get $0 i32.load local.tee $2 i32.ne if - local.get $3 + local.get $4 call $~lib/rt/pure/__retain - local.set $3 + local.set $4 local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $3 + local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 - local.get $4 + local.get $3 local.tee $1 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $3 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $6 + local.get $5 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) @@ -4293,51 +4292,50 @@ local.get $1 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $5 + local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $3 local.get $0 i32.load offset=8 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 - local.get $4 + local.set $7 + local.get $3 local.set $2 loop $while-continue|0 - local.get $5 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $5 - local.tee $3 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $3 + local.get $4 i32.load16_u i32.store16 local.get $2 - local.get $6 - local.get $3 + local.get $5 + local.get $4 i32.load16_u call $~lib/util/hash/hash16 local.get $1 @@ -4345,10 +4343,10 @@ i32.const 2 i32.shl i32.add - local.tee $3 + local.tee $8 i32.load i32.store offset=4 - local.get $3 + local.get $8 local.get $2 i32.store local.get $2 @@ -4356,58 +4354,58 @@ i32.add local.set $2 end - local.get $5 + local.get $4 i32.const 8 i32.add - local.set $5 + local.set $4 br $while-continue|0 end end - local.get $6 - local.tee $3 + local.get $5 + local.tee $4 local.get $0 i32.load local.tee $2 i32.ne if - local.get $3 + local.get $4 call $~lib/rt/pure/__retain - local.set $3 + local.set $4 local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $3 + local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 - local.get $4 + local.get $3 local.tee $1 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $3 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $6 + local.get $5 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) @@ -5130,51 +5128,50 @@ local.get $1 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $5 + local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $3 local.get $0 i32.load offset=8 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 - local.get $4 + local.set $7 + local.get $3 local.set $2 loop $while-continue|0 - local.get $5 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $5 - local.tee $3 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $3 + local.get $4 i32.load i32.store local.get $2 - local.get $6 - local.get $3 + local.get $5 + local.get $4 i32.load call $~lib/util/hash/hash32 local.get $1 @@ -5182,10 +5179,10 @@ i32.const 2 i32.shl i32.add - local.tee $3 + local.tee $8 i32.load i32.store offset=4 - local.get $3 + local.get $8 local.get $2 i32.store local.get $2 @@ -5193,58 +5190,58 @@ i32.add local.set $2 end - local.get $5 + local.get $4 i32.const 8 i32.add - local.set $5 + local.set $4 br $while-continue|0 end end - local.get $6 - local.tee $3 + local.get $5 + local.tee $4 local.get $0 i32.load local.tee $2 i32.ne if - local.get $3 + local.get $4 call $~lib/rt/pure/__retain - local.set $3 + local.set $4 local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $3 + local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 - local.get $4 + local.get $3 local.tee $1 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $3 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $6 + local.get $5 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) @@ -6493,51 +6490,50 @@ local.get $1 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $5 + local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 4 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $3 local.get $0 i32.load offset=8 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add - local.set $8 - local.get $4 + local.set $7 + local.get $3 local.set $2 loop $while-continue|0 - local.get $5 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $5 - local.tee $3 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $3 + local.get $4 i64.load i64.store local.get $2 - local.get $6 - local.get $3 + local.get $5 + local.get $4 i64.load call $~lib/util/hash/hash64 local.get $1 @@ -6545,10 +6541,10 @@ i32.const 2 i32.shl i32.add - local.tee $3 + local.tee $8 i32.load i32.store offset=8 - local.get $3 + local.get $8 local.get $2 i32.store local.get $2 @@ -6556,58 +6552,58 @@ i32.add local.set $2 end - local.get $5 + local.get $4 i32.const 16 i32.add - local.set $5 + local.set $4 br $while-continue|0 end end - local.get $6 - local.tee $3 + local.get $5 + local.tee $4 local.get $0 i32.load local.tee $2 i32.ne if - local.get $3 + local.get $4 call $~lib/rt/pure/__retain - local.set $3 + local.set $4 local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $3 + local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 - local.get $4 + local.get $3 local.tee $1 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $3 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $6 + local.get $5 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) @@ -6618,7 +6614,7 @@ local.get $1 local.get $1 call $~lib/util/hash/hash64 - local.tee $4 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -6656,11 +6652,11 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $3 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $3 + local.get $4 i32.const 4 i32.shl i32.add @@ -6676,7 +6672,7 @@ local.get $2 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -7827,51 +7823,50 @@ local.get $1 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $5 + local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $3 local.get $0 i32.load offset=8 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 - local.get $4 + local.set $7 + local.get $3 local.set $2 loop $while-continue|0 - local.get $5 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $5 - local.tee $3 + local.get $4 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $3 + local.get $4 f32.load f32.store local.get $2 - local.get $6 - local.get $3 + local.get $5 + local.get $4 f32.load i32.reinterpret_f32 call $~lib/util/hash/hash32 @@ -7880,10 +7875,10 @@ i32.const 2 i32.shl i32.add - local.tee $3 + local.tee $8 i32.load i32.store offset=4 - local.get $3 + local.get $8 local.get $2 i32.store local.get $2 @@ -7891,58 +7886,58 @@ i32.add local.set $2 end - local.get $5 + local.get $4 i32.const 8 i32.add - local.set $5 + local.set $4 br $while-continue|0 end end - local.get $6 - local.tee $3 + local.get $5 + local.tee $4 local.get $0 i32.load local.tee $2 i32.ne if - local.get $3 + local.get $4 call $~lib/rt/pure/__retain - local.set $3 + local.set $4 local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $3 + local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 - local.get $4 + local.get $3 local.tee $1 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $3 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $6 + local.get $5 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 f32) (result i32) @@ -7954,7 +7949,7 @@ local.get $1 i32.reinterpret_f32 call $~lib/util/hash/hash32 - local.tee $4 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -7992,11 +7987,11 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $3 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $3 + local.get $4 i32.const 3 i32.shl i32.add @@ -8012,7 +8007,7 @@ local.get $2 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -8668,51 +8663,50 @@ local.get $1 i32.const 1 i32.add - local.tee $4 + local.tee $3 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $4 + local.set $5 + local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $6 i32.const 4 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $3 local.get $0 i32.load offset=8 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=16 i32.const 4 i32.shl i32.add - local.set $8 - local.get $4 + local.set $7 + local.get $3 local.set $2 loop $while-continue|0 - local.get $5 - local.get $8 + local.get $4 + local.get $7 i32.ne if - local.get $5 - local.tee $3 + local.get $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $3 + local.get $4 f64.load f64.store local.get $2 - local.get $6 - local.get $3 + local.get $5 + local.get $4 f64.load i64.reinterpret_f64 call $~lib/util/hash/hash64 @@ -8721,10 +8715,10 @@ i32.const 2 i32.shl i32.add - local.tee $3 + local.tee $8 i32.load i32.store offset=8 - local.get $3 + local.get $8 local.get $2 i32.store local.get $2 @@ -8732,58 +8726,58 @@ i32.add local.set $2 end - local.get $5 + local.get $4 i32.const 16 i32.add - local.set $5 + local.set $4 br $while-continue|0 end end - local.get $6 - local.tee $3 + local.get $5 + local.tee $4 local.get $0 i32.load local.tee $2 i32.ne if - local.get $3 + local.get $4 call $~lib/rt/pure/__retain - local.set $3 + local.set $4 local.get $2 call $~lib/rt/pure/__release end local.get $0 - local.get $3 + local.get $4 i32.store local.get $0 local.get $1 i32.store offset=4 - local.get $4 + local.get $3 local.tee $1 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $4 i32.ne if local.get $1 call $~lib/rt/pure/__retain local.set $1 - local.get $3 + local.get $4 call $~lib/rt/pure/__release end local.get $0 local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $6 + local.get $5 call $~lib/rt/pure/__release - local.get $4 + local.get $3 call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 f64) (result i32) @@ -8795,7 +8789,7 @@ local.get $1 i64.reinterpret_f64 call $~lib/util/hash/hash64 - local.tee $4 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -8833,11 +8827,11 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $3 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $3 + local.get $4 i32.const 4 i32.shl i32.add @@ -8853,7 +8847,7 @@ local.get $2 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index 3fb7d0794f..ed7987951f 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -1848,7 +1848,6 @@ (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) local.get $0 i32.const 16 i32.sub @@ -1997,7 +1996,6 @@ i32.shr_u i32.const 2 i32.shl - local.tee $10 local.tee $4 i32.const 1 i32.shl @@ -2006,19 +2004,19 @@ i32.load16_u local.get $2 i32.sub - local.tee $11 + local.tee $10 i32.eqz br_if $~lib/util/casemap/bsearch|inlined.0 - local.get $11 + local.get $10 i32.const 31 i32.shr_u if - local.get $10 + local.get $4 i32.const 4 i32.add local.set $9 else - local.get $10 + local.get $4 i32.const 4 i32.sub local.set $1 @@ -2368,7 +2366,7 @@ call $~lib/rt/tlsf/allocateBlock i32.const 16 i32.add - local.set $9 + local.set $6 loop $for-loop|0 local.get $4 local.get $8 @@ -2380,9 +2378,7 @@ i32.shl i32.add i32.load16_u - local.tee $3 - local.set $2 - local.get $3 + local.tee $1 i32.const 7 i32.shr_u if @@ -2393,7 +2389,7 @@ i32.sub i32.lt_u i32.const 0 - local.get $3 + local.get $1 i32.const 55295 i32.sub i32.const 1025 @@ -2406,7 +2402,7 @@ i32.shl i32.add i32.load16_u offset=2 - local.tee $5 + local.tee $7 i32.const 56319 i32.sub i32.const 1025 @@ -2416,11 +2412,11 @@ i32.const 1 i32.add local.set $4 - local.get $5 + local.get $7 i32.const 1023 i32.and - local.get $3 - local.tee $2 + local.get $1 + local.tee $3 i32.const 1023 i32.and i32.const 10 @@ -2428,51 +2424,51 @@ i32.or i32.const 65536 i32.add - local.tee $3 + local.tee $1 i32.const 131072 i32.ge_u if - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl i32.add - local.get $2 - local.get $5 + local.get $3 + local.get $7 i32.const 16 i32.shl i32.or i32.store - local.get $10 + local.get $5 i32.const 1 i32.add - local.set $10 + local.set $5 br $for-continue|0 end end end - local.get $3 + local.get $1 i32.const 304 i32.eq if - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl i32.add i32.const 50790505 i32.store - local.get $10 + local.get $5 i32.const 1 i32.add - local.set $10 + local.set $5 else - local.get $3 + local.get $1 i32.const 931 i32.eq if - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl i32.add @@ -2482,64 +2478,62 @@ if (result i32) block $~lib/util/string/isFinalSigma|inlined.0 (result i32) i32.const 0 - local.set $1 + local.set $2 i32.const 0 local.get $4 local.tee $3 i32.const 30 i32.sub - local.tee $2 + local.tee $1 i32.const 0 - local.get $2 + local.get $1 i32.gt_s select - local.set $7 + local.set $9 loop $while-continue|1 local.get $3 - local.get $7 + local.get $9 i32.gt_s if - local.get $3 - local.set $5 i32.const -1 - local.set $3 + local.set $1 block $~lib/util/string/codePointBefore|inlined.0 - local.get $5 + local.get $3 i32.const 0 i32.le_s br_if $~lib/util/string/codePointBefore|inlined.0 local.get $0 - local.get $5 + local.get $3 i32.const 1 i32.sub i32.const 1 i32.shl i32.add i32.load16_u - local.tee $2 + local.tee $7 i32.const 64512 i32.and i32.const 56320 i32.eq - local.get $5 + local.get $3 i32.const 2 i32.sub i32.const 0 i32.ge_s i32.and if - local.get $2 + local.get $7 i32.const 1023 i32.and local.get $0 - local.get $5 + local.get $3 i32.const 2 i32.sub i32.const 1 i32.shl i32.add i32.load16_u - local.tee $6 + local.tee $10 i32.const 1023 i32.and i32.const 10 @@ -2547,8 +2541,8 @@ i32.add i32.const 65536 i32.add - local.set $3 - local.get $6 + local.set $1 + local.get $10 i32.const 64512 i32.and i32.const 55296 @@ -2556,21 +2550,21 @@ br_if $~lib/util/string/codePointBefore|inlined.0 end i32.const 65533 - local.get $2 - local.get $2 + local.get $7 + local.get $7 i32.const 63488 i32.and i32.const 55296 i32.eq select - local.set $3 + local.set $1 end - local.get $3 + local.get $1 i32.const 918000 i32.lt_u if (result i32) i32.const 6658 - local.get $3 + local.get $1 call $~lib/util/string/stagedBinaryLookup else i32.const 0 @@ -2578,12 +2572,12 @@ i32.eqz if i32.const 0 - local.get $3 + local.get $1 i32.const 127370 i32.lt_u if (result i32) i32.const 9666 - local.get $3 + local.get $1 call $~lib/util/string/stagedBinaryLookup else i32.const 0 @@ -2592,10 +2586,10 @@ br_if $~lib/util/string/isFinalSigma|inlined.0 drop i32.const 1 - local.set $1 + local.set $2 end - local.get $5 local.get $3 + local.get $1 i32.const 65536 i32.ge_s i32.const 1 @@ -2606,7 +2600,7 @@ end end i32.const 0 - local.get $1 + local.get $2 i32.eqz br_if $~lib/util/string/isFinalSigma|inlined.0 drop @@ -2616,16 +2610,16 @@ local.tee $3 i32.const 30 i32.add - local.tee $2 + local.tee $1 local.get $8 - local.get $2 + local.get $1 local.get $8 i32.lt_s select - local.set $1 + local.set $2 loop $while-continue|2 local.get $3 - local.get $1 + local.get $2 i32.lt_s if local.get $0 @@ -2634,7 +2628,7 @@ i32.shl i32.add i32.load16_u - local.tee $2 + local.tee $1 i32.const 64512 i32.and i32.const 55296 @@ -2652,40 +2646,40 @@ i32.shl i32.add i32.load16_u offset=2 - local.tee $5 + local.tee $7 i32.const 64512 i32.and i32.const 56320 i32.eq if - local.get $5 - local.get $2 + local.get $7 + local.get $1 i32.const 10 i32.shl i32.add i32.const -56613888 i32.add - local.set $2 + local.set $1 end end - local.get $2 + local.get $1 i32.const 918000 i32.lt_u if (result i32) i32.const 6658 - local.get $2 + local.get $1 call $~lib/util/string/stagedBinaryLookup else i32.const 0 end i32.eqz if - local.get $2 + local.get $1 i32.const 127370 i32.lt_u if (result i32) i32.const 9666 - local.get $2 + local.get $1 call $~lib/util/string/stagedBinaryLookup else i32.const 0 @@ -2694,7 +2688,7 @@ br $~lib/util/string/isFinalSigma|inlined.0 end local.get $3 - local.get $2 + local.get $1 i32.const 65536 i32.ge_u i32.const 1 @@ -2716,23 +2710,23 @@ end i32.store16 else - local.get $3 + local.get $1 i32.const 9398 i32.sub i32.const 25 i32.le_u if - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl i32.add - local.get $3 + local.get $1 i32.const 26 i32.add i32.store16 else - local.get $3 + local.get $1 i32.const 0 call $~lib/util/casemap/casemap i32.const 2097151 @@ -2741,16 +2735,16 @@ i32.const 65536 i32.lt_u if - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl i32.add local.get $3 i32.store16 else - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl i32.add @@ -2771,23 +2765,23 @@ i32.shl i32.or i32.store - local.get $10 + local.get $5 i32.const 1 i32.add - local.set $10 + local.set $5 end end end end end else - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl i32.add - local.get $2 - local.get $2 + local.get $1 + local.get $1 i32.const 65 i32.sub i32.const 26 @@ -2803,15 +2797,15 @@ i32.const 1 i32.add local.set $4 - local.get $10 + local.get $5 i32.const 1 i32.add - local.set $10 + local.set $5 br $for-loop|0 end end - local.get $9 - local.get $10 + local.get $6 + local.get $5 i32.const 1 i32.shl call $~lib/rt/tlsf/__realloc diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index ec19911a23..e586d66483 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -1308,10 +1308,8 @@ ) (func $std/string-encoding/testUTF16Encode (local $0 i32) - (local $1 i32) i32.const 1040 call $~lib/string/String.UTF16.encode - local.tee $1 local.tee $0 i32.const 16 i32.sub @@ -1466,7 +1464,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 call $~lib/rt/pure/__release ) (func $~lib/string/String.UTF16.decodeUnsafe (param $0 i32) (param $1 i32) (result i32) @@ -2099,11 +2097,9 @@ ) (func $std/string-encoding/testUTF8Encode (local $0 i32) - (local $1 i32) i32.const 1040 i32.const 0 call $~lib/string/String.UTF8.encode - local.tee $1 local.tee $0 i32.const 16 i32.sub @@ -2238,16 +2234,14 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 call $~lib/rt/pure/__release ) (func $std/string-encoding/testUTF8EncodeNullTerminated (local $0 i32) - (local $1 i32) i32.const 1040 i32.const 1 call $~lib/string/String.UTF8.encode - local.tee $1 local.tee $0 i32.const 16 i32.sub @@ -2392,7 +2386,7 @@ call $~lib/builtins/abort unreachable end - local.get $1 + local.get $0 call $~lib/rt/pure/__release ) (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index e680d9a6ff..7df53e19ad 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -5740,232 +5740,235 @@ (local $10 i32) local.get $1 call $~lib/rt/pure/__retain - local.set $1 - block $folding-inner1 - block $folding-inner0 - local.get $2 - i32.eqz - br_if $folding-inner0 - local.get $1 - i32.eqz - if - i32.const 1 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.tee $2 - i32.load offset=4 - local.get $0 - call $~lib/rt/pure/__retain - i32.store - br $folding-inner1 - end - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.set $3 - i32.const 2147483647 - local.get $2 - local.get $2 - i32.const 0 - i32.lt_s - select - local.set $6 - local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.tee $2 - local.set $8 - local.get $2 - if - local.get $3 + local.set $4 + block $folding-inner2 + block $folding-inner1 + block $folding-inner0 + local.get $2 + i32.eqz + br_if $folding-inner0 + local.get $4 i32.eqz if i32.const 1 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain - local.tee $0 + local.tee $1 i32.load offset=4 - i32.const 1280 + local.get $0 + call $~lib/rt/pure/__retain i32.store local.get $1 - call $~lib/rt/pure/__release - local.get $0 - return + local.set $0 + br $folding-inner1 end - else - local.get $3 - i32.eqz - br_if $folding-inner0 - local.get $3 - local.get $6 - local.get $3 - local.get $6 + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + local.set $3 + i32.const 2147483647 + local.get $2 + local.get $2 + i32.const 0 i32.lt_s select - local.tee $5 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.tee $3 - i32.load offset=4 - local.set $6 - loop $for-loop|0 - local.get $4 - local.get $5 - i32.lt_s + local.set $2 + local.get $4 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + local.tee $1 + local.set $8 + local.get $1 + if + local.get $3 + i32.eqz if - call $~lib/rt/tlsf/maybeInitialize - i32.const 2 - i32.const 1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - local.tee $2 - local.get $0 - local.get $4 i32.const 1 - i32.shl - i32.add - i32.load16_u - i32.store16 - local.get $6 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $2 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $0 + i32.load offset=4 + i32.const 1280 i32.store + br $folding-inner1 + end + else + local.get $3 + i32.eqz + br_if $folding-inner0 + local.get $3 + local.get $2 + local.get $3 + local.get $2 + i32.lt_s + select + local.tee $2 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.tee $5 + i32.load offset=4 + local.set $3 + loop $for-loop|0 + local.get $6 local.get $2 - call $~lib/rt/pure/__retain - drop - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $for-loop|0 + i32.lt_s + if + call $~lib/rt/tlsf/maybeInitialize + i32.const 2 + i32.const 1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + local.tee $1 + local.get $0 + local.get $6 + i32.const 1 + i32.shl + i32.add + i32.load16_u + i32.store16 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store + local.get $1 + call $~lib/rt/pure/__retain + drop + local.get $6 + i32.const 1 + i32.add + local.set $6 + br $for-loop|0 + end end + local.get $4 + call $~lib/rt/pure/__release + local.get $5 + return end - local.get $1 - call $~lib/rt/pure/__release - local.get $3 - return - end - i32.const 0 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.set $2 - loop $while-continue|1 - local.get $0 - local.get $1 - local.get $5 - call $~lib/string/String#indexOf - local.tee $4 - i32.const -1 - i32.xor - if + i32.const 0 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $1 + loop $while-continue|1 + local.get $0 local.get $4 local.get $5 - i32.sub - local.tee $7 - i32.const 0 - i32.gt_s + call $~lib/string/String#indexOf + local.tee $6 + i32.const -1 + i32.xor if - call $~lib/rt/tlsf/maybeInitialize - local.get $7 - i32.const 1 - i32.shl - local.tee $7 - i32.const 1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - local.tee $9 - local.get $0 + local.get $6 local.get $5 + i32.sub + local.tee $7 + i32.const 0 + i32.gt_s + if + call $~lib/rt/tlsf/maybeInitialize + local.get $7 + i32.const 1 + i32.shl + local.tee $7 + i32.const 1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + local.tee $9 + local.get $0 + local.get $5 + i32.const 1 + i32.shl + i32.add + local.get $7 + call $~lib/memory/memory.copy + local.get $1 + local.get $9 + call $~lib/array/Array<~lib/string/String>#push + else + local.get $1 + i32.const 1280 + call $~lib/array/Array<~lib/string/String>#push + end + local.get $10 i32.const 1 - i32.shl i32.add - local.get $7 - call $~lib/memory/memory.copy + local.tee $10 local.get $2 - local.get $9 - call $~lib/array/Array<~lib/string/String>#push - else - local.get $2 - i32.const 1280 - call $~lib/array/Array<~lib/string/String>#push + i32.eq + br_if $folding-inner2 + local.get $6 + local.get $8 + i32.add + local.set $5 + br $while-continue|1 end - local.get $10 + end + local.get $5 + i32.eqz + if + local.get $1 + local.get $0 + call $~lib/array/Array<~lib/string/String>#push + br $folding-inner2 + end + local.get $3 + local.get $5 + i32.sub + local.tee $2 + i32.const 0 + i32.gt_s + if + call $~lib/rt/tlsf/maybeInitialize + local.get $2 i32.const 1 + i32.shl + local.tee $2 + i32.const 1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 i32.add - local.tee $10 - local.get $6 - i32.eq - br_if $folding-inner1 - local.get $4 - local.get $8 + local.tee $3 + local.get $0 + local.get $5 + i32.const 1 + i32.shl i32.add - local.set $5 - br $while-continue|1 + local.get $2 + call $~lib/memory/memory.copy + local.get $1 + local.get $3 + call $~lib/array/Array<~lib/string/String>#push + else + local.get $1 + i32.const 1280 + call $~lib/array/Array<~lib/string/String>#push end + br $folding-inner2 end - local.get $5 - i32.eqz - if - local.get $2 - local.get $0 - call $~lib/array/Array<~lib/string/String>#push - br $folding-inner1 - end - local.get $3 - local.get $5 - i32.sub - local.tee $3 i32.const 0 - i32.gt_s - if - call $~lib/rt/tlsf/maybeInitialize - local.get $3 - i32.const 1 - i32.shl - local.tee $3 - i32.const 1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - local.tee $4 - local.get $0 - local.get $5 - i32.const 1 - i32.shl - i32.add - local.get $3 - call $~lib/memory/memory.copy - local.get $2 - local.get $4 - call $~lib/array/Array<~lib/string/String>#push - else - local.get $2 - i32.const 1280 - call $~lib/array/Array<~lib/string/String>#push - end - br $folding-inner1 + call $~lib/rt/__allocArray + call $~lib/rt/pure/__retain + local.set $0 end - i32.const 0 - call $~lib/rt/__allocArray - call $~lib/rt/pure/__retain - local.get $1 + local.get $4 call $~lib/rt/pure/__release + local.get $0 return end - local.get $1 + local.get $4 call $~lib/rt/pure/__release - local.get $2 + local.get $1 ) (func $~lib/array/Array<~lib/string/String>#__get (param $0 i32) (param $1 i32) (result i32) local.get $1 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 5f20449512..96eba3ce30 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -536,17 +536,17 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $5 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $2 + local.set $4 + local.get $5 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $8 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor @@ -559,32 +559,31 @@ i32.const 12 i32.mul i32.add - local.set $8 + local.set $7 local.get $3 local.set $2 loop $while-continue|0 local.get $5 - local.get $8 + local.get $7 i32.ne if local.get $5 - local.tee $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $4 + local.get $5 i32.load i32.store local.get $2 - local.get $4 + local.get $5 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $6 local.get $4 + local.get $5 i32.load call $~lib/util/hash/hashStr local.get $1 @@ -592,10 +591,10 @@ i32.const 2 i32.shl i32.add - local.tee $4 + local.tee $6 i32.load i32.store offset=8 - local.get $4 + local.get $6 local.get $2 i32.store local.get $2 @@ -610,14 +609,14 @@ br $while-continue|0 end end - local.get $6 - local.tee $2 + local.get $4 + local.tee $5 local.get $0 i32.load i32.ne drop local.get $0 - local.get $2 + local.get $5 i32.store local.get $0 local.get $1 @@ -632,7 +631,7 @@ local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $8 i32.store offset=12 local.get $0 local.get $0 @@ -809,17 +808,17 @@ local.get $1 i32.const 1 i32.add - local.tee $2 + local.tee $5 i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $6 - local.get $2 + local.set $4 + local.get $5 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $7 + local.tee $8 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor @@ -832,32 +831,31 @@ i32.const 12 i32.mul i32.add - local.set $8 + local.set $7 local.get $3 local.set $2 loop $while-continue|0 local.get $5 - local.get $8 + local.get $7 i32.ne if local.get $5 - local.tee $4 i32.load offset=8 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $4 + local.get $5 i32.load i32.store local.get $2 - local.get $4 + local.get $5 i32.load offset=4 i32.store offset=4 local.get $2 - local.get $6 local.get $4 + local.get $5 i32.load call $~lib/util/hash/hash32 local.get $1 @@ -865,10 +863,10 @@ i32.const 2 i32.shl i32.add - local.tee $4 + local.tee $6 i32.load i32.store offset=8 - local.get $4 + local.get $6 local.get $2 i32.store local.get $2 @@ -883,14 +881,14 @@ br $while-continue|0 end end - local.get $6 - local.tee $2 + local.get $4 + local.tee $5 local.get $0 i32.load i32.ne drop local.get $0 - local.get $2 + local.get $5 i32.store local.get $0 local.get $1 @@ -905,7 +903,7 @@ local.get $1 i32.store offset=8 local.get $0 - local.get $7 + local.get $8 i32.store offset=12 local.get $0 local.get $0