diff --git a/cli/asc.js b/cli/asc.js index 7e0ec6f3..ed0e3bbc 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -70,7 +70,7 @@ exports.sourceMapRoot = "assemblyscript:///"; exports.libraryPrefix = assemblyscript.LIBRARY_PREFIX; /** Default Binaryen optimization level. */ -exports.defaultOptimizeLevel = 2; +exports.defaultOptimizeLevel = 3; /** Default Binaryen shrink level. */ exports.defaultShrinkLevel = 1; diff --git a/cli/asc.json b/cli/asc.json index 485aec57..4f6c1cf9 100644 --- a/cli/asc.json +++ b/cli/asc.json @@ -13,7 +13,7 @@ "description": [ "Optimizes the module. Also has the usual shorthands:", "", - " -O Uses defaults. Equivalent to -O2s", + " -O Uses defaults. Equivalent to -O3s", " -O0 Equivalent to --optimizeLevel 0", " -O1 Equivalent to --optimizeLevel 1", " -O2 Equivalent to --optimizeLevel 2", diff --git a/std/assembly/util/number.ts b/std/assembly/util/number.ts index 5dd57f72..32d98c63 100644 --- a/std/assembly/util/number.ts +++ b/std/assembly/util/number.ts @@ -107,28 +107,19 @@ const FRC_POWERS: u64[] = [ // Count number of decimals for u32 values // In our case input value always non-zero so we can simplify some parts export function decimalCount32(value: u32): u32 { - if (ASC_SHRINK_LEVEL >= 1) { - let l: u32 = 32 - clz(value); // log2 - let t = l * 1233 >>> 12; // log10 - - let power = unchecked(POWERS10[t]); - t -= u32(value < power); - return t + 1; - } else { - if (value < 100000) { - if (value < 100) { - return select(1, 2, value < 10); - } else { - let m = select(4, 5, value < 10000); - return select(3, m, value < 1000); - } + if (value < 100000) { + if (value < 100) { + return select(1, 2, value < 10); } else { - if (value < 10000000) { - return select(6, 7, value < 1000000); - } else { - let m = select(9, 10, value < 1000000000); - return select(8, m, value < 100000000); - } + let m = select(4, 5, value < 10000); + return select(3, m, value < 1000); + } + } else { + if (value < 10000000) { + return select(6, 7, value < 1000000); + } else { + let m = select(9, 10, value < 1000000000); + return select(8, m, value < 100000000); } } } @@ -136,28 +127,19 @@ export function decimalCount32(value: u32): u32 { // Count number of decimals for u64 values // In our case input value always greater than 2^32-1 so we can skip some parts export function decimalCount64(value: u64): u32 { - if (ASC_SHRINK_LEVEL >= 1) { - let l: u32 = 64 - clz(value); // log2 - let t = l * 1233 >>> 12; // log10 - - let power = unchecked(POWERS10[t]); - t -= u32(value < 10000000000 * power); - return t + 1; - } else { - if (value < 1000000000000000) { - if (value < 1000000000000) { - return select(11, 12, value < 100000000000); - } else { - let m = select(14, 15, value < 100000000000000); - return select(13, m, value < 10000000000000); - } + if (value < 1000000000000000) { + if (value < 1000000000000) { + return select(11, 12, value < 100000000000); } else { - if (value < 100000000000000000) { - return select(16, 17, value < 10000000000000000); - } else { - let m = select(19, 20, value < 10000000000000000000); - return select(18, m, value < 1000000000000000000); - } + let m = select(14, 15, value < 100000000000000); + return select(13, m, value < 10000000000000); + } + } else { + if (value < 100000000000000000) { + return select(16, 17, value < 10000000000000000); + } else { + let m = select(19, 20, value < 10000000000000000000); + return select(18, m, value < 1000000000000000000); } } } diff --git a/tests/compiler.js b/tests/compiler.js index 44cb7a46..17d2b6d4 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -217,7 +217,7 @@ tests.forEach(filename => { "--validate", "--measure", "--binaryFile", // -> stdout - "-O3" + "-O" ]; if (asc_flags) Array.prototype.push.apply(cmd, asc_flags); diff --git a/tests/compiler/assert-nonnull.optimized.wat b/tests/compiler/assert-nonnull.optimized.wat index 61495f7c..aad21ac7 100644 --- a/tests/compiler/assert-nonnull.optimized.wat +++ b/tests/compiler/assert-nonnull.optimized.wat @@ -51,7 +51,12 @@ end local.get $0 ) - (func $~lib/array/Array#__get (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#__unchecked_get (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + i32.load + ) + (func $~lib/array/Array#__get (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 0 local.get $0 i32.load offset=12 @@ -79,10 +84,9 @@ unreachable end local.get $0 - i32.load offset=4 - i32.load + call $~lib/array/Array#__unchecked_get ) - (func $assert-nonnull/testArr (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testArr (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -91,7 +95,7 @@ local.get $0 call $~lib/array/Array#__get ) - (func $~lib/array/Array#__get (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#__get (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 0 local.get $0 i32.load offset=8 @@ -107,14 +111,13 @@ unreachable end local.get $0 - i32.load offset=4 - i32.load + call $~lib/array/Array#__unchecked_get ) - (func $assert-nonnull/testElem (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testElem (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 call $~lib/array/Array#__get ) - (func $assert-nonnull/testAll (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testAll (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -130,13 +133,13 @@ end local.get $0 ) - (func $assert-nonnull/testFn (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testFn (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 0 global.set $~lib/argc local.get $0 call_indirect (type $FUNCSIG$i) ) - (func $assert-nonnull/testFn2 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testFn2 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -147,7 +150,7 @@ local.get $0 call_indirect (type $FUNCSIG$i) ) - (func $assert-nonnull/testRet (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testRet (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 0 global.set $~lib/argc @@ -162,14 +165,14 @@ end local.get $1 ) - (func $assert-nonnull/testObjFn (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testObjFn (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 0 global.set $~lib/argc local.get $0 i32.load offset=4 call_indirect (type $FUNCSIG$i) ) - (func $assert-nonnull/testObjRet (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $assert-nonnull/testObjRet (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 0 global.set $~lib/argc @@ -185,7 +188,7 @@ end local.get $1 ) - (func $null (; 14 ;) (type $FUNCSIG$v) + (func $null (; 15 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/binary.optimized.wat b/tests/compiler/binary.optimized.wat index 89a908dd..cfa4016d 100644 --- a/tests/compiler/binary.optimized.wat +++ b/tests/compiler/binary.optimized.wat @@ -14,43 +14,36 @@ (local $1 i32) (local $2 i64) (local $3 i32) - (local $4 i32) local.get $0 i64.reinterpret_f64 local.tee $2 + i64.const 32 + i64.shr_u i32.wrap_i64 local.set $1 i32.const 1 i32.const 0 + i32.const 1 + i32.const 0 + i32.const 1 local.get $2 - i64.const 32 - i64.shr_u i32.wrap_i64 - local.tee $3 + i32.const 0 + i32.ne + i32.const 0 + local.get $1 i32.const 2147483647 i32.and - local.tee $4 + local.tee $3 + i32.const 2146435072 + i32.eq + select + local.get $3 i32.const 2146435072 i32.gt_s - if (result i32) - i32.const 1 - else - local.get $1 - i32.const 0 - i32.ne - i32.const 0 - local.get $4 - i32.const 2146435072 - i32.eq - select - end select - if (result i32) - i32.const 1 - else - i32.const 0 - end - local.tee $1 + select + select if local.get $0 f64.const 1 @@ -205,7 +198,27 @@ local.get $0 f32.mul ) - (func $~lib/math/NativeMath.mod (; 2 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMathf.pow (; 2 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (local $1 i32) + i32.const 1 + i32.const 0 + local.get $0 + i32.reinterpret_f32 + local.tee $1 + i32.const 2147483647 + i32.and + i32.const 2139095040 + i32.gt_s + select + if + local.get $0 + f32.const 1 + f32.add + return + end + local.get $0 + ) + (func $~lib/math/NativeMath.mod (; 3 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 i64) @@ -358,46 +371,40 @@ local.get $0 f64.mul ) - (func $start:binary (; 3 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 f32) - (local $2 i64) - (local $3 f64) - (local $4 i32) + (func $start:binary (; 4 ;) (type $FUNCSIG$v) global.get $binary/i - local.tee $0 i32.const 1 i32.rem_s drop - local.get $0 + global.get $binary/i f64.convert_i32_s call $~lib/math/NativeMath.pow drop global.get $binary/i - local.tee $0 i32.const 1 i32.lt_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.gt_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.le_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.ge_s global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.eq - local.tee $4 global.set $binary/b - local.get $4 + global.get $binary/i + i32.const 1 + i32.eq global.set $binary/b - local.get $0 + global.get $binary/i i32.const 1 i32.add global.set $binary/i @@ -475,39 +482,38 @@ i32.xor global.set $binary/i global.get $binary/I - local.tee $2 i64.const 1 i64.rem_s drop - local.get $2 + global.get $binary/I f64.convert_i64_s call $~lib/math/NativeMath.pow drop global.get $binary/I - local.tee $2 i64.const 1 i64.lt_s global.set $binary/b - local.get $2 + global.get $binary/I i64.const 1 i64.gt_s global.set $binary/b - local.get $2 + global.get $binary/I i64.const 1 i64.le_s global.set $binary/b - local.get $2 + global.get $binary/I i64.const 1 i64.ge_s global.set $binary/b - local.get $2 + global.get $binary/I i64.const 1 i64.eq - local.tee $0 global.set $binary/b - local.get $0 + global.get $binary/I + i64.const 1 + i64.eq global.set $binary/b - local.get $2 + global.get $binary/I i64.const 1 i64.add global.set $binary/I @@ -587,43 +593,34 @@ global.get $binary/f call $~lib/math/NativeMathf.mod drop - block $__inlined_func$~lib/math/NativeMathf.pow - i32.const 1 - i32.const 0 - global.get $binary/f - i32.reinterpret_f32 - i32.const 2147483647 - i32.and - i32.const 2139095040 - i32.gt_s - select - br_if $__inlined_func$~lib/math/NativeMathf.pow - end global.get $binary/f - local.tee $1 + call $~lib/math/NativeMathf.pow + drop + global.get $binary/f f32.const 1 f32.lt global.set $binary/b - local.get $1 + global.get $binary/f f32.const 1 f32.gt global.set $binary/b - local.get $1 + global.get $binary/f f32.const 1 f32.le global.set $binary/b - local.get $1 + global.get $binary/f f32.const 1 f32.ge global.set $binary/b - local.get $1 + global.get $binary/f f32.const 1 f32.eq - local.tee $0 global.set $binary/b - local.get $0 + global.get $binary/f + f32.const 1 + f32.eq global.set $binary/b - local.get $1 + global.get $binary/f f32.const 1 f32.add global.set $binary/f @@ -634,23 +631,8 @@ global.get $binary/f call $~lib/math/NativeMathf.mod global.set $binary/f - i32.const 1 - i32.const 0 global.get $binary/f - local.tee $1 - i32.reinterpret_f32 - i32.const 2147483647 - i32.and - i32.const 2139095040 - i32.gt_s - select - if - local.get $1 - f32.const 1 - f32.add - local.set $1 - end - local.get $1 + call $~lib/math/NativeMathf.pow global.set $binary/f global.get $binary/f f32.const 1 @@ -663,23 +645,8 @@ global.get $binary/f call $~lib/math/NativeMathf.mod global.set $binary/f - i32.const 1 - i32.const 0 global.get $binary/f - local.tee $1 - i32.reinterpret_f32 - i32.const 2147483647 - i32.and - i32.const 2139095040 - i32.gt_s - select - if - local.get $1 - f32.const 1 - f32.add - local.set $1 - end - local.get $1 + call $~lib/math/NativeMathf.pow global.set $binary/f global.get $binary/F call $~lib/math/NativeMath.mod @@ -688,30 +655,30 @@ call $~lib/math/NativeMath.pow drop global.get $binary/F - local.tee $3 f64.const 1 f64.lt global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.gt global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.le global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.ge global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.eq - local.tee $0 global.set $binary/b - local.get $0 + global.get $binary/F + f64.const 1 + f64.eq global.set $binary/b - local.get $3 + global.get $binary/F f64.const 1 f64.add global.set $binary/F @@ -740,10 +707,10 @@ call $~lib/math/NativeMath.pow global.set $binary/F ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 5 ;) (type $FUNCSIG$v) call $start:binary ) - (func $null (; 5 ;) (type $FUNCSIG$v) + (func $null (; 6 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index 49690ff9..d5b505b6 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -1,5 +1,7 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -21,10 +23,34 @@ (export "memory" (memory $0)) (export "test" (func $builtins/test)) (start $start) - (func $start:builtins~anonymous|0 (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/builtins/isNaN (; 1 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/builtins/isFinite (; 2 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + ) + (func $~lib/builtins/isNaN (; 3 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/builtins/isFinite (; 4 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $start:builtins~anonymous|0 (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $start:builtins (; 2 ;) (type $FUNCSIG$v) + (func $start:builtins (; 6 ;) (type $FUNCSIG$v) i32.const 31 global.set $builtins/i i32.const 0 @@ -123,6 +149,70 @@ call $~lib/builtins/abort unreachable end + f32.const 1.25 + call $~lib/builtins/isNaN + if + i32.const 0 + i32.const 24 + i32.const 104 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/builtins/isNaN + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 105 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 1.25 + call $~lib/builtins/isFinite + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 106 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 107 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 108 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 109 + i32.const 0 + call $~lib/builtins/abort + unreachable + end f32.const nan:0x400000 global.set $builtins/f f32.const inf @@ -145,10 +235,76 @@ global.set $builtins/f f32.const 1 global.set $builtins/f - i32.const 0 + f32.const 1.25 + call $~lib/builtins/isNaN global.set $builtins/b + f32.const 1.25 + call $~lib/builtins/isFinite + global.set $builtins/b + f64.const 1.25 + call $~lib/builtins/isNaN + if + i32.const 0 + i32.const 24 + i32.const 140 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN i32.const 1 - global.set $builtins/b + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 141 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1.25 + call $~lib/builtins/isFinite + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 142 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 143 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 144 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 145 + i32.const 0 + call $~lib/builtins/abort + unreachable + end f64.const nan:0x8000000000000 global.set $builtins/F f64.const inf @@ -171,9 +327,11 @@ global.set $builtins/F f64.const 1 global.set $builtins/F - i32.const 0 + f64.const 1.25 + call $~lib/builtins/isNaN global.set $builtins/b - i32.const 1 + f64.const 1.25 + call $~lib/builtins/isFinite global.set $builtins/b i32.const 8 i32.load @@ -374,6 +532,90 @@ i32.const 2 global.get $builtins/fn call_indirect (type $FUNCSIG$vii) + f32.const nan:0x400000 + call $~lib/builtins/isNaN + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 294 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 295 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 296 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 297 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 298 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const inf + call $~lib/builtins/isFinite + if + i32.const 0 + i32.const 24 + i32.const 299 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 0 + call $~lib/builtins/isFinite + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 300 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0 + call $~lib/builtins/isFinite + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 301 + i32.const 0 + call $~lib/builtins/abort + unreachable + end i32.const 8 i32.load8_s drop @@ -443,11 +685,14 @@ i32.const 8 f64.const 1 f64.store + f64.const 1 + call $~lib/builtins/isNaN + drop ) - (func $builtins/test (; 3 ;) (type $FUNCSIG$v) + (func $builtins/test (; 7 ;) (type $FUNCSIG$v) nop ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 8 ;) (type $FUNCSIG$v) call $start:builtins ) ) diff --git a/tests/compiler/call-optional.optimized.wat b/tests/compiler/call-optional.optimized.wat index b045853e..f7c91e70 100644 --- a/tests/compiler/call-optional.optimized.wat +++ b/tests/compiler/call-optional.optimized.wat @@ -11,7 +11,14 @@ (global $call-optional/optIndirect i32 (i32.const 1)) (export "memory" (memory $0)) (start $start) - (func $call-optional/opt|trampoline (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $call-optional/opt (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + local.get $0 + local.get $1 + i32.add + local.get $2 + i32.add + ) + (func $call-optional/opt|trampoline (; 2 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $2of2 block $1of2 block $0of2 @@ -31,37 +38,16 @@ end local.get $0 local.get $1 - i32.add local.get $2 - i32.add + call $call-optional/opt ) - (func $start:call-optional (; 2 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) + (func $start:call-optional (; 3 ;) (type $FUNCSIG$v) i32.const 1 global.set $~lib/argc - block $2of2 - block $1of2 - block $0of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of2 $1of2 $2of2 $outOfRange - end - unreachable - end - i32.const -1 - local.set $0 - end - i32.const -2 - local.set $1 - end - local.get $0 i32.const 3 - i32.add - local.get $1 - i32.add + i32.const 0 + i32.const 0 + call $call-optional/opt|trampoline if i32.const 0 i32.const 24 @@ -72,32 +58,10 @@ end i32.const 2 global.set $~lib/argc - i32.const 4 - local.set $0 - i32.const 0 - local.set $1 - block $2of21 - block $1of22 - block $0of23 - block $outOfRange4 - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $0of23 $1of22 $2of21 $outOfRange4 - end - unreachable - end - i32.const -1 - local.set $0 - end - i32.const -2 - local.set $1 - end - local.get $0 i32.const 3 - i32.add - local.get $1 - i32.add + i32.const 4 + i32.const 0 + call $call-optional/opt|trampoline i32.const 5 i32.ne if @@ -108,6 +72,20 @@ call $~lib/builtins/abort unreachable end + i32.const 3 + i32.const 4 + i32.const 5 + call $call-optional/opt + i32.const 12 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 6 + i32.const 0 + call $~lib/builtins/abort + unreachable + end i32.const 1 global.set $~lib/argc i32.const 3 @@ -158,10 +136,10 @@ unreachable end ) - (func $start (; 3 ;) (type $FUNCSIG$v) + (func $start (; 4 ;) (type $FUNCSIG$v) call $start:call-optional ) - (func $null (; 4 ;) (type $FUNCSIG$v) + (func $null (; 5 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index 81995fb6..c8e6b507 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -42,9 +42,8 @@ i32.add global.set $comma/a global.get $comma/a - local.tee $0 global.set $comma/b - local.get $0 + global.get $comma/a i32.const 2 i32.ne if @@ -75,9 +74,8 @@ i32.add global.set $comma/a global.get $comma/a - local.tee $0 global.set $comma/b - local.get $0 + global.get $comma/a i32.const 1 i32.ne if diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index 04e5c73c..41ec64f5 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -158,7 +158,7 @@ end local.get $0 local.get $1 - i32.sub + call $exports/subOpt ) (func $~lib/setargc (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 diff --git a/tests/compiler/function-expression.optimized.wat b/tests/compiler/function-expression.optimized.wat index d59e56f2..6690a0da 100644 --- a/tests/compiler/function-expression.optimized.wat +++ b/tests/compiler/function-expression.optimized.wat @@ -30,13 +30,21 @@ local.get $1 i32.add ) - (func $start:function-expression~anonymous|4 (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $function-expression/testOmitted (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 2 + global.set $~lib/argc + i32.const 1 + i32.const 2 + local.get $0 + call_indirect (type $FUNCSIG$iii) + ) + (func $start:function-expression~anonymous|4 (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 ) - (func $start:function-expression~anonymous|5 (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:function-expression~anonymous|5 (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) i32.const 42 ) - (func $start:function-expression (; 7 ;) (type $FUNCSIG$v) + (func $start:function-expression (; 8 ;) (type $FUNCSIG$v) i32.const 1 global.set $~lib/argc i32.const 1 @@ -85,11 +93,8 @@ call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - i32.const 1 - i32.const 2 - call $start:function-expression~anonymous|3 + i32.const 5 + call $function-expression/testOmitted i32.const 3 i32.ne if @@ -100,11 +105,8 @@ call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - i32.const 1 - i32.const 2 - call $start:function-expression~anonymous|4 + i32.const 6 + call $function-expression/testOmitted i32.const 1 i32.ne if @@ -115,11 +117,8 @@ call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc - i32.const 1 - i32.const 2 - call $start:function-expression~anonymous|5 + i32.const 7 + call $function-expression/testOmitted i32.const 42 i32.ne if @@ -176,7 +175,7 @@ unreachable end ) - (func $start (; 8 ;) (type $FUNCSIG$v) + (func $start (; 9 ;) (type $FUNCSIG$v) call $start:function-expression ) ) diff --git a/tests/compiler/function-types.optimized.wat b/tests/compiler/function-types.optimized.wat index c0bef0ca..dd5f05c0 100644 --- a/tests/compiler/function-types.optimized.wat +++ b/tests/compiler/function-types.optimized.wat @@ -3,6 +3,7 @@ (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$jjj (func (param i64 i64) (result i64))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) @@ -29,7 +30,15 @@ local.get $1 f64.add ) - (func $start:function-types (; 4 ;) (type $FUNCSIG$v) + (func $function-types/doAddWithFn (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + i32.const 2 + global.set $~lib/argc + local.get $0 + local.get $1 + local.get $2 + call_indirect (type $FUNCSIG$iii) + ) + (func $start:function-types (; 5 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 1 global.set $function-types/i32Adder @@ -83,11 +92,9 @@ unreachable end i32.const 2 - global.set $~lib/argc - i32.const 2 i32.const 3 global.get $function-types/i32Adder - call_indirect (type $FUNCSIG$iii) + call $function-types/doAddWithFn i32.const 5 i32.ne if @@ -113,11 +120,10 @@ call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc i32.const 4 i32.const 5 - call $function-types/makeAdder~anonymous|0 + i32.const 4 + call $function-types/doAddWithFn i32.const 9 i32.ne if @@ -143,12 +149,10 @@ i32.const 1 local.set $0 end - i32.const 2 - global.set $~lib/argc i32.const 1 i32.const 2 local.get $0 - call_indirect (type $FUNCSIG$iii) + call $function-types/doAddWithFn i32.const 3 i32.ne if @@ -159,11 +163,10 @@ call $~lib/builtins/abort unreachable end - i32.const 2 - global.set $~lib/argc i32.const 1 i32.const 2 - call $function-types/makeAdder~anonymous|0 + i32.const 1 + call $function-types/doAddWithFn i32.const 3 i32.ne if @@ -175,10 +178,10 @@ unreachable end ) - (func $start (; 5 ;) (type $FUNCSIG$v) + (func $start (; 6 ;) (type $FUNCSIG$v) call $start:function-types ) - (func $null (; 6 ;) (type $FUNCSIG$v) + (func $null (; 7 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/if.optimized.wat b/tests/compiler/if.optimized.wat index 1bd96e7f..45fe4226 100644 --- a/tests/compiler/if.optimized.wat +++ b/tests/compiler/if.optimized.wat @@ -11,6 +11,7 @@ (export "ifThen" (func $if/ifThen)) (export "ifThenElseBlock" (func $if/ifThenElse)) (export "ifAlwaysReturns" (func $if/ifAlwaysReturns)) + (start $start) (func $if/ifThenElse (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 0 @@ -25,7 +26,75 @@ end i32.const 0 ) - (func $if/ifAlwaysReturns (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $start:if (; 3 ;) (type $FUNCSIG$v) + i32.const 0 + call $if/ifThenElse + if + i32.const 0 + i32.const 24 + i32.const 8 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $if/ifThenElse + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 9 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $if/ifThen + if + i32.const 0 + i32.const 24 + i32.const 17 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $if/ifThen + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 18 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $if/ifThenElse + if + i32.const 0 + i32.const 24 + i32.const 30 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $if/ifThenElse + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 31 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + ) + (func $if/ifAlwaysReturns (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 if (result i32) i32.const 1 @@ -38,7 +107,10 @@ unreachable end ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 5 ;) (type $FUNCSIG$v) + call $start:if + ) + (func $null (; 6 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/mandelbrot.optimized.wat b/tests/compiler/mandelbrot.optimized.wat index cdf7d774..d7074dd0 100644 --- a/tests/compiler/mandelbrot.optimized.wat +++ b/tests/compiler/mandelbrot.optimized.wat @@ -161,8 +161,8 @@ i32.sub local.get $5 i32.add + local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add @@ -170,7 +170,8 @@ f64.sub local.get $3 f64.add - local.get $0 + local.get $1 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add @@ -375,9 +376,9 @@ (func $../../examples/mandelbrot/assembly/index/computeLine (; 2 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 f64) (local $5 f64) - (local $6 f64) + (local $6 i32) (local $7 i32) - (local $8 i32) + (local $8 f64) (local $9 f64) (local $10 f64) (local $11 f64) @@ -385,36 +386,34 @@ (local $13 f64) (local $14 f64) (local $15 f64) - local.get $1 - f64.convert_i32_u - local.tee $9 - f64.const 0.625 - f64.mul - local.set $4 local.get $0 f64.convert_i32_u local.get $2 f64.convert_i32_u - local.tee $6 f64.const 0.5 f64.mul f64.sub f64.const 10 f64.const 3 - local.get $9 + local.get $1 + f64.convert_i32_u f64.mul f64.const 4 - local.get $6 + local.get $2 + f64.convert_i32_u f64.mul f64.min f64.div - local.tee $10 + local.tee $9 f64.mul - local.set $11 - local.get $4 - local.get $10 + local.set $10 + local.get $1 + f64.convert_i32_u + f64.const 0.625 f64.mul - local.set $13 + local.get $9 + f64.mul + local.set $12 local.get $0 local.get $1 i32.mul @@ -424,41 +423,41 @@ f64.const 1 local.get $3 f64.convert_i32_u - local.tee $6 f64.div - local.set $14 + local.set $13 f64.const 8 - local.get $6 + local.get $3 + f64.convert_i32_u f64.min - local.set $15 + local.set $14 loop $repeat|0 block $break|0 - local.get $8 + local.get $7 local.get $1 i32.ge_u br_if $break|0 - local.get $8 + local.get $7 f64.convert_i32_u - local.get $10 + local.get $9 f64.mul - local.get $13 + local.get $12 f64.sub - local.set $12 + local.set $11 f64.const 0 local.set $4 f64.const 0 local.set $5 i32.const 0 - local.set $7 + local.set $6 loop $continue|1 local.get $4 local.get $4 f64.mul - local.tee $9 + local.tee $15 local.get $5 local.get $5 f64.mul - local.tee $6 + local.tee $8 f64.add f64.const 4 f64.le @@ -469,31 +468,31 @@ f64.mul local.get $5 f64.mul - local.get $11 + local.get $10 f64.add local.set $5 - local.get $9 - local.get $6 + local.get $15 + local.get $8 f64.sub - local.get $12 + local.get $11 f64.add local.set $4 - local.get $7 + local.get $6 local.get $3 i32.ge_u br_if $break|1 - local.get $7 + local.get $6 i32.const 1 i32.add - local.set $7 + local.set $6 br $continue|1 end end end loop $continue|2 - local.get $7 + local.get $6 f64.convert_i32_u - local.get $15 + local.get $14 f64.lt if local.get $4 @@ -503,29 +502,29 @@ local.get $5 f64.mul f64.sub - local.get $12 + local.get $11 f64.add - local.set $6 + local.set $8 f64.const 2 local.get $4 f64.mul local.get $5 f64.mul - local.get $11 + local.get $10 f64.add local.set $5 - local.get $6 + local.get $8 local.set $4 - local.get $7 + local.get $6 i32.const 1 i32.add - local.set $7 + local.set $6 br $continue|2 end end i32.const 2047 local.set $2 - local.get $8 + local.get $7 i32.const 1 i32.shl local.get $0 @@ -537,22 +536,22 @@ local.get $5 f64.mul f64.add - local.tee $6 + local.tee $8 f64.const 1 f64.gt if (result i32) f64.const 2047 - local.get $7 + local.get $6 i32.const 1 i32.add f64.convert_i32_u f64.const 0.5 - local.get $6 + local.get $8 call $~lib/math/NativeMath.log f64.mul call $~lib/math/NativeMath.log2 f64.sub - local.get $14 + local.get $13 f64.mul f64.const 0 f64.max @@ -564,10 +563,10 @@ i32.const 2047 end i32.store16 - local.get $8 + local.get $7 i32.const 1 i32.add - local.set $8 + local.set $7 br $repeat|0 end end diff --git a/tests/compiler/many-locals.optimized.wat b/tests/compiler/many-locals.optimized.wat index e95c8949..77221788 100644 --- a/tests/compiler/many-locals.optimized.wat +++ b/tests/compiler/many-locals.optimized.wat @@ -1,22 +1,39 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s") (export "memory" (memory $0)) (export "testI32" (func $many-locals/testI32)) (export "testI8" (func $many-locals/testI8)) - (func $many-locals/testI32 (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (start $start) + (func $many-locals/testI32 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $many-locals/testI8 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $many-locals/testI8 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 24 i32.shl i32.const 24 i32.shr_s ) - (func $start (; 2 ;) (type $FUNCSIG$v) + (func $start (; 3 ;) (type $FUNCSIG$v) + i32.const 42 + call $many-locals/testI8 + i32.const 42 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 267 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + ) + (func $null (; 4 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/memset.optimized.wat b/tests/compiler/memset.optimized.wat index b40c3e01..c5d4ebd3 100644 --- a/tests/compiler/memset.optimized.wat +++ b/tests/compiler/memset.optimized.wat @@ -191,8 +191,8 @@ local.set $2 local.get $1 i64.extend_i32_u - local.tee $4 - local.get $4 + local.get $1 + i64.extend_i32_u i64.const 32 i64.shl i64.or diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index c3df0ebb..f150adcf 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -3,35 +3,36 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$iijijij (func (param i32 i64 i32 i64 i32 i64) (result i32))) + (type $FUNCSIG$i (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000") - (data (i32.const 32) "\90\01\00\00\01\00\00\00\00\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 448) "\10\00\00\00\01\00\00\00\03\00\00\00\10\00\00\000\00\00\000\00\00\00\90\01\00\00d") - (data (i32.const 480) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\001") - (data (i32.const 504) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00n\00u\00m\00b\00e\00r\00.\00t\00s") - (data (i32.const 544) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") - (data (i32.const 568) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") - (data (i32.const 592) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 632) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 664) "\b8\02\00\00\01\00\00\00\00\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - i32.const 468 - i32.load - local.set $3 loop $continue|0 local.get $1 - i32.const 10000 - i32.ge_u - if - local.get $1 - i32.const 10000 - i32.rem_u - local.set $4 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 - end - end - local.get $1 - i32.const 100 - i32.ge_u - if - local.get $1 - i32.const 100 - i32.rem_u - local.set $4 - local.get $1 - i32.const 100 + i32.const 10 i32.div_u - local.set $1 + local.set $3 local.get $2 - i32.const 2 + i32.const 1 i32.sub local.tee $2 i32.const 1 i32.shl local.get $0 i32.add - local.get $4 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - i32.store - end - local.get $1 - i32.const 10 - i32.ge_u - if - local.get $2 - i32.const 2 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - i32.store - else - local.get $2 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add local.get $1 + i32.const 10 + i32.rem_u i32.const 48 i32.add i32.store16 + local.get $3 + local.tee $1 + br_if $continue|0 end ) (func $~lib/util/number/itoa32 (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -312,7 +223,7 @@ local.tee $2 local.get $0 local.get $3 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $2 @@ -321,7 +232,15 @@ end local.get $2 ) - (func $~lib/util/string/compareImpl (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#get:length (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 local.get $2 @@ -354,7 +273,7 @@ end local.get $3 ) - (func $~lib/string/String.__eq (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -371,18 +290,10 @@ select br_if $folding-inner0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $2 local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.ne br_if $folding-inner0 local.get $0 @@ -394,7 +305,19 @@ end i32.const 0 ) - (func $~lib/util/number/genDigits (; 7 ;) (type $FUNCSIG$iijijij) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (result i32) + (func $~lib/builtins/isFinite (; 8 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/builtins/isNaN (; 9 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/util/number/genDigits (; 10 ;) (type $FUNCSIG$iijijij) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (result i32) (local $6 i32) (local $7 i32) (local $8 i64) @@ -416,7 +339,6 @@ i32.sub local.tee $10 i64.extend_i32_s - local.tee $1 i64.shl local.tee $11 i64.const 1 @@ -426,13 +348,14 @@ i64.and local.set $8 local.get $3 - local.get $1 + local.get $10 + i64.extend_i32_s i64.shr_u i32.wrap_i64 local.tee $6 call $~lib/util/number/decimalCount32 local.set $4 - i32.const 1708 + i32.const 1260 i32.load local.set $12 loop $continue|0 @@ -623,10 +546,26 @@ i32.shl local.get $0 i32.add - local.tee $6 + local.tee $0 i32.load16_u local.set $4 loop $continue|2 + i32.const 1 + local.get $9 + local.get $1 + i64.sub + local.get $1 + local.get $3 + i64.add + local.tee $8 + local.get $9 + i64.sub + i64.gt_u + local.get $8 + local.get $9 + i64.lt_u + select + i32.const 0 local.get $5 local.get $1 i64.sub @@ -637,25 +576,7 @@ local.get $9 i64.lt_u select - if (result i32) - i32.const 1 - local.get $9 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.tee $8 - local.get $9 - i64.sub - i64.gt_u - local.get $8 - local.get $9 - i64.lt_u - select - else - i32.const 0 - end + select if local.get $4 i32.const 1 @@ -668,7 +589,7 @@ br $continue|2 end end - local.get $6 + local.get $0 local.get $4 i32.store16 local.get $2 @@ -750,10 +671,26 @@ i32.shl local.get $0 i32.add - local.tee $6 + local.tee $0 i32.load16_u local.set $4 loop $continue|4 + i32.const 1 + local.get $3 + local.get $1 + i64.sub + local.get $1 + local.get $11 + i64.add + local.tee $8 + local.get $3 + i64.sub + i64.gt_u + local.get $8 + local.get $3 + i64.lt_u + select + i32.const 0 local.get $5 local.get $1 i64.sub @@ -764,25 +701,7 @@ local.get $3 i64.lt_u select - if (result i32) - i32.const 1 - local.get $3 - local.get $1 - i64.sub - local.get $1 - local.get $11 - i64.add - local.tee $8 - local.get $3 - i64.sub - i64.gt_u - local.get $8 - local.get $3 - i64.lt_u - select - else - i32.const 0 - end + select if local.get $4 i32.const 1 @@ -795,12 +714,12 @@ br $continue|4 end end - local.get $6 + local.get $0 local.get $4 i32.store16 local.get $2 ) - (func $~lib/memory/memory.copy (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) block $~lib/util/memory/memmove|inlined.0 @@ -973,7 +892,7 @@ end end ) - (func $~lib/util/number/prettify (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 12 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 i32.eqz @@ -1149,7 +1068,7 @@ i32.const 1 i32.add local.tee $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $0 i32.const 45 i32.const 43 @@ -1207,7 +1126,7 @@ i32.const 1 i32.add local.tee $0 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $2 i32.const 45 i32.const 43 @@ -1224,7 +1143,7 @@ end end ) - (func $~lib/util/number/dtoa_core (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/dtoa_core (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i64) (local $2 i64) (local $3 i64) @@ -1263,7 +1182,7 @@ i32.shl i32.sub global.set $~lib/util/number/_K - i32.const 1396 + i32.const 948 i32.load local.get $4 i32.const 3 @@ -1271,7 +1190,7 @@ i32.add i64.load global.set $~lib/util/number/_frc_pow - i32.const 1620 + i32.const 1172 i32.load local.get $4 i32.const 1 @@ -1401,14 +1320,14 @@ global.get $~lib/util/number/_K call $~lib/util/number/prettify ) - (func $~lib/string/String#substring (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#substring (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 i32.eqz if i32.const 0 - i32.const 1736 + i32.const 1288 i32.const 196 i32.const 4 call $~lib/builtins/abort @@ -1416,11 +1335,7 @@ end i32.const 0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $2 i32.const 0 local.get $2 @@ -1460,7 +1375,7 @@ local.tee $2 i32.eqz if - i32.const 1784 + i32.const 1336 return end local.get $3 @@ -1468,11 +1383,7 @@ i32.const 0 else local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl local.get $1 @@ -1492,25 +1403,21 @@ call $~lib/memory/memory.copy local.get $1 ) - (func $start:number (; 12 ;) (type $FUNCSIG$v) + (func $~lib/util/number/dtoa (; 15 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) - i32.const 1968 - global.set $~lib/rt/stub/startOffset - global.get $~lib/rt/stub/startOffset - global.set $~lib/rt/stub/offset - global.get $number/a - call $~lib/util/number/itoa32 - i32.const 496 - call $~lib/string/String.__eq + f64.const 2 + call $~lib/builtins/isFinite i32.eqz if - i32.const 0 - i32.const 520 - i32.const 7 - i32.const 0 - call $~lib/builtins/abort - unreachable + f64.const 2 + call $~lib/builtins/isNaN + if + i32.const 136 + return + end + i32.const 200 + return end i32.const 56 call $~lib/rt/stub/__alloc @@ -1518,20 +1425,96 @@ call $~lib/util/number/dtoa_core local.tee $1 i32.const 28 - i32.ne + i32.eq if local.get $0 - local.get $1 - call $~lib/string/String#substring - local.set $0 + return end local.get $0 - i32.const 1800 + local.get $1 + call $~lib/string/String#substring + ) + (func $~lib/number/Bool#toString (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1472 + i32.const 1496 + local.get $0 + select + ) + (func $~lib/number/F32.isSafeInteger (; 17 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + f32.trunc + local.get $0 + f32.eq + i32.const 0 + local.get $0 + f32.abs + f32.const 16777215 + f32.le + select + ) + (func $~lib/number/F32.isInteger (; 18 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + f32.trunc + local.get $0 + f32.eq + i32.const 0 + local.get $0 + local.get $0 + f32.sub + f32.const 0 + f32.eq + select + ) + (func $~lib/number/F64.isSafeInteger (; 19 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + f64.trunc + local.get $0 + f64.eq + i32.const 0 + local.get $0 + f64.abs + f64.const 9007199254740991 + f64.le + select + ) + (func $~lib/number/F64.isInteger (; 20 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + call $~lib/builtins/isFinite + if (result i32) + local.get $0 + f64.trunc + local.get $0 + f64.eq + else + i32.const 0 + end + ) + (func $start:number (; 21 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 1520 + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + global.get $number/a + call $~lib/util/number/itoa32 + i32.const 48 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 + i32.const 7 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + call $~lib/util/number/dtoa + i32.const 1352 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 72 i32.const 9 i32.const 0 call $~lib/builtins/abort @@ -1539,12 +1522,12 @@ end i32.const 3 call $~lib/util/number/itoa32 - i32.const 1824 + i32.const 1376 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 10 i32.const 0 call $~lib/builtins/abort @@ -1552,12 +1535,12 @@ end i32.const -5 call $~lib/util/number/itoa32 - i32.const 1848 + i32.const 1400 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 12 i32.const 0 call $~lib/builtins/abort @@ -1565,12 +1548,12 @@ end i32.const 4 call $~lib/util/number/itoa32 - i32.const 1872 + i32.const 1424 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 13 i32.const 0 call $~lib/builtins/abort @@ -1582,12 +1565,12 @@ global.set $number/a global.get $number/a call $~lib/util/number/itoa32 - i32.const 1896 + i32.const 1448 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 14 i32.const 0 call $~lib/builtins/abort @@ -1599,36 +1582,38 @@ global.set $number/a global.get $number/a call $~lib/util/number/itoa32 - i32.const 496 + i32.const 48 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 15 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 1920 - i32.const 1920 + i32.const 1 + call $~lib/number/Bool#toString + i32.const 1472 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 16 i32.const 0 call $~lib/builtins/abort unreachable end - i32.const 1944 - i32.const 1944 + i32.const 0 + call $~lib/number/Bool#toString + i32.const 1496 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 17 i32.const 0 call $~lib/builtins/abort @@ -1641,12 +1626,12 @@ global.set $number/a local.get $0 call $~lib/util/number/itoa32 - i32.const 496 + i32.const 48 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 20 i32.const 0 call $~lib/builtins/abort @@ -1659,22 +1644,473 @@ global.set $number/a local.get $0 call $~lib/util/number/itoa32 - i32.const 1896 + i32.const 1448 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 520 + i32.const 72 i32.const 21 i32.const 0 call $~lib/builtins/abort unreachable end + f32.const -16777216 + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 27 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -16777215 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 28 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 0 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 29 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -0 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 30 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 31 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 32 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 16777215 + call $~lib/number/F32.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 33 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 16777216 + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 34 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 0.5 + call $~lib/number/F32.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 35 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 0 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 36 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -0 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 37 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const nan:0x400000 + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 38 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const inf + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 39 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 1.1920928955078125e-07 + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 40 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 1 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 41 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -1 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 42 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -16777215 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 43 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 16777215 + call $~lib/number/F32.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 44 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const 0.5 + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 45 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f32.const -1.5 + call $~lib/number/F32.isInteger + if + i32.const 0 + i32.const 72 + i32.const 46 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/builtins/isNaN + i32.eqz + if + i32.const 0 + i32.const 72 + i32.const 48 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -9007199254740992 + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 50 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -9007199254740991 + call $~lib/number/F64.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 51 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0 + call $~lib/number/F64.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 52 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -0 + call $~lib/number/F64.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 53 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 54 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const inf + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 55 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 9007199254740991 + call $~lib/number/F64.isSafeInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 56 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 9007199254740992 + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 57 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0.5 + call $~lib/number/F64.isSafeInteger + if + i32.const 0 + i32.const 72 + i32.const 58 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 59 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -0 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 60 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const nan:0x8000000000000 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 61 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const inf + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 62 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 2.220446049250313e-16 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 63 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 1 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 64 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -1 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 65 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -9007199254740991 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 66 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 9007199254740991 + call $~lib/number/F64.isInteger + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 72 + i32.const 67 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const 0.5 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 68 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + f64.const -1.5 + call $~lib/number/F64.isInteger + if + i32.const 0 + i32.const 72 + i32.const 69 + i32.const 0 + call $~lib/builtins/abort + unreachable + end ) - (func $start (; 13 ;) (type $FUNCSIG$v) + (func $start (; 22 ;) (type $FUNCSIG$v) call $start:number ) - (func $null (; 14 ;) (type $FUNCSIG$v) + (func $null (; 23 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 18554b95..05623ea5 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -41,9 +41,9 @@ (table $0 1 funcref) (elem (i32.const 0) $null) (global $number/a (mut i32) (i32.const 1)) - (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) (global $~lib/util/number/_exp (mut i32) (i32.const 0)) diff --git a/tests/compiler/reexport.optimized.wat b/tests/compiler/reexport.optimized.wat index 5496139f..b23b502d 100644 --- a/tests/compiler/reexport.optimized.wat +++ b/tests/compiler/reexport.optimized.wat @@ -17,6 +17,7 @@ (export "renamed_add" (func $export/add)) (export "rerenamed_sub" (func $export/mul)) (export "renamed_ns.two" (func $export/ns.one)) + (start $start) (func $export/add (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 @@ -35,4 +36,14 @@ (func $export/ns.one (; 3 ;) (type $FUNCSIG$v) nop ) + (func $start (; 4 ;) (type $FUNCSIG$v) + i32.const 1 + i32.const 2 + call $export/add + i32.const 3 + i32.const 4 + call $export/mul + i32.add + drop + ) ) diff --git a/tests/compiler/retain-release-sanity.optimized.wat b/tests/compiler/retain-release-sanity.optimized.wat index 9404e699..5f9b45f5 100644 --- a/tests/compiler/retain-release-sanity.optimized.wat +++ b/tests/compiler/retain-release-sanity.optimized.wat @@ -2037,44 +2037,42 @@ i32.const 584 call $~lib/rt/pure/__release ) - (func $~lib/string/String#concat (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#get:length (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#concat (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $1 call $~lib/rt/pure/__retain drop - block (result i32) + local.get $1 + i32.eqz + if local.get $1 - i32.eqz - if - local.get $1 - i32.const 648 - call $~lib/rt/pure/__retainRelease - local.set $1 - end - local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $4 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $3 - i32.add - local.tee $2 - i32.eqz + i32.const 648 + call $~lib/rt/pure/__retainRelease + local.set $1 end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $3 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $4 + i32.add + local.tee $2 + i32.eqz if i32.const 584 call $~lib/rt/pure/__retain @@ -2102,7 +2100,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__concat (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2123,7 +2121,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/rt/pure/markGray (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/markGray (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -2147,7 +2145,7 @@ call $~lib/rt/__visit_members end ) - (func $~lib/rt/pure/scanBlack (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scanBlack (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load offset=4 @@ -2160,7 +2158,7 @@ i32.const 4 call $~lib/rt/__visit_members ) - (func $~lib/rt/pure/scan (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scan (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -2194,7 +2192,7 @@ end end ) - (func $~lib/rt/pure/collectWhite (; 38 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/collectWhite (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -2222,7 +2220,7 @@ local.get $0 call $~lib/rt/tlsf/freeBlock ) - (func $~lib/rt/pure/__collect (; 39 ;) (type $FUNCSIG$v) + (func $~lib/rt/pure/__collect (; 40 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -2346,7 +2344,7 @@ local.get $5 global.set $~lib/rt/pure/CUR ) - (func $start:retain-release-sanity (; 40 ;) (type $FUNCSIG$v) + (func $start:retain-release-sanity (; 41 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -2434,7 +2432,7 @@ call $~lib/rt/pure/__release call $~lib/rt/pure/__collect ) - (func $retain-release-sanity/main (; 41 ;) (type $FUNCSIG$v) + (func $retain-release-sanity/main (; 42 ;) (type $FUNCSIG$v) global.get $~lib/started i32.eqz if @@ -2443,7 +2441,7 @@ global.set $~lib/started end ) - (func $~lib/rt/pure/__visit (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i32.const 724 i32.lt_u @@ -2553,7 +2551,7 @@ unreachable end ) - (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2584,7 +2582,7 @@ end end ) - (func $~lib/rt/__visit_members (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $block$4$break block $switch$1$default block $switch$1$case$6 @@ -2613,7 +2611,7 @@ call $~lib/rt/pure/__visit end ) - (func $null (; 45 ;) (type $FUNCSIG$v) + (func $null (; 46 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index e01f682f..256392dd 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -80,17 +80,21 @@ call $~lib/array/Array<~lib/array/Array>#__get call $~lib/array/Array#__get ) - (func $std/array-access/stringArrayPropertyAccess (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/array/Array>#__get i32.const 16 i32.sub i32.load offset=12 i32.const 1 i32.shr_u ) - (func $~lib/util/string/compareImpl (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array-access/stringArrayPropertyAccess (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 0 + call $~lib/array/Array<~lib/array/Array>#__get + call $~lib/string/String#get:length + ) + (func $~lib/util/string/compareImpl (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) i32.const 240 @@ -132,7 +136,7 @@ end local.get $4 ) - (func $~lib/string/String#startsWith (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#startsWith (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -146,25 +150,17 @@ call $~lib/builtins/abort unreachable end - i32.const 236 - i32.load - i32.const 1 - i32.shr_u - local.tee $1 - local.set $2 - local.get $1 i32.const 0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $1 i32.const 0 local.get $1 i32.lt_s select + local.tee $2 + i32.const 240 + call $~lib/string/String#get:length local.tee $3 i32.add local.get $1 @@ -174,30 +170,26 @@ return end local.get $0 - local.get $3 local.get $2 + local.get $3 call $~lib/util/string/compareImpl i32.eqz ) - (func $std/array-access/stringArrayMethodCall (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/stringArrayMethodCall (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 0 call $~lib/array/Array<~lib/array/Array>#__get call $~lib/string/String#startsWith ) - (func $std/array-access/stringArrayArrayPropertyAccess (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/stringArrayArrayPropertyAccess (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 0 call $~lib/array/Array<~lib/array/Array>#__get i32.const 1 call $~lib/array/Array<~lib/array/Array>#__get - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length ) - (func $std/array-access/stringArrayArrayMethodCall (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array-access/stringArrayArrayMethodCall (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 0 call $~lib/array/Array<~lib/array/Array>#__get @@ -205,7 +197,7 @@ call $~lib/array/Array<~lib/array/Array>#__get call $~lib/string/String#startsWith ) - (func $null (; 10 ;) (type $FUNCSIG$v) + (func $null (; 11 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 2c793574..e62301f4 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1660,28 +1660,26 @@ i32.const 0 i32.const 3 call $~lib/rt/__allocArray - local.tee $2 + local.tee $1 i32.load offset=4 local.tee $0 global.get $std/array-literal/i - local.tee $1 i32.store8 - local.get $1 + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 global.get $std/array-literal/i - local.tee $1 i32.store8 offset=1 - local.get $1 + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 global.get $std/array-literal/i i32.store8 offset=2 - local.get $2 + local.get $1 call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayI8 global.get $std/array-literal/dynamicArrayI8 @@ -1738,28 +1736,26 @@ i32.const 2 i32.const 4 call $~lib/rt/__allocArray - local.tee $2 + local.tee $1 i32.load offset=4 local.tee $0 global.get $std/array-literal/i - local.tee $1 i32.store - local.get $1 + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 global.get $std/array-literal/i - local.tee $1 i32.store offset=4 - local.get $1 + global.get $std/array-literal/i i32.const 1 i32.add global.set $std/array-literal/i local.get $0 global.get $std/array-literal/i i32.store offset=8 - local.get $2 + local.get $1 call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayI32 global.get $std/array-literal/dynamicArrayI32 @@ -1814,11 +1810,11 @@ i32.const 2 i32.const 6 call $~lib/rt/__allocArray - local.tee $2 + local.tee $1 i32.load offset=4 local.tee $0 call $std/array-literal/Ref#constructor - local.tee $1 + local.tee $2 call $~lib/rt/pure/__retain i32.store local.get $0 @@ -1831,7 +1827,7 @@ local.tee $4 call $~lib/rt/pure/__retain i32.store offset=8 - local.get $2 + local.get $1 call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayRef global.get $std/array-literal/dynamicArrayRef @@ -1849,7 +1845,7 @@ i32.const 2 i32.const 8 call $~lib/rt/__allocArray - local.tee $2 + local.tee $1 i32.load offset=4 local.tee $0 call $std/array-literal/RefWithCtor#constructor @@ -1866,7 +1862,7 @@ local.tee $0 call $~lib/rt/pure/__retain i32.store offset=8 - local.get $2 + local.get $1 call $~lib/rt/pure/__retain global.set $std/array-literal/dynamicArrayRefWithCtor global.get $std/array-literal/dynamicArrayRefWithCtor @@ -1891,7 +1887,7 @@ call $~lib/rt/pure/__release global.get $std/array-literal/dynamicArrayRefWithCtor call $~lib/rt/pure/__release - local.get $1 + local.get $2 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index d4de9632..1a80dbb6 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -12,7 +12,9 @@ (type $FUNCSIG$fii (func (param i32 i32) (result f32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$vj (func (param i64))) + (type $FUNCSIG$jj (func (param i64) (result i64))) (type $FUNCSIG$iff (func (param f32 f32) (result i32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$id (func (param f64) (result i32))) @@ -157,60 +159,58 @@ (data (i32.const 4520) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e") (data (i32.const 4560) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") (data (i32.const 4592) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000") - (data (i32.const 4616) "\90\01\00\00\01\00\00\00\00\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 5032) "\10\00\00\00\01\00\00\00\07\00\00\00\10\00\00\00\18\12\00\00\18\12\00\00\90\01\00\00d") - (data (i32.const 5064) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003") - (data (i32.const 5096) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 5128) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-") - (data (i32.const 5152) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 5176) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_") - (data (i32.const 5200) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 5264) "0\00\00\00\01\00\00\00\00\00\00\000") - (data (i32.const 5294) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 5328) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 ") - (data (i32.const 5352) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") - (data (i32.const 5376) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") - (data (i32.const 5400) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5440) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5472) "\b8\02\00\00\01\00\00\00\00\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -827,10 +827,10 @@ if unreachable end - i32.const 7920 + i32.const 7472 i32.const 0 i32.store - i32.const 9488 + i32.const 9040 i32.const 0 i32.store i32.const 0 @@ -844,7 +844,7 @@ local.get $0 i32.const 2 i32.shl - i32.const 7920 + i32.const 7472 i32.add i32.const 0 i32.store offset=4 @@ -863,7 +863,7 @@ i32.add i32.const 2 i32.shl - i32.const 7920 + i32.const 7472 i32.add i32.const 0 i32.store offset=96 @@ -881,13 +881,13 @@ br $repeat|0 end end - i32.const 7920 - i32.const 9504 + i32.const 7472 + i32.const 9056 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 7920 + i32.const 7472 global.set $~lib/rt/tlsf/ROOT ) (func $~lib/rt/tlsf/prepareSize (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) @@ -1661,7 +1661,7 @@ ) (func $~lib/rt/pure/__retain (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 7908 + i32.const 7460 i32.gt_u if local.get $0 @@ -1673,7 +1673,7 @@ ) (func $~lib/rt/__typeinfo (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - i32.const 7696 + i32.const 7248 i32.load i32.gt_u if @@ -1687,7 +1687,7 @@ local.get $0 i32.const 3 i32.shl - i32.const 7700 + i32.const 7252 i32.add i32.load ) @@ -1838,7 +1838,7 @@ ) (func $~lib/rt/pure/__release (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 - i32.const 7908 + i32.const 7460 i32.gt_u if local.get $0 @@ -2076,7 +2076,7 @@ i32.sub i32.load offset=8 local.tee $0 - i32.const 7696 + i32.const 7248 i32.load i32.le_u if @@ -2091,7 +2091,7 @@ local.get $0 i32.const 3 i32.shl - i32.const 7700 + i32.const 7252 i32.add i32.load offset=4 local.tee $0 @@ -2106,7 +2106,7 @@ i32.ne if local.get $1 - i32.const 7908 + i32.const 7460 i32.gt_u if local.get $1 @@ -2115,7 +2115,7 @@ call $~lib/rt/pure/increment end local.get $0 - i32.const 7908 + i32.const 7460 i32.gt_u if local.get $0 @@ -2430,8 +2430,8 @@ local.set $2 local.get $0 i64.extend_i32_u - local.tee $4 - local.get $4 + local.get $0 + i64.extend_i32_u i64.const 32 i64.shl i64.or @@ -2971,7 +2971,7 @@ ) (func $~lib/rt/pure/__skippedRelease (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 7908 + i32.const 7460 i32.gt_u if local.get $0 @@ -4400,7 +4400,28 @@ end local.get $2 ) - (func $~lib/math/splitMix32 (; 103 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/math/murmurHash3 (; 103 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + local.get $0 + i64.const 33 + i64.shr_u + local.get $0 + i64.xor + i64.const -49064778989728563 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + i64.const -4265267296055464877 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + ) + (func $~lib/math/splitMix32 (; 104 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -4432,8 +4453,7 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 104 ;) (type $FUNCSIG$vj) (param $0 i64) - (local $1 i64) + (func $~lib/math/NativeMath.seedRandom (; 105 ;) (type $FUNCSIG$vj) (param $0 i64) local.get $0 i64.eqz if @@ -4447,47 +4467,12 @@ i32.const 1 global.set $~lib/math/random_seeded local.get $0 - i64.const 33 - i64.shr_u - local.get $0 - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state0_64 global.get $~lib/math/random_state0_64 i64.const -1 i64.xor - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state1_64 local.get $0 i32.wrap_i64 @@ -4497,7 +4482,7 @@ call $~lib/math/splitMix32 global.set $~lib/math/random_state1_32 ) - (func $~lib/util/sort/insertionSort (; 105 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 106 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f32) @@ -4579,7 +4564,7 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 106 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 107 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f32) @@ -4840,7 +4825,7 @@ local.get $5 f32.store ) - (func $~lib/array/Array#sort (; 107 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 108 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f32) @@ -4905,7 +4890,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 108 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 109 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4934,10 +4919,14 @@ i32.lt_s i32.sub ) - (func $std/array/isArraysEqual (; 109 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/builtins/isNaN (; 110 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $std/array/isArraysEqual (; 111 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 f32) - (local $4 i32) + (local $3 i32) local.get $0 call $~lib/rt/pure/__retain drop @@ -4948,7 +4937,7 @@ block $folding-inner0 local.get $0 i32.load offset=12 - local.tee $4 + local.tee $3 local.get $1 i32.load offset=12 i32.ne @@ -4959,21 +4948,17 @@ br_if $folding-inner1 loop $repeat|0 local.get $2 - local.get $4 + local.get $3 i32.lt_s if local.get $0 local.get $2 call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f32.ne + call $~lib/builtins/isNaN local.get $1 local.get $2 call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f32.ne + call $~lib/builtins/isNaN i32.ne if local.get $0 @@ -5007,7 +4992,7 @@ call $~lib/rt/pure/__release i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 110 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 112 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) @@ -5089,7 +5074,7 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 111 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 113 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) @@ -5350,7 +5335,7 @@ local.get $5 f64.store ) - (func $~lib/array/Array#sort (; 112 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 114 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f64) @@ -5415,7 +5400,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 113 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 115 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 @@ -5444,7 +5429,7 @@ i64.lt_s i32.sub ) - (func $~lib/array/Array#__get (; 114 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__get (; 116 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) local.get $1 local.get $0 i32.load offset=8 @@ -5467,10 +5452,14 @@ i32.add f64.load ) - (func $std/array/isArraysEqual (; 115 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/builtins/isNaN (; 117 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $std/array/isArraysEqual (; 118 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 f64) - (local $4 i32) + (local $3 i32) local.get $0 call $~lib/rt/pure/__retain drop @@ -5481,7 +5470,7 @@ block $folding-inner0 local.get $0 i32.load offset=12 - local.tee $4 + local.tee $3 local.get $1 i32.load offset=12 i32.ne @@ -5492,21 +5481,17 @@ br_if $folding-inner1 loop $repeat|0 local.get $2 - local.get $4 + local.get $3 i32.lt_s if local.get $0 local.get $2 call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f64.ne + call $~lib/builtins/isNaN local.get $1 local.get $2 call $~lib/array/Array#__get - local.tee $3 - local.get $3 - f64.ne + call $~lib/builtins/isNaN i32.ne if local.get $0 @@ -5540,7 +5525,7 @@ call $~lib/rt/pure/__release i32.const 1 ) - (func $~lib/util/sort/insertionSort (; 116 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 119 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5622,7 +5607,7 @@ unreachable end ) - (func $~lib/util/sort/weakHeapSort (; 117 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 120 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5883,7 +5868,7 @@ local.get $1 i32.store ) - (func $~lib/array/Array#sort (; 118 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 121 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5947,12 +5932,12 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 119 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 122 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.sub ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 123 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.gt_u @@ -5961,7 +5946,7 @@ i32.lt_u i32.sub ) - (func $~lib/array/Array.create (; 121 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array.create (; 124 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 268435452 i32.gt_u @@ -5990,7 +5975,7 @@ call $~lib/memory/memory.fill local.get $0 ) - (func $std/array/createReverseOrderedArray (; 122 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedArray (; 125 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -6019,7 +6004,7 @@ end local.get $2 ) - (func $~lib/math/NativeMath.random (; 123 ;) (type $FUNCSIG$d) (result f64) + (func $~lib/math/NativeMath.random (; 126 ;) (type $FUNCSIG$d) (result f64) (local $0 i64) (local $1 i64) global.get $~lib/math/random_seeded @@ -6066,7 +6051,7 @@ f64.const 1 f64.sub ) - (func $std/array/createRandomOrderedArray (; 124 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomOrderedArray (; 127 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -6095,7 +6080,7 @@ end local.get $2 ) - (func $std/array/isSorted (; 125 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted (; 128 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -6144,7 +6129,7 @@ call $~lib/rt/pure/__release i32.const 1 ) - (func $std/array/assertSorted (; 126 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 129 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -6169,7 +6154,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/array/assertSortedDefault (; 127 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/array/assertSortedDefault (; 130 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 call $~lib/rt/pure/__retain drop @@ -6179,12 +6164,12 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $start:std/array~anonymous|44 (; 128 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|44 (; 131 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.sub ) - (func $~lib/array/Array.create<~lib/array/Array> (; 129 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/array/Array.create<~lib/array/Array> (; 132 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 2 i32.const 2 @@ -6203,7 +6188,7 @@ call $~lib/memory/memory.fill local.get $0 ) - (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 130 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 133 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -6222,7 +6207,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/array/Array<~lib/array/Array>#__set (; 131 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array<~lib/array/Array>#__set (; 134 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) local.get $2 call $~lib/rt/pure/__retain @@ -6264,7 +6249,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/array/createReverseOrderedNestedArray (; 132 ;) (type $FUNCSIG$i) (result i32) + (func $std/array/createReverseOrderedNestedArray (; 135 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6298,7 +6283,7 @@ end local.get $1 ) - (func $start:std/array~anonymous|47 (; 133 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|47 (; 136 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -6320,7 +6305,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 134 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort<~lib/array/Array> (; 137 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6413,7 +6398,7 @@ unreachable end ) - (func $~lib/array/Array<~lib/array/Array>#sort (; 135 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#sort (; 138 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6475,7 +6460,7 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 136 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__unchecked_get (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load offset=4 local.get $1 @@ -6485,7 +6470,7 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/array/Array<~lib/array/Array>#__get (; 137 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#__get (; 140 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 @@ -6516,7 +6501,7 @@ local.get $1 call $~lib/array/Array<~lib/array/Array>#__unchecked_get ) - (func $std/array/isSorted<~lib/array/Array> (; 138 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/array/Array> (; 141 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6577,7 +6562,7 @@ call $~lib/rt/pure/__release i32.const 1 ) - (func $std/array/assertSorted<~lib/array/Array> (; 139 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/array/Array> (; 142 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -6602,7 +6587,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/array/Array.create> (; 140 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/array/Array.create> (; 143 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 512 i32.const 2 @@ -6621,7 +6606,7 @@ call $~lib/memory/memory.fill local.get $0 ) - (func $std/array/createReverseOrderedElementsArray (; 141 ;) (type $FUNCSIG$i) (result i32) + (func $std/array/createReverseOrderedElementsArray (; 144 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6656,7 +6641,7 @@ end local.get $1 ) - (func $start:std/array~anonymous|48 (; 142 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $start:std/array~anonymous|48 (; 145 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -6676,7 +6661,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/array/Array<~lib/string/String | null>#__get (; 143 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#__get (; 146 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -6695,7 +6680,7 @@ local.get $1 call $~lib/array/Array<~lib/array/Array>#__unchecked_get ) - (func $std/array/isSorted<~lib/string/String | null> (; 144 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted<~lib/string/String | null> (; 147 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6756,7 +6741,7 @@ call $~lib/rt/pure/__release i32.const 1 ) - (func $std/array/assertSorted<~lib/string/String | null> (; 145 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted<~lib/string/String | null> (; 148 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -6781,7 +6766,15 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/util/string/compareImpl (; 146 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#get:length (; 149 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 150 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6830,7 +6823,7 @@ call $~lib/rt/pure/__release local.get $5 ) - (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 147 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 (; 151 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -6851,27 +6844,25 @@ i32.eq select select - br_if $folding-inner0 - i32.const 0 - local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.tee $2 - i32.eqz + if + br $folding-inner0 + end local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.tee $3 - select - br_if $folding-inner0 + call $~lib/string/String#get:length + local.set $2 + local.get $1 + call $~lib/string/String#get:length + local.set $3 + i32.const 0 local.get $3 i32.eqz + local.get $2 + select + if + br $folding-inner0 + end + local.get $2 + i32.eqz if local.get $0 call $~lib/rt/pure/__release @@ -6880,7 +6871,7 @@ i32.const -1 return end - local.get $2 + local.get $3 i32.eqz if local.get $0 @@ -6892,10 +6883,10 @@ end local.get $0 local.get $1 - local.get $3 local.get $2 local.get $3 local.get $2 + local.get $3 i32.lt_s select call $~lib/util/string/compareImpl @@ -6913,7 +6904,7 @@ call $~lib/rt/pure/__release i32.const 0 ) - (func $~lib/string/String.__eq (; 148 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 152 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -6938,22 +6929,18 @@ i32.const 1 local.get $0 select - br_if $folding-inner0 + if + br $folding-inner0 + end local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $2 local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.ne - br_if $folding-inner0 + if + br $folding-inner0 + end local.get $0 local.get $1 local.get $2 @@ -6973,7 +6960,7 @@ call $~lib/rt/pure/__release i32.const 0 ) - (func $~lib/string/String.__ne (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -6992,7 +6979,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/array/isArraysEqual<~lib/string/String | null> (; 150 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual<~lib/string/String | null> (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7073,7 +7060,7 @@ call $~lib/rt/pure/__release i32.const 1 ) - (func $~lib/array/Array.create<~lib/string/String> (; 151 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/array/Array.create<~lib/string/String> (; 155 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 400 i32.const 2 @@ -7092,13 +7079,11 @@ call $~lib/memory/memory.fill local.get $0 ) - (func $~lib/string/String#charAt (; 152 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#charAt (; 156 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - i32.const 3196 - i32.load - i32.const 1 - i32.shr_u + i32.const 3200 + call $~lib/string/String#get:length i32.ge_u if i32.const 4248 @@ -7119,44 +7104,34 @@ local.get $1 call $~lib/rt/pure/__retain ) - (func $~lib/string/String#concat (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 157 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $1 call $~lib/rt/pure/__retain drop - block (result i32) + local.get $1 + i32.eqz + if local.get $1 - i32.eqz - if - local.get $1 - i32.const 4408 - call $~lib/rt/pure/__retainRelease - local.set $1 - end - local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $4 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $3 - i32.add - local.tee $2 - i32.eqz + i32.const 4408 + call $~lib/rt/pure/__retainRelease + local.set $1 end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $3 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $4 + i32.add + local.tee $2 + i32.eqz if i32.const 4248 call $~lib/rt/pure/__retain @@ -7184,7 +7159,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__concat (; 154 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 158 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -7205,7 +7180,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/array/createRandomString (; 155 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 159 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -7214,17 +7189,16 @@ call $~lib/rt/pure/__retain local.set $1 loop $repeat|0 - local.get $2 - local.get $0 - i32.lt_s - if + block $break|0 + local.get $2 + local.get $0 + i32.ge_s + br_if $break|0 local.get $1 local.get $1 call $~lib/math/NativeMath.random - i32.const 3196 - i32.load - i32.const 1 - i32.shr_u + i32.const 3200 + call $~lib/string/String#get:length f64.convert_i32_s f64.mul f64.floor @@ -7248,7 +7222,7 @@ end local.get $1 ) - (func $std/array/createRandomStringArray (; 156 ;) (type $FUNCSIG$i) (result i32) + (func $std/array/createRandomStringArray (; 160 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -7279,7 +7253,7 @@ end local.get $1 ) - (func $~lib/string/String#substring (; 157 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#substring (; 161 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -7294,11 +7268,7 @@ end i32.const 0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $2 i32.const 0 local.get $2 @@ -7347,11 +7317,7 @@ i32.const 0 else local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl local.get $1 @@ -7374,7 +7340,7 @@ local.get $1 call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#join_bool (; 158 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_bool (; 162 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -7420,10 +7386,8 @@ local.get $0 return end - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.tee $4 i32.const 5 i32.add @@ -7539,171 +7503,81 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/util/number/decimalCount32 (; 159 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 163 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + i32.const 3 + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.get $0 + i32.const 1000 + i32.lt_u + select + local.get $0 + i32.const 100 + i32.lt_u + select + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + i32.const 8 + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.get $0 + i32.const 100000000 + i32.lt_u + select + local.get $0 + i32.const 10000000 + i32.lt_u + select local.get $0 i32.const 100000 i32.lt_u - if (result i32) - local.get $0 - i32.const 100 - i32.lt_u - if (result i32) - i32.const 1 - i32.const 2 - local.get $0 - i32.const 10 - i32.lt_u - select - else - i32.const 3 - i32.const 4 - i32.const 5 - local.get $0 - i32.const 10000 - i32.lt_u - select - local.get $0 - i32.const 1000 - i32.lt_u - select - end - else - local.get $0 - i32.const 10000000 - i32.lt_u - if (result i32) - i32.const 6 - i32.const 7 - local.get $0 - i32.const 1000000 - i32.lt_u - select - else - i32.const 8 - i32.const 9 - i32.const 10 - local.get $0 - i32.const 1000000000 - i32.lt_u - select - local.get $0 - i32.const 100000000 - i32.lt_u - select - end - end + select ) - (func $~lib/util/number/utoa32_lut (; 160 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa_simple (; 164 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - i32.const 5052 - i32.load - local.set $3 loop $continue|0 local.get $1 - i32.const 10000 - i32.ge_u - if - local.get $1 - i32.const 10000 - i32.rem_u - local.set $4 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 - end - end - local.get $1 - i32.const 100 - i32.ge_u - if - local.get $1 - i32.const 100 - i32.rem_u - local.set $4 - local.get $1 - i32.const 100 + i32.const 10 i32.div_u - local.set $1 + local.set $3 local.get $2 - i32.const 2 + i32.const 1 i32.sub local.tee $2 i32.const 1 i32.shl local.get $0 i32.add - local.get $4 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - i32.store - end - local.get $1 - i32.const 10 - i32.ge_u - if - local.get $2 - i32.const 2 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - i32.store - else - local.get $2 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add local.get $1 + i32.const 10 + i32.rem_u i32.const 48 i32.add i32.store16 + local.get $3 + local.tee $1 + br_if $continue|0 end ) - (func $~lib/util/number/itoa32 (; 161 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 165 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -7736,7 +7610,7 @@ local.tee $2 local.get $0 local.get $3 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $2 @@ -7746,7 +7620,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 162 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 166 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -7781,7 +7655,7 @@ local.get $1 i32.add local.tee $2 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $0 @@ -7790,7 +7664,7 @@ end local.get $2 ) - (func $~lib/array/Array#join_int (; 163 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 167 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7836,11 +7710,7 @@ return end local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $5 i32.const 11 i32.add @@ -7928,7 +7798,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/array/Array#join (; 164 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 call $~lib/rt/pure/__retain drop @@ -7940,7 +7810,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/util/number/utoa32 (; 165 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 169 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -7960,11 +7830,11 @@ local.tee $2 local.get $0 local.get $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 166 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 170 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -7985,10 +7855,10 @@ local.get $2 call $~lib/util/number/decimalCount32 local.tee $0 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $0 ) - (func $~lib/array/Array#join_int (; 167 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join_int (; 171 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8034,11 +7904,7 @@ return end local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $5 i32.const 10 i32.add @@ -8126,7 +7992,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/array/Array#join (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#join (; 172 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 call $~lib/rt/pure/__retain drop @@ -8138,13 +8004,20 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/util/number/genDigits (; 169 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/builtins/isFinite (; 173 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/util/number/genDigits (; 174 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i32) (local $9 i64) - (local $10 i64) + (local $10 i32) (local $11 i64) - (local $12 i32) + (local $12 i64) (local $13 i32) (local $14 i64) local.get $3 @@ -8155,25 +8028,25 @@ i32.const 0 local.get $4 i32.sub - local.tee $12 - i64.extend_i32_s - local.tee $1 - i64.shl local.tee $10 + i64.extend_i32_s + i64.shl + local.tee $11 i64.const 1 i64.sub local.tee $14 local.get $3 i64.and - local.set $11 + local.set $12 local.get $3 - local.get $1 + local.get $10 + i64.extend_i32_s i64.shr_u i32.wrap_i64 local.tee $7 call $~lib/util/number/decimalCount32 local.set $4 - i32.const 6516 + i32.const 6068 i32.load local.set $13 loop $continue|0 @@ -8334,10 +8207,10 @@ local.set $4 local.get $7 i64.extend_i32_u - local.get $12 + local.get $10 i64.extend_i32_s i64.shl - local.get $11 + local.get $12 i64.add local.tee $1 local.get $5 @@ -8353,7 +8226,7 @@ local.get $13 i32.add i64.load32_u - local.get $12 + local.get $10 i64.extend_i32_s i64.shl local.set $3 @@ -8368,6 +8241,23 @@ i32.load16_u local.set $4 loop $continue|2 + i32.const 1 + local.get $9 + local.get $1 + i64.sub + local.get $1 + local.get $3 + i64.add + local.get $9 + i64.sub + i64.gt_u + local.get $1 + local.get $3 + i64.add + local.get $9 + i64.lt_u + select + i32.const 0 local.get $5 local.get $1 i64.sub @@ -8378,26 +8268,7 @@ local.get $9 i64.lt_u select - if (result i32) - i32.const 1 - local.get $9 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.sub - i64.gt_u - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.lt_u - select - else - i32.const 0 - end + select if local.get $4 i32.const 1 @@ -8424,11 +8295,11 @@ i64.const 10 i64.mul local.set $5 - local.get $11 + local.get $12 i64.const 10 i64.mul local.tee $3 - local.get $12 + local.get $10 i64.extend_i32_s i64.shr_u local.tee $1 @@ -8463,7 +8334,7 @@ local.get $3 local.get $14 i64.and - local.tee $11 + local.tee $12 local.get $5 i64.ge_u br_if $continue|3 @@ -8471,7 +8342,7 @@ local.get $4 i32.add global.set $~lib/util/number/_K - local.get $11 + local.get $12 local.set $1 i32.const 0 local.get $4 @@ -8495,43 +8366,41 @@ i32.load16_u local.set $4 loop $continue|4 + i32.const 1 + local.get $3 + local.get $1 + i64.sub + local.get $1 + local.get $11 + i64.add + local.get $3 + i64.sub + i64.gt_u + local.get $1 + local.get $11 + i64.add + local.get $3 + i64.lt_u + select + i32.const 0 local.get $5 local.get $1 i64.sub - local.get $10 + local.get $11 i64.ge_u i32.const 0 local.get $1 local.get $3 i64.lt_u select - if (result i32) - i32.const 1 - local.get $3 - local.get $1 - i64.sub - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.sub - i64.gt_u - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.lt_u - select - else - i32.const 0 - end + select if local.get $4 i32.const 1 i32.sub local.set $4 local.get $1 - local.get $10 + local.get $11 i64.add local.set $1 br $continue|4 @@ -8543,7 +8412,7 @@ local.get $6 end ) - (func $~lib/util/number/prettify (; 170 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 175 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 i32.eqz @@ -8719,7 +8588,7 @@ i32.const 1 i32.add local.tee $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $0 i32.const 45 i32.const 43 @@ -8777,7 +8646,7 @@ i32.const 1 i32.add local.tee $0 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $2 i32.const 45 i32.const 43 @@ -8794,7 +8663,7 @@ end end ) - (func $~lib/util/number/dtoa_core (; 171 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 176 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i64) (local $3 i32) (local $4 i64) @@ -8910,7 +8779,7 @@ i32.shl i32.sub global.set $~lib/util/number/_K - i32.const 6204 + i32.const 5756 i32.load local.get $3 i32.const 3 @@ -8918,7 +8787,7 @@ i32.add i64.load global.set $~lib/util/number/_frc_pow - i32.const 6428 + i32.const 5980 i32.load local.get $3 i32.const 1 @@ -9082,33 +8951,30 @@ local.get $10 i32.add ) - (func $~lib/util/number/dtoa (; 172 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 177 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) local.get $0 f64.const 0 f64.eq if - i32.const 5368 + i32.const 4920 call $~lib/rt/pure/__retain return end local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if - i32.const 5392 + i32.const 4944 call $~lib/rt/pure/__retain return end - i32.const 5416 - i32.const 5456 + i32.const 4968 + i32.const 5008 local.get $0 f64.const 0 f64.lt @@ -9138,7 +9004,7 @@ call $~lib/rt/tlsf/__free local.get $2 ) - (func $~lib/util/number/dtoa_stream (; 173 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) + (func $~lib/util/number/dtoa_stream (; 178 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) local.get $1 i32.const 1 @@ -9163,14 +9029,11 @@ return end local.get $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $2 - local.get $2 - f64.ne + call $~lib/builtins/isNaN if local.get $0 i32.const 78 @@ -9192,8 +9055,8 @@ i32.add local.set $1 local.get $0 - i32.const 5416 - i32.const 5456 + i32.const 4968 + i32.const 5008 local.get $3 select local.get $1 @@ -9209,14 +9072,14 @@ local.get $2 call $~lib/util/number/dtoa_core ) - (func $~lib/array/Array#join_flt (; 174 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_flt (; 179 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - i32.const 5344 + i32.const 4896 call $~lib/rt/pure/__retain drop local.get $0 @@ -9230,7 +9093,7 @@ i32.const 4248 call $~lib/rt/pure/__retain local.set $0 - i32.const 5344 + i32.const 4896 call $~lib/rt/pure/__release local.get $0 return @@ -9249,15 +9112,13 @@ local.set $1 local.get $0 call $~lib/rt/pure/__release - i32.const 5344 + i32.const 4896 call $~lib/rt/pure/__release local.get $1 return end - i32.const 5340 - i32.load - i32.const 1 - i32.shr_u + i32.const 4896 + call $~lib/string/String#get:length local.tee $4 i32.const 28 i32.add @@ -9298,7 +9159,7 @@ i32.shl local.get $1 i32.add - i32.const 5344 + i32.const 4896 local.get $4 i32.const 1 i32.shl @@ -9334,18 +9195,18 @@ local.get $0 call $~lib/string/String#substring local.set $0 - i32.const 5344 + i32.const 4896 call $~lib/rt/pure/__release local.get $1 call $~lib/rt/pure/__release local.get $0 return end - i32.const 5344 + i32.const 4896 call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/string/String>#join_str (; 175 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#join_str (; 180 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9388,11 +9249,7 @@ return end local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $7 i32.const 0 local.set $0 @@ -9401,10 +9258,11 @@ i32.add local.set $4 loop $repeat|0 - local.get $2 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $2 + local.get $4 + i32.ge_s + br_if $break|0 local.get $0 local.get $2 i32.const 2 @@ -9416,11 +9274,7 @@ local.tee $0 if local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.get $3 i32.add local.set $3 @@ -9448,10 +9302,11 @@ i32.const 0 local.set $4 loop $repeat|1 - local.get $4 - local.get $5 - i32.lt_s - if + block $break|1 + local.get $4 + local.get $5 + i32.ge_s + br_if $break|1 local.get $0 local.get $4 i32.const 2 @@ -9469,11 +9324,7 @@ i32.add local.get $0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $8 i32.const 1 i32.shl @@ -9524,11 +9375,7 @@ i32.add local.get $0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl call $~lib/memory/memory.copy @@ -9539,7 +9386,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $~lib/array/Array<~lib/string/String>#join (; 176 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#join (; 181 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 call $~lib/rt/pure/__retain drop @@ -9551,13 +9398,13 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/array/Ref#constructor (; 177 ;) (type $FUNCSIG$i) (result i32) + (func $std/array/Ref#constructor (; 182 ;) (type $FUNCSIG$i) (result i32) i32.const 0 i32.const 18 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain ) - (func $~lib/array/Array#join_ref (; 178 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_ref (; 183 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9590,7 +9437,7 @@ local.get $2 i32.eqz if - i32.const 6696 + i32.const 6248 call $~lib/rt/pure/__retain local.set $0 i32.const 4512 @@ -9598,10 +9445,8 @@ local.get $0 return end - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.tee $3 i32.const 15 i32.add @@ -9638,7 +9483,7 @@ i32.shl local.get $1 i32.add - i32.const 6696 + i32.const 6248 i32.const 30 call $~lib/memory/memory.copy local.get $0 @@ -9683,7 +9528,7 @@ i32.shl local.get $1 i32.add - i32.const 6696 + i32.const 6248 i32.const 30 call $~lib/memory/memory.copy local.get $0 @@ -9715,12 +9560,12 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array#toString (; 179 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#toString (; 184 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4512 call $~lib/array/Array#join ) - (func $~lib/util/number/itoa_stream (; 180 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 185 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $1 i32.const 1 @@ -9766,7 +9611,7 @@ local.get $0 local.get $3 local.get $2 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $0 @@ -9775,7 +9620,7 @@ end local.get $2 ) - (func $~lib/array/Array#join_int (; 181 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_int (; 186 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9820,10 +9665,8 @@ local.get $1 return end - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.tee $4 i32.const 11 i32.add @@ -9907,7 +9750,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/util/number/itoa_stream (; 182 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 187 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -9934,10 +9777,10 @@ local.get $0 local.get $2 local.get $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 ) - (func $~lib/array/Array#join_int (; 183 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_int (; 188 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -9982,10 +9825,8 @@ local.get $1 return end - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.tee $4 i32.const 10 i32.add @@ -10073,158 +9914,84 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/util/number/decimalCount64 (; 184 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 189 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + i32.const 11 + i32.const 12 + local.get $0 + i64.const 100000000000 + i64.lt_u + select + i32.const 13 + i32.const 14 + i32.const 15 + local.get $0 + i64.const 100000000000000 + i64.lt_u + select + local.get $0 + i64.const 10000000000000 + i64.lt_u + select + local.get $0 + i64.const 1000000000000 + i64.lt_u + select + i32.const 16 + i32.const 17 + local.get $0 + i64.const 10000000000000000 + i64.lt_u + select + i32.const 18 + i32.const 19 + i32.const 20 + local.get $0 + i64.const -8446744073709551616 + i64.lt_u + select + local.get $0 + i64.const 1000000000000000000 + i64.lt_u + select + local.get $0 + i64.const 100000000000000000 + i64.lt_u + select local.get $0 i64.const 1000000000000000 i64.lt_u - if (result i32) - local.get $0 - i64.const 1000000000000 - i64.lt_u - if (result i32) - i32.const 11 - i32.const 12 - local.get $0 - i64.const 100000000000 - i64.lt_u - select - else - i32.const 13 - i32.const 14 - i32.const 15 - local.get $0 - i64.const 100000000000000 - i64.lt_u - select - local.get $0 - i64.const 10000000000000 - i64.lt_u - select - end - else - local.get $0 - i64.const 100000000000000000 - i64.lt_u - if (result i32) - i32.const 16 - i32.const 17 - local.get $0 - i64.const 10000000000000000 - i64.lt_u - select - else - i32.const 18 - i32.const 19 - i32.const 20 - local.get $0 - i64.const -8446744073709551616 - i64.lt_u - select - local.get $0 - i64.const 1000000000000000000 - i64.lt_u - select - end - end + select ) - (func $~lib/util/number/utoa64_lut (; 185 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - i32.const 5052 - i32.load - local.set $3 + (func $~lib/util/number/utoa_simple (; 190 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i64) loop $continue|0 local.get $1 - i64.const 100000000 - i64.ge_u - if - local.get $1 - local.get $1 - i64.const 100000000 - i64.div_u - local.tee $1 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee $4 - i32.const 10000 - i32.div_u - local.tee $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $5 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 10000 - i32.rem_u - local.tee $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $6 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $5 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 - end + i64.const 10 + i64.div_u + local.set $3 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $1 + i64.const 10 + i64.rem_u + i32.wrap_i64 + i32.const 48 + i32.add + i32.store16 + local.get $3 + local.tee $1 + i64.const 0 + i64.ne + br_if $continue|0 end - local.get $0 - local.get $1 - i32.wrap_i64 - local.get $2 - call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 186 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 191 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10251,7 +10018,7 @@ local.tee $2 local.get $1 local.get $3 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 call $~lib/util/number/decimalCount64 @@ -10263,12 +10030,12 @@ local.tee $2 local.get $0 local.get $1 - call $~lib/util/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 187 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 192 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) local.get $1 i32.const 1 @@ -10297,18 +10064,18 @@ local.get $0 local.get $3 local.get $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 local.get $2 local.get $2 call $~lib/util/number/decimalCount64 local.tee $1 - call $~lib/util/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 ) - (func $~lib/array/Array#join_int (; 188 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_int (; 193 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10353,10 +10120,8 @@ local.get $1 return end - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.tee $4 i32.const 20 i32.add @@ -10444,7 +10209,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/util/number/itoa64 (; 189 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 194 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10486,7 +10251,7 @@ local.tee $3 local.get $2 local.get $4 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 call $~lib/util/number/decimalCount64 @@ -10500,7 +10265,7 @@ local.tee $3 local.get $0 local.get $2 - call $~lib/util/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 if @@ -10511,7 +10276,7 @@ local.get $3 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa_stream (; 190 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) + (func $~lib/util/number/itoa_stream (; 195 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) (local $4 i32) local.get $1 @@ -10555,7 +10320,7 @@ local.get $0 local.get $4 local.get $3 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 local.get $2 @@ -10564,7 +10329,7 @@ local.get $1 i32.add local.tee $3 - call $~lib/util/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 if @@ -10574,7 +10339,7 @@ end local.get $3 ) - (func $~lib/array/Array#join_int (; 191 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_int (; 196 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10619,10 +10384,8 @@ local.get $1 return end - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.tee $4 i32.const 21 i32.add @@ -10710,12 +10473,12 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/string/String | null>#toString (; 192 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/string/String | null>#toString (; 197 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 4512 call $~lib/array/Array<~lib/string/String>#join ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 193 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 198 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10745,10 +10508,8 @@ i32.const 4248 call $~lib/rt/pure/__retain local.set $1 - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.set $6 local.get $0 i32.load offset=4 @@ -10861,7 +10622,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/util/number/itoa_stream (; 194 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/itoa_stream (; 199 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1 i32.shl @@ -10888,10 +10649,10 @@ local.get $0 local.get $2 local.get $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 ) - (func $~lib/array/Array#join_int (; 195 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join_int (; 200 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10936,10 +10697,8 @@ local.get $1 return end - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.tee $4 i32.const 10 i32.add @@ -11023,7 +10782,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array#join (; 196 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array#join (; 201 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 4512 call $~lib/rt/pure/__retain drop @@ -11034,7 +10793,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 197 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 202 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11064,10 +10823,8 @@ i32.const 4248 call $~lib/rt/pure/__retain local.set $1 - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.set $6 local.get $0 i32.load offset=4 @@ -11177,7 +10934,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/array/Array>#join_arr (; 198 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join_arr (; 203 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11207,10 +10964,8 @@ i32.const 4248 call $~lib/rt/pure/__retain local.set $1 - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.set $6 local.get $0 i32.load offset=4 @@ -11323,7 +11078,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/array/Array<~lib/array/Array>#join (; 199 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array>#join (; 204 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 4512 call $~lib/rt/pure/__retain drop @@ -11334,7 +11089,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 200 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join_arr (; 205 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11364,10 +11119,8 @@ i32.const 4248 call $~lib/rt/pure/__retain local.set $1 - i32.const 4508 - i32.load - i32.const 1 - i32.shr_u + i32.const 4512 + call $~lib/string/String#get:length local.set $6 local.get $0 i32.load offset=4 @@ -11477,7 +11230,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $start:std/array (; 201 ;) (type $FUNCSIG$v) + (func $start:std/array (; 206 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -16079,7 +15832,7 @@ i32.const 4248 call $~lib/array/Array#join local.tee $26 - i32.const 5080 + i32.const 4632 call $~lib/string/String.__eq i32.eqz if @@ -16093,14 +15846,14 @@ i32.const 3 i32.const 2 i32.const 7 - i32.const 5112 + i32.const 4664 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $8 - i32.const 5144 + i32.const 4696 call $~lib/array/Array#join local.tee $27 - i32.const 5080 + i32.const 4632 call $~lib/string/String.__eq i32.eqz if @@ -16114,14 +15867,14 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 5168 + i32.const 4720 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $2 - i32.const 5192 + i32.const 4744 call $~lib/array/Array#join local.tee $6 - i32.const 5216 + i32.const 4768 call $~lib/string/String.__eq i32.eqz if @@ -16135,20 +15888,20 @@ i32.const 6 i32.const 3 i32.const 9 - i32.const 5280 + i32.const 4832 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $12 - i32.const 5344 + i32.const 4896 call $~lib/rt/pure/__retain drop local.get $12 call $~lib/array/Array#join_flt local.set $13 - i32.const 5344 + i32.const 4896 call $~lib/rt/pure/__release local.get $13 - i32.const 6544 + i32.const 6096 call $~lib/string/String.__eq i32.eqz if @@ -16162,14 +15915,14 @@ i32.const 3 i32.const 2 i32.const 14 - i32.const 6664 + i32.const 6216 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $4 i32.const 4248 call $~lib/array/Array<~lib/string/String>#join local.tee $5 - i32.const 6640 + i32.const 6192 call $~lib/string/String.__eq i32.eqz if @@ -16213,7 +15966,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $1 - i32.const 6744 + i32.const 6296 call $~lib/string/String.__eq i32.eqz if @@ -16259,7 +16012,7 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 6824 + i32.const 6376 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $15 @@ -16268,7 +16021,7 @@ i32.const 1 i32.const 2 i32.const 3 - i32.const 6840 + i32.const 6392 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $16 @@ -16277,7 +16030,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 6864 + i32.const 6416 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $17 @@ -16286,7 +16039,7 @@ i32.const 4 i32.const 2 i32.const 3 - i32.const 6888 + i32.const 6440 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $18 @@ -16309,7 +16062,7 @@ local.get $30 call $~lib/array/Array#toString local.tee $20 - i32.const 6640 + i32.const 6192 call $~lib/string/String.__eq i32.eqz if @@ -16323,7 +16076,7 @@ local.get $31 call $~lib/array/Array#toString local.tee $21 - i32.const 6920 + i32.const 6472 call $~lib/string/String.__eq i32.eqz if @@ -16337,7 +16090,7 @@ local.get $32 call $~lib/array/Array#toString local.tee $22 - i32.const 6944 + i32.const 6496 call $~lib/string/String.__eq i32.eqz if @@ -16351,7 +16104,7 @@ i32.const 3 i32.const 0 i32.const 20 - i32.const 6976 + i32.const 6528 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $33 @@ -16364,7 +16117,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $2 - i32.const 7000 + i32.const 6552 call $~lib/string/String.__eq i32.eqz if @@ -16378,7 +16131,7 @@ i32.const 3 i32.const 1 i32.const 21 - i32.const 7032 + i32.const 6584 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $34 @@ -16391,7 +16144,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $6 - i32.const 7056 + i32.const 6608 call $~lib/string/String.__eq i32.eqz if @@ -16405,7 +16158,7 @@ i32.const 3 i32.const 3 i32.const 16 - i32.const 7096 + i32.const 6648 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $35 @@ -16418,7 +16171,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $4 - i32.const 7136 + i32.const 6688 call $~lib/string/String.__eq i32.eqz if @@ -16432,7 +16185,7 @@ i32.const 4 i32.const 3 i32.const 22 - i32.const 7200 + i32.const 6752 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $36 @@ -16445,7 +16198,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $5 - i32.const 7248 + i32.const 6800 call $~lib/string/String.__eq i32.eqz if @@ -16459,7 +16212,7 @@ i32.const 7 i32.const 2 i32.const 13 - i32.const 7352 + i32.const 6904 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $23 @@ -16467,7 +16220,7 @@ local.tee $24 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $28 - i32.const 7400 + i32.const 6952 call $~lib/string/String.__eq i32.eqz if @@ -16481,13 +16234,13 @@ i32.const 4 i32.const 2 i32.const 14 - i32.const 7496 + i32.const 7048 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $9 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $11 - i32.const 7528 + i32.const 7080 call $~lib/string/String.__eq i32.eqz if @@ -16509,7 +16262,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 7560 + i32.const 7112 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $12 @@ -16519,7 +16272,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 7584 + i32.const 7136 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $13 @@ -16537,7 +16290,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $1 - i32.const 7608 + i32.const 7160 call $~lib/string/String.__eq i32.eqz if @@ -16559,7 +16312,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 7640 + i32.const 7192 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $14 @@ -16569,7 +16322,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 7664 + i32.const 7216 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $25 @@ -16587,7 +16340,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $3 - i32.const 7608 + i32.const 7160 call $~lib/string/String.__eq i32.eqz if @@ -16616,7 +16369,7 @@ i32.const 1 i32.const 2 i32.const 7 - i32.const 7688 + i32.const 7240 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $27 @@ -16638,7 +16391,7 @@ i32.const 4512 call $~lib/rt/pure/__release local.get $0 - i32.const 6640 + i32.const 6192 call $~lib/string/String.__eq i32.eqz if @@ -16724,7 +16477,7 @@ local.get $8 call $~lib/rt/pure/__release ) - (func $std/array/main (; 202 ;) (type $FUNCSIG$v) + (func $std/array/main (; 207 ;) (type $FUNCSIG$v) global.get $~lib/started i32.eqz if @@ -16733,9 +16486,9 @@ global.set $~lib/started end ) - (func $~lib/rt/pure/__visit (; 203 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 208 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 - i32.const 7908 + i32.const 7460 i32.lt_u if return @@ -16843,7 +16596,7 @@ unreachable end ) - (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 204 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/array/Array>#__visit_impl (; 209 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $0 @@ -16874,7 +16627,7 @@ end end ) - (func $~lib/rt/__visit_members (; 205 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 210 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $block$4$break block $switch$1$default block $switch$1$case$27 @@ -16945,7 +16698,7 @@ call $~lib/rt/pure/__visit end ) - (func $null (; 206 ;) (type $FUNCSIG$v) + (func $null (; 211 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 715e522f..8236e135 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -2,11 +2,11 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$i (func (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") @@ -140,7 +140,13 @@ i32.const 0 i32.store8 ) - (func $~lib/memory/memory.copy (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + ) + (func $~lib/memory/memory.copy (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) block $~lib/util/memory/memmove|inlined.0 @@ -313,12 +319,10 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#slice (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#slice (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength local.set $3 local.get $1 i32.const 0 @@ -382,7 +386,15 @@ call $~lib/memory/memory.copy local.get $3 ) - (func $~lib/arraybuffer/ArrayBufferView#constructor (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + if + i32.const 1 + return + end + i32.const 0 + ) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) i32.const 1 i32.const 1073741808 @@ -435,7 +447,7 @@ i32.store offset=8 local.get $0 ) - (func $~lib/rt/__allocArray (; 6 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/rt/__allocArray (; 8 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) i32.const 16 @@ -462,16 +474,14 @@ call $~lib/memory/memory.copy local.get $0 ) - (func $~lib/dataview/DataView#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/dataview/DataView#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $1 i32.const 1073741808 i32.gt_u local.get $1 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.gt_u i32.or if @@ -508,30 +518,9 @@ i32.store offset=8 local.get $2 ) - (func $~lib/dataview/DataView#constructor|trampoline (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - block $2of2 - block $1of2 - block $outOfRange - global.get $~lib/argc - i32.const 1 - i32.sub - br_table $1of2 $1of2 $2of2 $outOfRange - end - unreachable - end - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - local.set $1 - end - local.get $0 - local.get $1 - call $~lib/dataview/DataView#constructor - ) - (func $start:std/arraybuffer (; 9 ;) (type $FUNCSIG$v) + (func $start:std/arraybuffer (; 10 ;) (type $FUNCSIG$v) (local $0 i32) + (local $1 i32) i32.const 240 global.set $~lib/rt/stub/startOffset global.get $~lib/rt/stub/startOffset @@ -544,9 +533,7 @@ local.get $0 global.set $std/arraybuffer/buffer global.get $std/arraybuffer/buffer - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 8 i32.ne if @@ -563,9 +550,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 8 i32.ne if @@ -593,9 +578,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 7 i32.ne if @@ -612,9 +595,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 1 i32.ne if @@ -631,9 +612,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 2 i32.ne if @@ -650,9 +629,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 6 i32.ne if @@ -669,9 +646,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 2 i32.ne if @@ -688,9 +663,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.const 4 i32.ne if @@ -707,9 +680,7 @@ call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength if i32.const 0 i32.const 128 @@ -728,6 +699,36 @@ call $~lib/builtins/abort unreachable end + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> + if + i32.const 0 + i32.const 128 + i32.const 41 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> + if + i32.const 0 + i32.const 128 + i32.const 42 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> + if + i32.const 0 + i32.const 128 + i32.const 43 + i32.const 0 + call $~lib/builtins/abort + unreachable + end i32.const 12 i32.const 5 call $~lib/rt/stub/__alloc @@ -737,11 +738,7 @@ call $~lib/rt/__allocArray drop global.get $std/arraybuffer/arr8 - if (result i32) - i32.const 1 - else - i32.const 0 - end + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> i32.eqz if i32.const 0 @@ -751,17 +748,12 @@ call $~lib/builtins/abort unreachable end - block $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Int32Array>2 (result i32) - i32.const 1 - i32.const 12 - i32.const 9 - call $~lib/rt/stub/__alloc - i32.const 2 - call $~lib/arraybuffer/ArrayBufferView#constructor - br_if $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Int32Array>2 - drop - i32.const 0 - end + i32.const 12 + i32.const 9 + call $~lib/rt/stub/__alloc + i32.const 2 + call $~lib/arraybuffer/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> i32.eqz if i32.const 0 @@ -773,15 +765,27 @@ end i32.const 1 global.set $~lib/argc - block $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/dataview/DataView>3 (result i32) - i32.const 1 - global.get $std/arraybuffer/arr8 - i32.load - call $~lib/dataview/DataView#constructor|trampoline - br_if $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/dataview/DataView>3 - drop - i32.const 0 + global.get $std/arraybuffer/arr8 + i32.load + local.set $0 + block $2of2 + block $1of2 + block $outOfRange + global.get $~lib/argc + i32.const 1 + i32.sub + br_table $1of2 $1of2 $2of2 $outOfRange + end + unreachable + end + local.get $0 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + local.set $1 end + local.get $0 + local.get $1 + call $~lib/dataview/DataView#constructor + call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array> i32.eqz if i32.const 0 @@ -792,10 +796,10 @@ unreachable end ) - (func $start (; 10 ;) (type $FUNCSIG$v) + (func $start (; 11 ;) (type $FUNCSIG$v) call $start:std/arraybuffer ) - (func $null (; 11 ;) (type $FUNCSIG$v) + (func $null (; 12 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 08311fd0..5c8f3070 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -2,11 +2,11 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$fiii (func (param i32 i32 i32) (result f32))) (type $FUNCSIG$jj (func (param i64) (result i64))) (type $FUNCSIG$v (func)) - (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$dii (func (param i32 i32) (result f64))) (type $FUNCSIG$jii (func (param i32 i32) (result i64))) (type $FUNCSIG$vifi (func (param i32 f32 i32))) @@ -159,7 +159,13 @@ local.get $2 i32.store8 ) - (func $~lib/dataview/DataView#constructor (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + ) + (func $~lib/dataview/DataView#constructor (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 i32.const 1073741808 @@ -168,9 +174,7 @@ local.get $2 i32.add local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength i32.gt_u i32.or if @@ -209,7 +213,27 @@ i32.store offset=8 local.get $3 ) - (func $~lib/dataview/DataView#getFloat32 (; 5 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $0 + i32.load + i32.sub + ) + (func $~lib/polyfills/bswap (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const -16711936 + i32.and + i32.const 8 + i32.rotl + local.get $0 + i32.const 16711935 + i32.and + i32.const 8 + i32.rotr + i32.or + ) + (func $~lib/dataview/DataView#getFloat32 (; 8 ;) (type $FUNCSIG$fiii) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) local.get $1 i32.const 0 i32.lt_s @@ -241,21 +265,11 @@ local.get $1 i32.add i32.load - local.tee $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or + call $~lib/polyfills/bswap f32.reinterpret_i32 end ) - (func $~lib/polyfills/bswap (; 6 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + (func $~lib/polyfills/bswap (; 9 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) local.get $0 i64.const 8 i64.shr_u @@ -281,7 +295,7 @@ i64.const 32 i64.rotr ) - (func $~lib/dataview/DataView#getFloat64 (; 7 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/dataview/DataView#getFloat64 (; 10 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) i32.const 8 local.get $0 i32.load offset=8 @@ -307,7 +321,7 @@ f64.reinterpret_i64 end ) - (func $~lib/dataview/DataView#getInt8 (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/dataview/DataView#getInt8 (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -326,7 +340,20 @@ i32.add i32.load8_s ) - (func $~lib/dataview/DataView#getInt16 (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/polyfills/bswap (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.shl + i32.const 24 + i32.shr_s + i32.const 255 + i32.and + local.get $0 + i32.const 8 + i32.shl + i32.or + ) + (func $~lib/dataview/DataView#getInt16 (; 13 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 0 i32.lt_s @@ -352,23 +379,15 @@ i32.load16_s local.set $0 local.get $2 - if (result i32) + i32.eqz + if local.get $0 - else - local.get $0 - i32.const 16 - i32.shl - i32.const 24 - i32.shr_s - i32.const 255 - i32.and - local.get $0 - i32.const 8 - i32.shl - i32.or + call $~lib/polyfills/bswap + local.set $0 end + local.get $0 ) - (func $~lib/dataview/DataView#getInt32 (; 10 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/dataview/DataView#getInt32 (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 0 i32.lt_s @@ -394,23 +413,15 @@ i32.load local.set $0 local.get $2 - if (result i32) + i32.eqz + if local.get $0 - else - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or + call $~lib/polyfills/bswap + local.set $0 end + local.get $0 ) - (func $~lib/dataview/DataView#getInt64 (; 11 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/dataview/DataView#getInt64 (; 15 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) (local $2 i64) i32.const 8 local.get $0 @@ -436,7 +447,7 @@ call $~lib/polyfills/bswap end ) - (func $~lib/dataview/DataView#getUint8 (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/dataview/DataView#getUint8 (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -455,7 +466,18 @@ i32.add i32.load8_u ) - (func $~lib/dataview/DataView#getUint16 (; 13 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/polyfills/bswap (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.shl + local.get $0 + i32.const 65535 + i32.and + i32.const 8 + i32.shr_u + i32.or + ) + (func $~lib/dataview/DataView#getUint16 (; 18 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 0 i32.lt_s @@ -481,21 +503,15 @@ i32.load16_u local.set $0 local.get $2 - if (result i32) + i32.eqz + if local.get $0 - else - local.get $0 - i32.const 8 - i32.shl - local.get $0 - i32.const 65535 - i32.and - i32.const 8 - i32.shr_u - i32.or + call $~lib/polyfills/bswap + local.set $0 end + local.get $0 ) - (func $~lib/dataview/DataView#getUint32 (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/dataview/DataView#getUint32 (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 0 i32.lt_s @@ -521,23 +537,15 @@ i32.load local.set $0 local.get $2 - if (result i32) + i32.eqz + if local.get $0 - else - local.get $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or + call $~lib/polyfills/bswap + local.set $0 end + local.get $0 ) - (func $~lib/dataview/DataView#getUint64 (; 15 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/dataview/DataView#getUint64 (; 20 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) (local $2 i64) i32.const 8 local.get $0 @@ -563,7 +571,7 @@ call $~lib/polyfills/bswap end ) - (func $~lib/dataview/DataView#setFloat32 (; 16 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/dataview/DataView#setFloat32 (; 21 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) i32.const 4 local.get $0 i32.load offset=8 @@ -587,21 +595,11 @@ i32.load offset=4 local.get $1 i32.reinterpret_f32 - local.tee $0 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl - local.get $0 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or + call $~lib/polyfills/bswap i32.store end ) - (func $~lib/dataview/DataView#setFloat64 (; 17 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/dataview/DataView#setFloat64 (; 22 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) i32.const 8 local.get $0 i32.load offset=8 @@ -629,7 +627,7 @@ i64.store end ) - (func $~lib/dataview/DataView#setInt8 (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/dataview/DataView#setInt8 (; 23 ;) (type $FUNCSIG$vi) (param $0 i32) i32.const 0 local.get $0 i32.load offset=8 @@ -647,7 +645,7 @@ i32.const 108 i32.store8 ) - (func $~lib/dataview/DataView#setInt16 (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/dataview/DataView#setInt16 (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 2 local.get $0 i32.load offset=8 @@ -662,28 +660,16 @@ end local.get $0 i32.load offset=4 - local.set $0 local.get $2 - i32.eqz - if + if (result i32) local.get $1 - i32.const 16 - i32.shl - i32.const 24 - i32.shr_s - i32.const 255 - i32.and + else local.get $1 - i32.const 8 - i32.shl - i32.or - local.set $1 + call $~lib/polyfills/bswap end - local.get $0 - local.get $1 i32.store16 ) - (func $~lib/dataview/DataView#setInt32 (; 20 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/dataview/DataView#setInt32 (; 25 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 4 local.get $0 i32.load offset=8 @@ -698,28 +684,16 @@ end local.get $0 i32.load offset=4 - local.set $0 local.get $2 - i32.eqz - if + if (result i32) local.get $1 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl + else local.get $1 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - local.set $1 + call $~lib/polyfills/bswap end - local.get $0 - local.get $1 i32.store ) - (func $~lib/dataview/DataView#setInt64 (; 21 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/dataview/DataView#setInt64 (; 26 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) i32.const 8 local.get $0 i32.load offset=8 @@ -743,7 +717,7 @@ end i64.store ) - (func $~lib/dataview/DataView#setUint8 (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/dataview/DataView#setUint8 (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) i32.const 0 local.get $0 i32.load offset=8 @@ -761,7 +735,7 @@ i32.const 238 i32.store8 ) - (func $~lib/dataview/DataView#setUint16 (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/dataview/DataView#setUint16 (; 28 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 2 local.get $0 i32.load offset=8 @@ -776,26 +750,16 @@ end local.get $0 i32.load offset=4 - local.set $0 local.get $2 - i32.eqz - if + if (result i32) local.get $1 - i32.const 8 - i32.shl + else local.get $1 - i32.const 65535 - i32.and - i32.const 8 - i32.shr_u - i32.or - local.set $1 + call $~lib/polyfills/bswap end - local.get $0 - local.get $1 i32.store16 ) - (func $~lib/dataview/DataView#setUint32 (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/dataview/DataView#setUint32 (; 29 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) i32.const 4 local.get $0 i32.load offset=8 @@ -810,28 +774,16 @@ end local.get $0 i32.load offset=4 - local.set $0 local.get $2 - i32.eqz - if + if (result i32) local.get $1 - i32.const -16711936 - i32.and - i32.const 8 - i32.rotl + else local.get $1 - i32.const 16711935 - i32.and - i32.const 8 - i32.rotr - i32.or - local.set $1 + call $~lib/polyfills/bswap end - local.get $0 - local.get $1 i32.store ) - (func $~lib/dataview/DataView#setUint64 (; 25 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/dataview/DataView#setUint64 (; 30 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) i32.const 8 local.get $0 i32.load offset=8 @@ -855,7 +807,7 @@ end i64.store ) - (func $~lib/dataview/DataView#constructor|trampoline (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/dataview/DataView#constructor|trampoline (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block $2of2 block $1of2 @@ -868,9 +820,7 @@ unreachable end local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength local.set $1 end local.get $0 @@ -878,8 +828,7 @@ local.get $1 call $~lib/dataview/DataView#constructor ) - (func $start:std/dataview (; 27 ;) (type $FUNCSIG$v) - (local $0 i32) + (func $start:std/dataview (; 32 ;) (type $FUNCSIG$v) i32.const 320 global.set $~lib/rt/stub/startOffset global.get $~lib/rt/stub/startOffset @@ -924,12 +873,8 @@ global.get $std/dataview/array i32.load global.get $std/dataview/array - local.tee $0 - i32.load offset=4 - local.get $0 - i32.load - i32.sub - local.get $0 + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset + global.get $std/dataview/array i32.load offset=8 call $~lib/dataview/DataView#constructor global.set $std/dataview/view @@ -2414,11 +2359,7 @@ call $~lib/dataview/DataView#constructor|trampoline global.set $std/dataview/view global.get $std/dataview/view - local.tee $0 - i32.load offset=4 - local.get $0 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 288 @@ -2440,10 +2381,10 @@ unreachable end ) - (func $start (; 28 ;) (type $FUNCSIG$v) + (func $start (; 33 ;) (type $FUNCSIG$v) call $start:std/dataview ) - (func $null (; 29 ;) (type $FUNCSIG$v) + (func $null (; 34 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 2df99f44..509f9bf2 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -178,15 +178,15 @@ unreachable end global.get $std/date/date - local.tee $0 global.get $std/date/creationTime i64.const 1 i64.add - local.tee $1 i64.store - local.get $0 + global.get $std/date/date i64.load - local.get $1 + global.get $std/date/creationTime + i64.const 1 + i64.add i64.ne if i32.const 0 diff --git a/tests/compiler/std/libm.optimized.wat b/tests/compiler/std/libm.optimized.wat index 67dda680..7dcc3971 100644 --- a/tests/compiler/std/libm.optimized.wat +++ b/tests/compiler/std/libm.optimized.wat @@ -1,5 +1,6 @@ (module (type $FUNCSIG$dd (func (param f64) (result f64))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) (type $FUNCSIG$fd (func (param f64) (result f32))) @@ -586,8 +587,8 @@ i32.sub local.get $5 i32.add + local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add @@ -595,7 +596,8 @@ f64.sub local.get $3 f64.add - local.get $0 + local.get $1 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add @@ -874,7 +876,12 @@ local.get $0 call $~lib/math/NativeMath.asinh ) - (func $~lib/math/NativeMath.atan (; 12 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/builtins/isNaN (; 12 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.atan (; 13 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -893,8 +900,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -1046,10 +1052,13 @@ block $case1|0 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $case4|0 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $case4|0 end f64.const 0.4636476090008061 local.get $1 @@ -1097,11 +1106,11 @@ local.get $3 f64.copysign ) - (func $std/libm/atan (; 13 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/atan (; 14 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.atan ) - (func $~lib/math/NativeMath.atanh (; 14 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atanh (; 15 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 f64) @@ -1158,25 +1167,25 @@ local.get $0 f64.copysign ) - (func $std/libm/atanh (; 15 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/atanh (; 16 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.atanh ) - (func $~lib/math/NativeMath.atan2 (; 16 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.atan2 (; 17 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) (local $6 i32) (local $7 i32) - i32.const 1 - local.get $0 - local.get $0 - f64.ne local.get $1 - local.get $1 - f64.ne - select + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end if local.get $1 local.get $0 @@ -1189,20 +1198,21 @@ i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 + local.set $4 local.get $5 i32.wrap_i64 local.set $6 local.get $1 i64.reinterpret_f64 local.tee $5 - i32.wrap_i64 - local.tee $7 - local.get $5 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $4 + local.set $3 + local.get $5 + i32.wrap_i64 + local.tee $7 + local.get $3 i32.const 1072693248 i32.sub i32.or @@ -1212,24 +1222,24 @@ call $~lib/math/NativeMath.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 $4 i32.const 31 i32.shr_u i32.or local.set $2 - local.get $4 - i32.const 2147483647 - i32.and - local.set $4 local.get $3 i32.const 2147483647 i32.and - local.tee $3 + local.set $3 + local.get $4 + i32.const 2147483647 + i32.and + local.tee $4 local.get $6 i32.or i32.eqz @@ -1237,16 +1247,22 @@ block $break|0 block $case3|0 block $case2|0 - block $case1|0 + local.get $2 + i32.eqz + local.get $2 + i32.const 1 + i32.eq + i32.or + i32.eqz + if local.get $2 - i32.eqz - br_if $case1|0 - block $tablify|0 - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end + i32.const 2 + i32.eq + br_if $case2|0 + local.get $2 + i32.const 3 + i32.eq + br_if $case3|0 br $break|0 end local.get $0 @@ -1260,16 +1276,16 @@ end end block $folding-inner0 - local.get $4 + local.get $3 local.get $7 i32.or i32.eqz br_if $folding-inner0 - local.get $4 + local.get $3 i32.const 2146435072 i32.eq if - local.get $3 + local.get $4 i32.const 2146435072 i32.eq if @@ -1279,10 +1295,13 @@ block $case1|1 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|1 $case2|1 $case3|1 $break|1 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $tablify|0 + end + br $break|1 end f64.const 0.7853981633974483 return @@ -1303,10 +1322,13 @@ block $case1|2 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|2 $case2|2 $case3|2 $break|2 + block $tablify|00 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $tablify|00 + end + br $break|2 end f64.const 0 return @@ -1323,20 +1345,20 @@ end end i32.const 1 - local.get $3 + local.get $4 i32.const 2146435072 i32.eq - local.get $4 + local.get $3 i32.const 67108864 i32.add - local.get $3 + local.get $4 i32.lt_u select br_if $folding-inner0 - local.get $3 + local.get $4 i32.const 67108864 i32.add - local.get $4 + local.get $3 i32.lt_u i32.const 0 local.get $2 @@ -1359,10 +1381,13 @@ block $case1|3 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|3 $case2|3 $case3|3 $break|3 + block $tablify|01 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $tablify|01 + end + br $break|3 end local.get $0 return @@ -1394,12 +1419,12 @@ i32.and select ) - (func $std/libm/atan2 (; 17 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $std/libm/atan2 (; 18 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 ) - (func $~lib/math/NativeMath.cbrt (; 18 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cbrt (; 19 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -1521,20 +1546,25 @@ f64.mul f64.add ) - (func $std/libm/cbrt (; 19 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/cbrt (; 20 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.cbrt ) - (func $std/libm/ceil (; 20 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/ceil (; 21 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.ceil ) - (func $~lib/math/NativeMath.clz32 (; 21 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/builtins/isFinite (; 22 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 local.get $0 f64.sub f64.const 0 - f64.ne + f64.eq + ) + (func $~lib/math/NativeMath.clz32 (; 23 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + local.get $0 + call $~lib/builtins/isFinite + i32.eqz if f64.const 32 return @@ -1552,21 +1582,21 @@ i32.clz f64.convert_i32_s ) - (func $std/libm/clz32 (; 22 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/clz32 (; 24 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.clz32 ) - (func $std/libm/cos (; 23 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/cos (; 25 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) unreachable ) - (func $~lib/math/NativeMath.expm1 (; 24 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.expm1 (; 26 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) - (local $2 f64) - (local $3 i32) + (local $2 i32) + (local $3 f64) (local $4 f64) - (local $5 i32) + (local $5 f64) (local $6 i32) - (local $7 f64) + (local $7 i32) (local $8 i64) local.get $0 i64.reinterpret_f64 @@ -1574,25 +1604,24 @@ i64.const 63 i64.shr_u i32.wrap_i64 - local.set $6 + local.set $7 local.get $8 i64.const 32 i64.shr_u i64.const 2147483647 i64.and i32.wrap_i64 - local.tee $5 + local.tee $6 i32.const 1078159482 i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return end - local.get $6 + local.get $7 if f64.const -1 return @@ -1607,13 +1636,13 @@ return end end - local.get $5 + local.get $6 i32.const 1071001154 i32.gt_u if local.get $0 i32.const 1 - local.get $6 + local.get $7 i32.const 1 i32.shl i32.sub @@ -1625,11 +1654,11 @@ f64.copysign f64.add i32.trunc_f64_s - local.get $5 + local.get $6 i32.const 1072734898 i32.lt_u select - local.tee $3 + local.tee $2 f64.convert_i32_s local.tee $1 f64.const 0.6931471803691238 @@ -1646,9 +1675,9 @@ f64.sub local.get $1 f64.sub - local.set $7 + local.set $3 else - local.get $5 + local.get $6 i32.const 1016070144 i32.lt_u if @@ -1660,27 +1689,27 @@ f64.const 0.5 local.get $0 f64.mul - local.tee $2 - f64.mul local.tee $4 - local.get $4 + f64.mul + local.tee $5 + local.get $5 f64.mul local.set $1 f64.const 3 f64.const 1 - local.get $4 + local.get $5 f64.const -0.03333333333333313 f64.mul f64.add local.get $1 f64.const 1.5873015872548146e-03 - local.get $4 + local.get $5 f64.const -7.93650757867488e-05 f64.mul f64.add local.get $1 f64.const 4.008217827329362e-06 - local.get $4 + local.get $5 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -1689,58 +1718,58 @@ f64.mul f64.add local.tee $1 - local.get $2 + local.get $4 f64.mul f64.sub - local.set $2 - local.get $4 + local.set $4 + local.get $5 local.get $1 - local.get $2 + local.get $4 f64.sub f64.const 6 local.get $0 - local.get $2 + local.get $4 f64.mul f64.sub f64.div f64.mul local.set $1 - local.get $3 + local.get $2 i32.eqz if local.get $0 local.get $0 local.get $1 f64.mul - local.get $4 + local.get $5 f64.sub f64.sub return end local.get $0 local.get $1 - local.get $7 + local.get $3 f64.sub f64.mul - local.get $7 - f64.sub - local.get $4 - f64.sub - local.set $2 local.get $3 + f64.sub + local.get $5 + f64.sub + local.set $3 + local.get $2 i32.const -1 i32.eq if f64.const 0.5 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.const 0.5 f64.sub return end - local.get $3 + local.get $2 i32.const 1 i32.eq if @@ -1749,7 +1778,7 @@ f64.lt if f64.const -2 - local.get $2 + local.get $3 local.get $0 f64.const 0.5 f64.add @@ -1760,80 +1789,79 @@ f64.const 1 f64.const 2 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.add return end - local.get $3 + local.get $2 i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl f64.reinterpret_i64 - local.set $1 + local.set $4 i32.const 1 - local.get $3 + local.get $2 i32.const 56 i32.gt_s - local.get $3 + local.get $2 i32.const 0 i32.lt_s select if local.get $0 - local.get $2 + local.get $3 f64.sub f64.const 1 f64.add local.set $0 - local.get $3 + local.get $0 + f64.const 2 + f64.mul + f64.const 8988465674311579538646525e283 + f64.mul + local.get $0 + local.get $4 + f64.mul + local.get $2 i32.const 1024 i32.eq - if (result f64) - local.get $0 - f64.const 2 - f64.mul - f64.const 8988465674311579538646525e283 - f64.mul - else - local.get $0 - local.get $1 - f64.mul - end + select f64.const 1 f64.sub return end - local.get $0 - f64.const 1 i64.const 1023 - local.get $3 + local.get $2 i64.extend_i32_s i64.sub i64.const 52 i64.shl f64.reinterpret_i64 - local.tee $0 - f64.sub - local.get $2 - f64.sub - f64.const 1 - local.get $2 + local.set $1 local.get $0 - f64.add + f64.const 1 + local.get $1 f64.sub local.get $3 + f64.sub + f64.const 1 + local.get $3 + local.get $1 + f64.add + f64.sub + local.get $2 i32.const 20 i32.lt_s select f64.add - local.get $1 + local.get $4 f64.mul ) - (func $~lib/math/NativeMath.scalbn (; 25 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/NativeMath.scalbn (; 27 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) local.get $1 i32.const 1023 i32.gt_s @@ -1910,14 +1938,14 @@ f64.reinterpret_i64 f64.mul ) - (func $~lib/math/NativeMath.exp (; 26 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp (; 28 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 f64) (local $3 i32) (local $4 f64) (local $5 f64) - (local $6 i32) - (local $7 f64) + (local $6 f64) + (local $7 i32) local.get $0 i64.reinterpret_f64 i64.const 32 @@ -1926,7 +1954,7 @@ local.tee $1 i32.const 31 i32.shr_u - local.set $6 + local.set $7 local.get $1 i32.const 2147483647 i32.and @@ -1935,8 +1963,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -1979,36 +2006,37 @@ i32.trunc_f64_s else i32.const 1 - local.get $6 + local.get $7 i32.const 1 i32.shl i32.sub end local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 0.6931471803691238 f64.mul f64.sub - local.tee $4 - local.get $0 + local.tee $5 + local.get $1 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul - local.tee $7 + local.tee $4 f64.sub local.set $0 else local.get $3 i32.const 1043333120 - i32.le_u - if + i32.gt_u + if (result f64) + local.get $0 + else f64.const 1 local.get $0 f64.add return end - local.get $0 - local.set $4 + local.set $5 end local.get $0 local.get $0 @@ -2016,20 +2044,20 @@ local.tee $2 local.get $2 f64.mul - local.set $5 + local.set $6 f64.const 1 local.get $0 local.get $0 local.get $2 f64.const 0.16666666666666602 f64.mul - local.get $5 + local.get $6 f64.const -2.7777777777015593e-03 local.get $2 f64.const 6.613756321437934e-05 f64.mul f64.add - local.get $5 + local.get $6 f64.const -1.6533902205465252e-06 local.get $2 f64.const 4.1381367970572385e-08 @@ -2046,9 +2074,9 @@ local.get $0 f64.sub f64.div - local.get $7 - f64.sub local.get $4 + f64.sub + local.get $5 f64.add f64.add local.set $0 @@ -2062,7 +2090,7 @@ local.get $1 call $~lib/math/NativeMath.scalbn ) - (func $~lib/math/NativeMath.cosh (; 27 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cosh (; 29 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) local.get $0 @@ -2126,27 +2154,27 @@ f64.const 2247116418577894884661631e283 f64.mul ) - (func $std/libm/cosh (; 28 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/cosh (; 30 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.cosh ) - (func $std/libm/exp (; 29 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/exp (; 31 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.exp ) - (func $std/libm/expm1 (; 30 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/expm1 (; 32 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.expm1 ) - (func $std/libm/floor (; 31 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/floor (; 33 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.floor ) - (func $std/libm/fround (; 32 ;) (type $FUNCSIG$fd) (param $0 f64) (result f32) + (func $std/libm/fround (; 34 ;) (type $FUNCSIG$fd) (param $0 f64) (result f32) local.get $0 f32.demote_f64 ) - (func $~lib/math/NativeMath.hypot (; 33 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.hypot (; 35 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 f64) (local $4 i64) @@ -2319,21 +2347,17 @@ f64.sqrt f64.mul ) - (func $std/libm/hypot (; 34 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $std/libm/hypot (; 36 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot ) - (func $~lib/math/NativeMath.imul (; 35 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 f64) + (func $~lib/math/NativeMath.imul (; 37 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.add - local.tee $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if f64.const 0 return @@ -2361,16 +2385,16 @@ i32.mul f64.convert_i32_s ) - (func $std/libm/imul (; 36 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $std/libm/imul (; 38 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.imul ) - (func $std/libm/log (; 37 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/log (; 39 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log ) - (func $~lib/math/NativeMath.log10 (; 38 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log10 (; 40 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -2574,15 +2598,15 @@ local.get $1 f64.add ) - (func $std/libm/log10 (; 39 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/log10 (; 41 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log10 ) - (func $std/libm/log1p (; 40 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/log1p (; 42 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log1p ) - (func $~lib/math/NativeMath.log2 (; 41 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log2 (; 43 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -2779,21 +2803,21 @@ local.get $1 f64.add ) - (func $std/libm/log2 (; 42 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/log2 (; 44 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.log2 ) - (func $std/libm/max (; 43 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $std/libm/max (; 45 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.max ) - (func $std/libm/min (; 44 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $std/libm/min (; 46 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.min ) - (func $~lib/math/NativeMath.pow (; 45 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.pow (; 47 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) (local $3 f64) (local $4 i32) @@ -2847,37 +2871,33 @@ return end i32.const 1 + local.get $6 + i32.const 0 + i32.ne + i32.const 0 + local.get $8 + i32.const 2146435072 + i32.eq + select + i32.const 1 local.get $8 i32.const 2146435072 i32.gt_s + i32.const 1 + local.get $19 + i32.const 0 + i32.ne + i32.const 0 + local.get $4 + i32.const 2146435072 + i32.eq + select local.get $4 i32.const 2146435072 i32.gt_s - if (result i32) - i32.const 1 - else - local.get $19 - i32.const 0 - i32.ne - i32.const 0 - local.get $4 - i32.const 2146435072 - i32.eq - select - end select - if (result i32) - i32.const 1 - else - local.get $6 - i32.const 0 - i32.ne - i32.const 0 - local.get $8 - i32.const 2146435072 - i32.eq - select - end + select + select if local.get $0 local.get $1 @@ -3141,44 +3161,40 @@ i32.const 1072693247 i32.lt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.lt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end local.get $4 i32.const 1072693248 i32.gt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.gt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end local.get $3 @@ -3499,7 +3515,6 @@ i32.sub local.get $5 i32.or - br_if $folding-inner0 local.get $1 f64.const 8.008566259537294e-17 f64.add @@ -3507,6 +3522,7 @@ local.get $2 f64.sub f64.gt + i32.or br_if $folding-inner0 else local.get $12 @@ -3520,12 +3536,12 @@ i32.sub local.get $5 i32.or - br_if $folding-inner1 local.get $1 local.get $0 local.get $2 f64.sub f64.le + i32.or br_if $folding-inner1 end end @@ -3713,12 +3729,12 @@ f64.const 1e-300 f64.mul ) - (func $std/libm/pow (; 46 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $std/libm/pow (; 48 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 call $~lib/math/NativeMath.pow ) - (func $std/libm/round (; 47 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/round (; 49 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.const 0.5 f64.add @@ -3726,25 +3742,20 @@ local.get $0 f64.copysign ) - (func $std/libm/sign (; 48 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/sign (; 50 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 + f64.abs f64.const 0 f64.gt if f64.const 1 - local.set $0 - else local.get $0 - f64.const 0 - f64.lt - if - f64.const -1 - local.set $0 - end + f64.copysign + local.set $0 end local.get $0 ) - (func $~lib/math/NativeMath.sinh (; 49 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sinh (; 51 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 i32) @@ -3821,15 +3832,15 @@ f64.mul f64.mul ) - (func $std/libm/sinh (; 50 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/sinh (; 52 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.sinh ) - (func $std/libm/sqrt (; 51 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/sqrt (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.sqrt ) - (func $~lib/math/NativeMath.tanh (; 52 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tanh (; 54 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -3908,15 +3919,15 @@ local.get $0 f64.copysign ) - (func $std/libm/tanh (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/tanh (; 55 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 call $~lib/math/NativeMath.tanh ) - (func $std/libm/trunc (; 54 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $std/libm/trunc (; 56 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.trunc ) - (func $null (; 55 ;) (type $FUNCSIG$v) + (func $null (; 57 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index d3a8a435..2c3e1cd4 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1754,7 +1754,14 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash8 (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/map/Map#find (; 29 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -1797,7 +1804,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -1805,15 +1812,12 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/rt/pure/__retainRelease (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/__retainRelease (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.ne @@ -1839,7 +1843,7 @@ end local.get $1 ) - (func $~lib/rt/pure/__release (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/__release (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 508 i32.gt_u @@ -1850,7 +1854,7 @@ call $~lib/rt/pure/decrement end ) - (func $~lib/map/Map#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1909,10 +1913,7 @@ local.get $2 local.get $3 i32.load8_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 @@ -1964,24 +1965,19 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 33 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 34 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $5 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash8 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -2066,7 +2062,7 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -2074,10 +2070,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -2087,7 +2080,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -2096,10 +2089,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -2153,7 +2143,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 36 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 37 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -2499,7 +2489,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 37 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 38 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 4 @@ -2527,21 +2517,18 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#has (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2600,10 +2587,7 @@ local.get $2 local.get $3 i32.load8_u - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 @@ -2655,22 +2639,17 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 40 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 41 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $5 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash8 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -2755,16 +2734,13 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -2774,17 +2750,14 @@ unreachable end ) - (func $~lib/map/Map#delete (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -2838,7 +2811,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 43 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 44 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -3170,7 +3143,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 44 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 45 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 5 @@ -3198,7 +3171,22 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 45 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash16 (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + local.get $0 + i32.const 8 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/map/Map#find (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -3241,7 +3229,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -3249,24 +3237,12 @@ i32.shl i32.const 16 i32.shr_s - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3287,7 +3263,7 @@ f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor @@ -3300,12 +3276,12 @@ i32.const 12 i32.mul i32.add - local.set $8 + local.set $7 local.get $5 local.set $2 loop $continue|0 local.get $3 - local.get $8 + local.get $7 i32.ne if local.get $3 @@ -3325,29 +3301,17 @@ local.get $2 local.get $3 i32.load16_s - local.tee $6 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $6 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $4 i32.add - local.tee $6 + local.tee $8 i32.load i32.store offset=8 - local.get $6 + local.get $8 local.get $2 i32.store local.get $2 @@ -3378,7 +3342,7 @@ call $~lib/rt/pure/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 @@ -3389,33 +3353,19 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 50 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - local.tee $3 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $3 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $5 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash16 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -3500,7 +3450,7 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -3508,19 +3458,7 @@ i32.shl i32.const 16 i32.shr_s - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -3530,7 +3468,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 50 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -3539,19 +3477,7 @@ i32.shl i32.const 16 i32.shr_s - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -3605,7 +3531,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 51 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 53 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -3951,7 +3877,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 52 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 54 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 6 @@ -3979,30 +3905,18 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#has (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 56 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4023,7 +3937,7 @@ f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 12 i32.mul call $~lib/arraybuffer/ArrayBuffer#constructor @@ -4036,12 +3950,12 @@ i32.const 12 i32.mul i32.add - local.set $8 + local.set $7 local.get $5 local.set $2 loop $continue|0 local.get $3 - local.get $8 + local.get $7 i32.ne if local.get $3 @@ -4061,29 +3975,17 @@ local.get $2 local.get $3 i32.load16_u - local.tee $6 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $6 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $4 i32.add - local.tee $6 + local.tee $8 i32.load i32.store offset=8 - local.get $6 + local.get $8 local.get $2 i32.store local.get $2 @@ -4114,7 +4016,7 @@ call $~lib/rt/pure/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 @@ -4125,31 +4027,17 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 55 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 57 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $3 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $3 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $5 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash16 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -4234,25 +4122,13 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $0 if (result i32) @@ -4262,26 +4138,14 @@ unreachable end ) - (func $~lib/map/Map#delete (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 59 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -4335,7 +4199,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 58 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 60 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -4667,7 +4531,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 59 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 61 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 7 @@ -4695,7 +4559,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 60 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -4726,7 +4590,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -4767,7 +4631,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 64 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -4776,7 +4640,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 65 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4887,7 +4751,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 64 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 66 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4980,7 +4844,7 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 65 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -4994,7 +4858,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 66 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#delete (; 68 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -5053,7 +4917,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 67 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 69 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -5371,7 +5235,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 68 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 70 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 8 @@ -5399,7 +5263,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $std/map/testNumeric (; 69 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 71 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -5717,7 +5581,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#clear (; 70 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 72 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load @@ -5745,7 +5609,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 71 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 73 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 9 @@ -5773,7 +5637,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 72 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 74 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 @@ -5839,7 +5703,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 73 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 75 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -5880,7 +5744,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 74 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 76 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 @@ -5889,7 +5753,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 75 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 77 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6000,7 +5864,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 76 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 78 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -6093,7 +5957,7 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 77 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 79 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 @@ -6107,7 +5971,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 78 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/map/Map#delete (; 80 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) local.get $0 @@ -6167,7 +6031,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 79 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 81 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/map/Map#constructor @@ -6492,7 +6356,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 80 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 82 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 10 @@ -6520,7 +6384,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $std/map/testNumeric (; 81 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 83 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/map/Map#constructor @@ -6845,7 +6709,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 82 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 84 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 11 @@ -6873,7 +6737,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 83 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 85 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -6914,7 +6778,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 84 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#has (; 86 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 local.get $1 local.get $1 @@ -6924,7 +6788,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 85 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7036,7 +6900,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 86 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/map/Map#set (; 88 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -7130,7 +6994,7 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 87 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#get (; 89 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 local.get $1 local.get $1 @@ -7145,7 +7009,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 88 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/map/Map#delete (; 90 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 i32) (local $3 i32) local.get $0 @@ -7206,7 +7070,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 89 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 91 ;) (type $FUNCSIG$v) (local $0 f32) (local $1 i32) call $~lib/map/Map#constructor @@ -7531,7 +7395,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#constructor (; 90 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 92 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 12 @@ -7559,7 +7423,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 91 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 93 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -7600,7 +7464,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 92 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#has (; 94 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) local.get $0 local.get $1 local.get $1 @@ -7610,7 +7474,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 93 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 95 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7722,7 +7586,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/map/Map#set (; 94 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/map/Map#set (; 96 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -7816,7 +7680,7 @@ call $~lib/rt/pure/__release end ) - (func $~lib/map/Map#get (; 95 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#get (; 97 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) local.get $0 local.get $1 local.get $1 @@ -7831,7 +7695,7 @@ unreachable end ) - (func $~lib/map/Map#delete (; 96 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/map/Map#delete (; 98 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) local.get $0 @@ -7892,7 +7756,7 @@ call $~lib/map/Map#rehash end ) - (func $std/map/testNumeric (; 97 ;) (type $FUNCSIG$v) + (func $std/map/testNumeric (; 99 ;) (type $FUNCSIG$v) (local $0 f64) (local $1 i32) call $~lib/map/Map#constructor @@ -8217,7 +8081,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $start (; 98 ;) (type $FUNCSIG$v) + (func $start (; 100 ;) (type $FUNCSIG$v) call $std/map/testNumeric call $std/map/testNumeric call $std/map/testNumeric @@ -8229,7 +8093,7 @@ call $std/map/testNumeric call $std/map/testNumeric ) - (func $~lib/rt/pure/markGray (; 99 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/markGray (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -8253,7 +8117,7 @@ call $~lib/rt/__visit_members end ) - (func $~lib/rt/pure/scanBlack (; 100 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scanBlack (; 102 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load offset=4 @@ -8266,7 +8130,7 @@ i32.const 4 call $~lib/rt/__visit_members ) - (func $~lib/rt/pure/scan (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scan (; 103 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -8300,7 +8164,7 @@ end end ) - (func $~lib/rt/pure/collectWhite (; 102 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/collectWhite (; 104 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -8328,7 +8192,7 @@ local.get $0 call $~lib/rt/tlsf/freeBlock ) - (func $~lib/rt/pure/__visit (; 103 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 105 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i32.const 508 i32.lt_u @@ -8438,7 +8302,7 @@ unreachable end ) - (func $~lib/rt/__visit_members (; 104 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 106 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $folding-inner0 block $switch$1$default block $switch$1$case$4 @@ -8472,7 +8336,7 @@ local.get $1 call $~lib/rt/pure/__visit ) - (func $null (; 105 ;) (type $FUNCSIG$v) + (func $null (; 107 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index b58f8cbe..6424aa1a 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -1,7 +1,9 @@ (module (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$dddd (func (param f64 f64 f64) (result f64))) (type $FUNCSIG$ddi (func (param f64 i32) (result f64))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$ffff (func (param f32 f32 f32) (result f32))) (type $FUNCSIG$ffi (func (param f32 i32) (result f32))) (type $FUNCSIG$dd (func (param f64) (result f64))) @@ -10,6 +12,7 @@ (type $FUNCSIG$fff (func (param f32 f32) (result f32))) (type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$vj (func (param i64))) + (type $FUNCSIG$jj (func (param i64) (result i64))) (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$f (func (result f32))) (type $FUNCSIG$jji (func (param i64 i32) (result i64))) @@ -22,6 +25,7 @@ (type $FUNCSIG$iff (func (param f32 f32) (result i32))) (type $FUNCSIG$idddd (func (param f64 f64 f64 f64) (result i32))) (type $FUNCSIG$iffff (func (param f32 f32 f32 f32) (result i32))) + (type $FUNCSIG$ji (func (param i32) (result i64))) (import "Math" "E" (global $~lib/bindings/Math/E f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN10" (global $~lib/bindings/Math/LN10 f64)) @@ -73,7 +77,19 @@ (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) (export "memory" (memory $0)) (start $start) - (func $~lib/math/NativeMath.scalbn (; 30 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/builtins/isNaN (; 30 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/builtins/isFinite (; 31 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.sub + f64.const 0 + f64.eq + ) + (func $~lib/math/NativeMath.scalbn (; 32 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) local.get $1 i32.const 1023 i32.gt_s @@ -150,16 +166,16 @@ f64.reinterpret_i64 f64.mul ) - (func $std/math/ulperr (; 31 ;) (type $FUNCSIG$dddd) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) + (func $std/math/ulperr (; 33 ;) (type $FUNCSIG$dddd) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) (local $3 i32) - local.get $1 - local.get $1 - f64.ne - i32.const 0 local.get $0 - local.get $0 - f64.ne - select + call $~lib/builtins/isNaN + if (result i32) + local.get $1 + call $~lib/builtins/isNaN + else + i32.const 0 + end if f64.const 0 return @@ -199,10 +215,8 @@ return end local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if local.get $1 f64.const 0.5 @@ -242,7 +256,7 @@ local.get $2 f64.add ) - (func $std/math/check (; 32 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/check (; 34 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.eq @@ -251,12 +265,10 @@ return end local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN return end local.get $0 @@ -272,7 +284,12 @@ end i32.const 1 ) - (func $~lib/math/NativeMathf.scalbn (; 33 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/builtins/isNaN (; 35 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.scalbn (; 36 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) local.get $1 i32.const 127 i32.gt_s @@ -348,16 +365,16 @@ f32.reinterpret_i32 f32.mul ) - (func $std/math/ulperrf (; 34 ;) (type $FUNCSIG$ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) + (func $std/math/ulperrf (; 37 ;) (type $FUNCSIG$ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32) (local $3 i32) - local.get $1 - local.get $1 - f32.ne - i32.const 0 local.get $0 - local.get $0 - f32.ne - select + call $~lib/builtins/isNaN + if (result i32) + local.get $1 + call $~lib/builtins/isNaN + else + i32.const 0 + end if f32.const 0 return @@ -437,7 +454,7 @@ local.get $2 f32.add ) - (func $std/math/check (; 35 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/check (; 38 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.eq @@ -446,12 +463,10 @@ return end local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f32.ne + call $~lib/builtins/isNaN return end local.get $0 @@ -467,7 +482,7 @@ end i32.const 1 ) - (func $std/math/test_scalbn (; 36 ;) (type $FUNCSIG$idid) (param $0 f64) (param $1 i32) (param $2 f64) (result i32) + (func $std/math/test_scalbn (; 39 ;) (type $FUNCSIG$idid) (param $0 f64) (param $1 i32) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.scalbn @@ -475,7 +490,7 @@ f64.const 0 call $std/math/check ) - (func $std/math/test_scalbnf (; 37 ;) (type $FUNCSIG$ifif) (param $0 f32) (param $1 i32) (param $2 f32) (result i32) + (func $std/math/test_scalbnf (; 40 ;) (type $FUNCSIG$ifif) (param $0 f32) (param $1 i32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.scalbn @@ -483,7 +498,7 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_abs (; 38 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_abs (; 41 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.abs local.get $1 @@ -499,14 +514,14 @@ i32.const 0 end ) - (func $std/math/test_absf (; 39 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_absf (; 42 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.abs local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/R (; 40 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/R (; 43 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 f64.const 0.16666666666666666 local.get $0 @@ -549,7 +564,7 @@ f64.add f64.div ) - (func $~lib/math/NativeMath.acos (; 41 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acos (; 44 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) @@ -673,7 +688,7 @@ f64.add f64.mul ) - (func $std/math/test_acos (; 42 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_acos (; 45 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.acos local.get $1 @@ -689,7 +704,26 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.acos (; 43 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/Rf (; 46 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + local.get $0 + f32.const 0.16666586697101593 + local.get $0 + f32.const -0.04274342209100723 + local.get $0 + f32.const -0.008656363002955914 + f32.mul + f32.add + f32.mul + f32.add + f32.mul + f32.const 1 + local.get $0 + f32.const -0.7066296339035034 + f32.mul + f32.add + f32.div + ) + (func $~lib/math/NativeMathf.acos (; 47 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) @@ -742,23 +776,7 @@ local.get $0 local.get $0 f32.mul - local.tee $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div + call $~lib/math/Rf f32.mul f32.sub f32.sub @@ -769,36 +787,19 @@ i32.const 31 i32.shr_u if - f32.const 0.5 - local.get $0 - f32.const 0.5 - f32.mul - f32.add - local.tee $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div - local.set $1 f32.const 2 f32.const 1.570796251296997 + f32.const 0.5 local.get $0 - f32.sqrt + f32.const 0.5 + f32.mul + f32.add local.tee $0 - local.get $1 + f32.sqrt + local.tee $1 local.get $0 + call $~lib/math/Rf + local.get $1 f32.mul f32.const 7.549789415861596e-08 f32.sub @@ -813,54 +814,39 @@ f32.const 0.5 f32.mul f32.sub - local.tee $0 + local.tee $1 f32.sqrt local.tee $4 i32.reinterpret_f32 i32.const -4096 i32.and f32.reinterpret_i32 - local.tee $1 - local.get $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div + local.tee $0 + local.get $1 + call $~lib/math/Rf local.get $4 f32.mul + local.get $1 + local.get $0 local.get $0 - local.get $1 - local.get $1 f32.mul f32.sub local.get $4 - local.get $1 + local.get $0 f32.add f32.div f32.add f32.add f32.mul ) - (func $std/math/test_acosf (; 44 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_acosf (; 48 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.acos local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.log1p (; 45 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log1p (; 49 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i32) @@ -1059,7 +1045,7 @@ f64.mul f64.add ) - (func $~lib/math/NativeMath.log (; 46 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log (; 50 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) (local $3 f64) @@ -1215,8 +1201,8 @@ i32.sub local.get $5 i32.add + local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 1.9082149292705877e-10 f64.mul f64.add @@ -1224,12 +1210,13 @@ f64.sub local.get $3 f64.add - local.get $0 + local.get $1 + f64.convert_i32_s f64.const 0.6931471803691238 f64.mul f64.add ) - (func $~lib/math/NativeMath.acosh (; 47 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.acosh (; 51 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) local.get $0 i64.reinterpret_f64 @@ -1283,7 +1270,7 @@ f64.const 0.6931471805599453 f64.add ) - (func $std/math/test_acosh (; 48 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_acosh (; 52 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.acosh local.get $1 @@ -1299,7 +1286,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log1p (; 49 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log1p (; 53 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 i32) @@ -1469,7 +1456,7 @@ f32.mul f32.add ) - (func $~lib/math/NativeMathf.log (; 50 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log (; 54 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -1603,7 +1590,7 @@ f32.mul f32.add ) - (func $~lib/math/NativeMathf.acosh (; 51 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.acosh (; 55 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) local.get $0 i32.reinterpret_f32 @@ -1653,14 +1640,14 @@ f32.const 0.6931471824645996 f32.add ) - (func $std/math/test_acoshf (; 52 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_acoshf (; 56 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.acosh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.asin (; 53 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asin (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -1798,7 +1785,7 @@ end local.get $0 ) - (func $std/math/test_asin (; 54 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_asin (; 58 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.asin local.get $1 @@ -1814,11 +1801,10 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.asin (; 55 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asin (; 59 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) - (local $3 f32) - (local $4 f64) + (local $3 f64) local.get $0 i32.reinterpret_f32 i32.const 2147483647 @@ -1866,27 +1852,13 @@ local.get $0 local.get $0 f32.mul - local.tee $0 - f32.const 0.16666586697101593 - local.get $0 - f32.const -0.04274342209100723 - local.get $0 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $0 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div + call $~lib/math/Rf f32.mul f32.add return end + f64.const 1.5707963705062866 + f64.const 2 f32.const 0.5 local.get $0 f32.abs @@ -1894,31 +1866,12 @@ f32.mul f32.sub local.tee $2 - f32.const 0.16666586697101593 - local.get $2 - f32.const -0.04274342209100723 - local.get $2 - f32.const -0.008656363002955914 - f32.mul - f32.add - f32.mul - f32.add - f32.mul - f32.const 1 - local.get $2 - f32.const -0.7066296339035034 - f32.mul - f32.add - f32.div - local.set $3 - f64.const 1.5707963705062866 - f64.const 2 - local.get $2 f64.promote_f32 f64.sqrt - local.tee $4 - local.get $4 + local.tee $3 local.get $3 + local.get $2 + call $~lib/math/Rf f64.promote_f32 f64.mul f64.add @@ -1928,14 +1881,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_asinf (; 56 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_asinf (; 60 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.asin local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.asinh (; 57 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.asinh (; 61 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) local.get $0 @@ -2005,7 +1958,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_asinh (; 58 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_asinh (; 62 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.asinh local.get $1 @@ -2021,7 +1974,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.asinh (; 59 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.asinh (; 63 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -2086,14 +2039,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_asinhf (; 60 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_asinhf (; 64 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.asinh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atan (; 61 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atan (; 65 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -2112,8 +2065,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -2265,10 +2217,13 @@ block $case1|0 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $case4|0 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $case4|0 end f64.const 0.4636476090008061 local.get $1 @@ -2316,7 +2271,7 @@ local.get $3 f64.copysign ) - (func $std/math/test_atan (; 62 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_atan (; 66 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.atan local.get $1 @@ -2332,13 +2287,13 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atan (; 63 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atan (; 67 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) (local $4 f32) local.get $0 - local.set $3 + local.set $4 local.get $0 i32.reinterpret_f32 i32.const 2147483647 @@ -2348,14 +2303,13 @@ i32.ge_u if local.get $0 - local.get $0 - f32.ne + call $~lib/builtins/isNaN if local.get $0 return end f32.const 1.570796251296997 - local.get $3 + local.get $4 f32.copysign return end @@ -2435,25 +2389,25 @@ local.get $0 local.get $0 f32.mul - local.tee $4 - local.get $4 + local.tee $2 + local.get $2 f32.mul - local.set $2 + local.set $3 local.get $0 - local.get $4 + local.get $2 f32.const 0.333333283662796 - local.get $2 + local.get $3 f32.const 0.14253635704517365 - local.get $2 + local.get $3 f32.const 0.06168760731816292 f32.mul f32.add f32.mul f32.add f32.mul - local.get $2 + local.get $3 f32.const -0.19999158382415771 - local.get $2 + local.get $3 f32.const -0.106480173766613 f32.mul f32.add @@ -2477,10 +2431,13 @@ block $case1|0 local.get $1 if - local.get $1 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $case4|0 + block $tablify|0 + local.get $1 + i32.const 1 + i32.sub + br_table $case1|0 $case2|0 $case3|0 $tablify|0 + end + br $case4|0 end f32.const 0.46364760398864746 local.get $2 @@ -2525,17 +2482,17 @@ unreachable end local.get $0 - local.get $3 + local.get $4 f32.copysign ) - (func $std/math/test_atanf (; 64 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_atanf (; 68 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.atan local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atanh (; 65 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.atanh (; 69 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i64) (local $3 f64) @@ -2592,7 +2549,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_atanh (; 66 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_atanh (; 70 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.atanh local.get $1 @@ -2608,7 +2565,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atanh (; 67 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.atanh (; 71 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -2658,28 +2615,28 @@ local.get $0 f32.copysign ) - (func $std/math/test_atanhf (; 68 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_atanhf (; 72 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.atanh local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.atan2 (; 69 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.atan2 (; 73 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) (local $6 i32) (local $7 i32) - i32.const 1 - local.get $0 - local.get $0 - f64.ne local.get $1 - local.get $1 - f64.ne - select + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end if local.get $1 local.get $0 @@ -2692,20 +2649,21 @@ i64.const 32 i64.shr_u i32.wrap_i64 - local.set $3 + local.set $4 local.get $5 i32.wrap_i64 local.set $6 local.get $1 i64.reinterpret_f64 local.tee $5 - i32.wrap_i64 - local.tee $7 - local.get $5 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $4 + local.set $3 + local.get $5 + i32.wrap_i64 + local.tee $7 + local.get $3 i32.const 1072693248 i32.sub i32.or @@ -2715,24 +2673,24 @@ call $~lib/math/NativeMath.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 $4 i32.const 31 i32.shr_u i32.or local.set $2 - local.get $4 - i32.const 2147483647 - i32.and - local.set $4 local.get $3 i32.const 2147483647 i32.and - local.tee $3 + local.set $3 + local.get $4 + i32.const 2147483647 + i32.and + local.tee $4 local.get $6 i32.or i32.eqz @@ -2740,16 +2698,22 @@ block $break|0 block $case3|0 block $case2|0 - block $case1|0 + local.get $2 + i32.eqz + local.get $2 + i32.const 1 + i32.eq + i32.or + i32.eqz + if local.get $2 - i32.eqz - br_if $case1|0 - block $tablify|0 - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end + i32.const 2 + i32.eq + br_if $case2|0 + local.get $2 + i32.const 3 + i32.eq + br_if $case3|0 br $break|0 end local.get $0 @@ -2763,16 +2727,16 @@ end end block $folding-inner0 - local.get $4 + local.get $3 local.get $7 i32.or i32.eqz br_if $folding-inner0 - local.get $4 + local.get $3 i32.const 2146435072 i32.eq if - local.get $3 + local.get $4 i32.const 2146435072 i32.eq if @@ -2782,10 +2746,13 @@ block $case1|1 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|1 $case2|1 $case3|1 $break|1 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $tablify|0 + end + br $break|1 end f64.const 0.7853981633974483 return @@ -2806,10 +2773,13 @@ block $case1|2 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|2 $case2|2 $case3|2 $break|2 + block $tablify|00 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $tablify|00 + end + br $break|2 end f64.const 0 return @@ -2826,20 +2796,20 @@ end end i32.const 1 - local.get $3 + local.get $4 i32.const 2146435072 i32.eq - local.get $4 + local.get $3 i32.const 67108864 i32.add - local.get $3 + local.get $4 i32.lt_u select br_if $folding-inner0 - local.get $3 + local.get $4 i32.const 67108864 i32.add - local.get $4 + local.get $3 i32.lt_u i32.const 0 local.get $2 @@ -2862,10 +2832,13 @@ block $case1|3 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|3 $case2|3 $case3|3 $break|3 + block $tablify|01 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $tablify|01 + end + br $break|3 end local.get $0 return @@ -2897,7 +2870,7 @@ i32.and select ) - (func $std/math/test_atan2 (; 70 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) + (func $std/math/test_atan2 (; 74 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.atan2 @@ -2915,18 +2888,18 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.atan2 (; 71 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.atan2 (; 75 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) - i32.const 1 - local.get $0 - local.get $0 - f32.ne local.get $1 - local.get $1 - f32.ne - select + call $~lib/builtins/isNaN + if (result i32) + i32.const 1 + else + local.get $0 + call $~lib/builtins/isNaN + end if local.get $1 local.get $0 @@ -2969,16 +2942,22 @@ block $break|0 block $case3|0 block $case2|0 - block $case1|0 + local.get $2 + i32.eqz + local.get $2 + i32.const 1 + i32.eq + i32.or + i32.eqz + if local.get $2 - i32.eqz - br_if $case1|0 - block $tablify|0 - local.get $2 - i32.const 1 - i32.sub - br_table $case1|0 $case2|0 $case3|0 $tablify|0 - end + i32.const 2 + i32.eq + br_if $case2|0 + local.get $2 + i32.const 3 + i32.eq + br_if $case3|0 br $break|0 end local.get $0 @@ -3009,10 +2988,13 @@ block $case1|1 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|1 $case2|1 $case3|1 $break|1 + block $tablify|0 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|1 $case2|1 $case3|1 $tablify|0 + end + br $break|1 end f32.const 0.7853981852531433 return @@ -3033,10 +3015,13 @@ block $case1|2 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|2 $case2|2 $case3|2 $break|2 + block $tablify|00 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|2 $case2|2 $case3|2 $tablify|00 + end + br $break|2 end f32.const 0 return @@ -3089,10 +3074,13 @@ block $case1|3 local.get $2 if - local.get $2 - i32.const 1 - i32.sub - br_table $case1|3 $case2|3 $case3|3 $break|3 + block $tablify|01 + local.get $2 + i32.const 1 + i32.sub + br_table $case1|3 $case2|3 $case3|3 $tablify|01 + end + br $break|3 end local.get $0 return @@ -3124,7 +3112,7 @@ i32.and select ) - (func $std/math/test_atan2f (; 72 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_atan2f (; 76 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.atan2 @@ -3132,7 +3120,7 @@ local.get $3 call $std/math/check ) - (func $~lib/math/NativeMath.cbrt (; 73 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cbrt (; 77 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 f64) @@ -3254,7 +3242,7 @@ f64.mul f64.add ) - (func $std/math/test_cbrt (; 74 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_cbrt (; 78 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.cbrt local.get $1 @@ -3270,16 +3258,14 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.cbrt (; 75 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cbrt (; 79 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f64) (local $2 f64) (local $3 i32) - (local $4 f64) - (local $5 i32) - (local $6 f64) + (local $4 i32) local.get $0 i32.reinterpret_f32 - local.tee $5 + local.tee $4 i32.const 2147483647 i32.and local.tee $3 @@ -3305,7 +3291,7 @@ f32.const 16777216 f32.mul i32.reinterpret_f32 - local.tee $5 + local.tee $4 i32.const 2147483647 i32.and i32.const 3 @@ -3319,7 +3305,7 @@ i32.const 709958130 i32.add end - local.get $5 + local.get $4 i32.const -2147483648 i32.and i32.or @@ -3334,46 +3320,51 @@ local.get $1 local.get $0 f64.promote_f32 - local.tee $1 - local.get $1 + local.get $0 + f64.promote_f32 f64.add - local.tee $6 local.get $2 f64.add f64.mul - local.get $1 + local.get $0 + f64.promote_f32 local.get $2 f64.add local.get $2 f64.add f64.div - local.tee $2 - local.get $2 - f64.mul - local.get $2 - f64.mul - local.set $4 - local.get $2 - local.get $6 - local.get $4 - f64.add + local.tee $1 + local.get $1 f64.mul local.get $1 - local.get $4 + f64.mul + local.set $2 + local.get $1 + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 f64.add - local.get $4 + local.get $2 + f64.add + f64.mul + local.get $0 + f64.promote_f32 + local.get $2 + f64.add + local.get $2 f64.add f64.div f32.demote_f64 ) - (func $std/math/test_cbrtf (; 76 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_cbrtf (; 80 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cbrt local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_ceil (; 77 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_ceil (; 81 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.ceil local.get $1 @@ -3389,427 +3380,72 @@ i32.const 0 end ) - (func $std/math/test_ceilf (; 78 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_ceilf (; 82 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.ceil local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMathf.cos (; 79 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/array/Array#__unchecked_get (; 83 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64) + i32.const 116 + i32.load + local.get $0 + i32.const 3 + i32.shl + i32.add + i64.load + ) + (func $~lib/math/NativeMathf.cos (; 84 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f64) - (local $2 f64) - (local $3 i32) - (local $4 i64) - (local $5 i32) - (local $6 i32) - (local $7 f64) - (local $8 i64) - (local $9 i32) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i64) + (local $6 i64) + (local $7 i32) + (local $8 i32) + (local $9 i64) (local $10 i64) - (local $11 i64) local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 31 i32.shr_u - local.set $6 - block $folding-inner1 - block $folding-inner0 - local.get $3 - i32.const 2147483647 - i32.and - local.tee $3 - i32.const 1061752794 - i32.le_u - if - local.get $3 - i32.const 964689920 - i32.lt_u - if - f32.const 1 - return - end - local.get $0 - f64.promote_f32 - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - br $folding-inner0 - end - local.get $3 - i32.const 1081824209 - i32.le_u - if - local.get $3 - i32.const 1075235811 - i32.gt_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 3.141592653589793 - f64.add - local.get $1 - f64.const 3.141592653589793 - f64.sub - local.get $6 - select - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - f32.neg - return - else - local.get $6 - if (result f64) - local.get $0 - f64.promote_f32 - f64.const 1.5707963267948966 - f64.add - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - else - f64.const 1.5707963267948966 - local.get $0 - f64.promote_f32 - f64.sub - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - end - local.set $7 - br $folding-inner1 - end - unreachable - end - local.get $3 - i32.const 1088565717 - i32.le_u - if - local.get $3 - i32.const 1085271519 - i32.gt_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 6.283185307179586 - f64.add - local.get $1 - f64.const 6.283185307179586 - f64.sub - local.get $6 - select - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - br $folding-inner0 - else - local.get $6 - if (result f64) - local.get $0 - f32.neg - f64.promote_f32 - f64.const 4.71238898038469 - f64.sub - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - else - local.get $0 - f64.promote_f32 - f64.const 4.71238898038469 - f64.sub - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - end - local.set $7 - br $folding-inner1 - end - unreachable - end - local.get $3 - i32.const 2139095040 - i32.ge_u - if - local.get $0 - local.get $0 - f32.sub - return - end - block $~lib/math/rempio2f|inlined.0 (result i32) - local.get $3 - i32.const 1305022427 - i32.lt_u - if - local.get $0 - f64.promote_f32 - local.tee $2 - f64.const 0.6366197723675814 - f64.mul - f64.nearest - local.set $1 - local.get $2 - local.get $1 - f64.const 1.5707963109016418 - f64.mul - f64.sub - local.get $1 - f64.const 1.5893254773528196e-08 - f64.mul - f64.sub - global.set $~lib/math/rempio2f_y - local.get $1 - i32.trunc_f64_s - br $~lib/math/rempio2f|inlined.0 - end - i32.const 116 - i32.load - local.get $3 - i32.const 23 - i32.shr_s - i32.const 152 - i32.sub - local.tee $5 - i32.const 6 - i32.shr_s - local.tee $9 - i32.const 3 - i32.shl - i32.add - i64.load - local.set $10 - i32.const 116 - i32.load - local.get $9 - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load - local.set $4 - local.get $5 - i32.const 63 - i32.and - local.tee $5 - i32.const 32 - i32.gt_s - if (result i64) - local.get $4 - local.get $5 - i32.const 32 - i32.sub - i64.extend_i32_s - i64.shl - i32.const 116 - i32.load - local.get $9 - i32.const 2 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load - i64.const 96 - local.get $5 - i64.extend_i32_s - i64.sub - i64.shr_u - i64.or - else - local.get $4 - i64.const 32 - local.get $5 - i64.extend_i32_s - i64.sub - i64.shr_u - end - local.set $8 - f64.const 8.515303950216386e-20 - local.get $0 - f64.promote_f32 - f64.copysign - local.get $3 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or - i64.extend_i32_s - local.tee $11 - local.get $4 - i64.const 64 - local.get $5 - i64.extend_i32_s - local.tee $4 - i64.sub - i64.shr_u - local.get $10 - local.get $4 - i64.shl - i64.or - i64.mul - local.get $8 - local.get $11 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $4 - i64.const 2 - i64.shl - local.tee $8 - f64.convert_i64_s - f64.mul - global.set $~lib/math/rempio2f_y - i32.const 0 - local.get $4 - i64.const 62 - i64.shr_u - local.get $8 - i64.const 63 - i64.shr_u - i64.add - i32.wrap_i64 - local.tee $3 - i32.sub - local.get $3 - local.get $6 - select - end - local.set $3 - global.get $~lib/math/rempio2f_y - local.set $1 - local.get $3 - i32.const 1 - i32.and - if (result f32) - local.get $1 - local.get $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.tee $1 - f64.const -0.16666666641626524 - local.get $2 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $1 - local.get $2 - local.get $2 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $2 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - else - local.get $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - end - local.set $0 - local.get $0 - f32.neg - local.get $0 - local.get $3 - i32.const 1 - i32.add - i32.const 2 - i32.and - select + local.set $8 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + f32.const 1 return end + local.get $0 + f64.promote_f32 + local.tee $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 f64.const 1 local.get $1 f64.const -0.499999997251031 f64.mul f64.add - local.get $2 + local.get $3 f64.const 0.04166662332373906 f64.mul f64.add - local.get $2 + local.get $3 local.get $1 f64.mul f64.const -0.001388676377460993 @@ -3823,43 +3459,230 @@ return end local.get $2 - local.get $7 - f64.const -0.16666666641626524 - local.get $1 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $7 - local.get $1 - local.get $1 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $1 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.0 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.0 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $7 + call $~lib/array/Array#__unchecked_get + local.set $9 + local.get $7 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $5 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $5 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $7 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $5 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $6 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $10 + local.get $9 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $5 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $6 + local.get $10 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $5 + i64.const 2 + i64.shl + local.tee $6 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $5 + i64.const 62 + i64.shr_u + local.get $6 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $8 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.set $1 + local.get $2 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $3 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $3 + local.get $3 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $3 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $3 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $3 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 + local.get $2 + i32.const 1 + i32.add + i32.const 2 + i32.and + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 ) - (func $std/math/test_cosf (; 80 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_cosf (; 85 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cos local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.expm1 (; 81 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.expm1 (; 86 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) - (local $2 f64) - (local $3 i32) + (local $2 i32) + (local $3 f64) (local $4 f64) - (local $5 i32) + (local $5 f64) (local $6 i32) - (local $7 f64) + (local $7 i32) (local $8 i64) local.get $0 i64.reinterpret_f64 @@ -3867,25 +3690,24 @@ i64.const 63 i64.shr_u i32.wrap_i64 - local.set $6 + local.set $7 local.get $8 i64.const 32 i64.shr_u i64.const 2147483647 i64.and i32.wrap_i64 - local.tee $5 + local.tee $6 i32.const 1078159482 i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return end - local.get $6 + local.get $7 if f64.const -1 return @@ -3900,13 +3722,13 @@ return end end - local.get $5 + local.get $6 i32.const 1071001154 i32.gt_u if local.get $0 i32.const 1 - local.get $6 + local.get $7 i32.const 1 i32.shl i32.sub @@ -3918,11 +3740,11 @@ f64.copysign f64.add i32.trunc_f64_s - local.get $5 + local.get $6 i32.const 1072734898 i32.lt_u select - local.tee $3 + local.tee $2 f64.convert_i32_s local.tee $1 f64.const 0.6931471803691238 @@ -3939,9 +3761,9 @@ f64.sub local.get $1 f64.sub - local.set $7 + local.set $3 else - local.get $5 + local.get $6 i32.const 1016070144 i32.lt_u if @@ -3953,27 +3775,27 @@ f64.const 0.5 local.get $0 f64.mul - local.tee $2 - f64.mul local.tee $4 - local.get $4 + f64.mul + local.tee $5 + local.get $5 f64.mul local.set $1 f64.const 3 f64.const 1 - local.get $4 + local.get $5 f64.const -0.03333333333333313 f64.mul f64.add local.get $1 f64.const 1.5873015872548146e-03 - local.get $4 + local.get $5 f64.const -7.93650757867488e-05 f64.mul f64.add local.get $1 f64.const 4.008217827329362e-06 - local.get $4 + local.get $5 f64.const -2.0109921818362437e-07 f64.mul f64.add @@ -3982,58 +3804,58 @@ f64.mul f64.add local.tee $1 - local.get $2 + local.get $4 f64.mul f64.sub - local.set $2 - local.get $4 + local.set $4 + local.get $5 local.get $1 - local.get $2 + local.get $4 f64.sub f64.const 6 local.get $0 - local.get $2 + local.get $4 f64.mul f64.sub f64.div f64.mul local.set $1 - local.get $3 + local.get $2 i32.eqz if local.get $0 local.get $0 local.get $1 f64.mul - local.get $4 + local.get $5 f64.sub f64.sub return end local.get $0 local.get $1 - local.get $7 + local.get $3 f64.sub f64.mul - local.get $7 - f64.sub - local.get $4 - f64.sub - local.set $2 local.get $3 + f64.sub + local.get $5 + f64.sub + local.set $3 + local.get $2 i32.const -1 i32.eq if f64.const 0.5 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.const 0.5 f64.sub return end - local.get $3 + local.get $2 i32.const 1 i32.eq if @@ -4042,7 +3864,7 @@ f64.lt if f64.const -2 - local.get $2 + local.get $3 local.get $0 f64.const 0.5 f64.add @@ -4053,87 +3875,86 @@ f64.const 1 f64.const 2 local.get $0 - local.get $2 + local.get $3 f64.sub f64.mul f64.add return end - local.get $3 + local.get $2 i64.extend_i32_s i64.const 1023 i64.add i64.const 52 i64.shl f64.reinterpret_i64 - local.set $1 + local.set $4 i32.const 1 - local.get $3 + local.get $2 i32.const 56 i32.gt_s - local.get $3 + local.get $2 i32.const 0 i32.lt_s select if local.get $0 - local.get $2 + local.get $3 f64.sub f64.const 1 f64.add local.set $0 - local.get $3 + local.get $0 + f64.const 2 + f64.mul + f64.const 8988465674311579538646525e283 + f64.mul + local.get $0 + local.get $4 + f64.mul + local.get $2 i32.const 1024 i32.eq - if (result f64) - local.get $0 - f64.const 2 - f64.mul - f64.const 8988465674311579538646525e283 - f64.mul - else - local.get $0 - local.get $1 - f64.mul - end + select f64.const 1 f64.sub return end - local.get $0 - f64.const 1 i64.const 1023 - local.get $3 + local.get $2 i64.extend_i32_s i64.sub i64.const 52 i64.shl f64.reinterpret_i64 - local.tee $0 - f64.sub - local.get $2 - f64.sub - f64.const 1 - local.get $2 + local.set $1 local.get $0 - f64.add + f64.const 1 + local.get $1 f64.sub local.get $3 + f64.sub + f64.const 1 + local.get $3 + local.get $1 + f64.add + f64.sub + local.get $2 i32.const 20 i32.lt_s select f64.add - local.get $1 + local.get $4 f64.mul ) - (func $~lib/math/NativeMath.exp (; 82 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.exp (; 87 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 f64) (local $3 i32) (local $4 f64) (local $5 f64) - (local $6 i32) - (local $7 f64) + (local $6 f64) + (local $7 i32) local.get $0 i64.reinterpret_f64 i64.const 32 @@ -4142,7 +3963,7 @@ local.tee $1 i32.const 31 i32.shr_u - local.set $6 + local.set $7 local.get $1 i32.const 2147483647 i32.and @@ -4151,8 +3972,7 @@ i32.ge_u if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN if local.get $0 return @@ -4195,36 +4015,37 @@ i32.trunc_f64_s else i32.const 1 - local.get $6 + local.get $7 i32.const 1 i32.shl i32.sub end local.tee $1 f64.convert_i32_s - local.tee $0 f64.const 0.6931471803691238 f64.mul f64.sub - local.tee $4 - local.get $0 + local.tee $5 + local.get $1 + f64.convert_i32_s f64.const 1.9082149292705877e-10 f64.mul - local.tee $7 + local.tee $4 f64.sub local.set $0 else local.get $3 i32.const 1043333120 - i32.le_u - if + i32.gt_u + if (result f64) + local.get $0 + else f64.const 1 local.get $0 f64.add return end - local.get $0 - local.set $4 + local.set $5 end local.get $0 local.get $0 @@ -4232,20 +4053,20 @@ local.tee $2 local.get $2 f64.mul - local.set $5 + local.set $6 f64.const 1 local.get $0 local.get $0 local.get $2 f64.const 0.16666666666666602 f64.mul - local.get $5 + local.get $6 f64.const -2.7777777777015593e-03 local.get $2 f64.const 6.613756321437934e-05 f64.mul f64.add - local.get $5 + local.get $6 f64.const -1.6533902205465252e-06 local.get $2 f64.const 4.1381367970572385e-08 @@ -4262,9 +4083,9 @@ local.get $0 f64.sub f64.div - local.get $7 - f64.sub local.get $4 + f64.sub + local.get $5 f64.add f64.add local.set $0 @@ -4278,7 +4099,7 @@ local.get $1 call $~lib/math/NativeMath.scalbn ) - (func $~lib/math/NativeMath.cosh (; 83 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.cosh (; 88 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i32) (local $2 i64) local.get $0 @@ -4342,7 +4163,7 @@ f64.const 2247116418577894884661631e283 f64.mul ) - (func $std/math/test_cosh (; 84 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_cosh (; 89 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.cosh local.get $1 @@ -4358,7 +4179,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.expm1 (; 85 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.expm1 (; 90 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 f32) @@ -4568,20 +4389,18 @@ f32.const 1 f32.add local.set $0 + local.get $0 + f32.const 2 + f32.mul + f32.const 1701411834604692317316873e14 + f32.mul + local.get $0 + local.get $4 + f32.mul local.get $1 i32.const 128 i32.eq - if (result f32) - local.get $0 - f32.const 2 - f32.mul - f32.const 1701411834604692317316873e14 - f32.mul - else - local.get $0 - local.get $4 - f32.mul - end + select f32.const 1 f32.sub return @@ -4612,7 +4431,7 @@ local.get $4 f32.mul ) - (func $~lib/math/NativeMathf.exp (; 86 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.exp (; 91 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 f32) @@ -4677,12 +4496,12 @@ end local.tee $1 f32.convert_i32_s - local.tee $0 f32.const 0.693145751953125 f32.mul f32.sub local.tee $3 - local.get $0 + local.get $1 + f32.convert_i32_s f32.const 1.428606765330187e-06 f32.mul local.tee $4 @@ -4740,7 +4559,7 @@ local.get $1 call $~lib/math/NativeMathf.scalbn ) - (func $~lib/math/NativeMathf.cosh (; 87 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.cosh (; 92 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) local.get $0 i32.reinterpret_f32 @@ -4799,14 +4618,14 @@ f32.const 1661534994731144841129758e11 f32.mul ) - (func $std/math/test_coshf (; 88 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_coshf (; 93 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.cosh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_exp (; 89 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_exp (; 94 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.exp local.get $1 @@ -4822,14 +4641,14 @@ i32.const 0 end ) - (func $std/math/test_expf (; 90 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_expf (; 95 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.exp local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_expm1 (; 91 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_expm1 (; 96 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.expm1 local.get $1 @@ -4845,14 +4664,14 @@ i32.const 0 end ) - (func $std/math/test_expm1f (; 92 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_expm1f (; 97 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.expm1 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_floor (; 93 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_floor (; 98 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.floor local.get $1 @@ -4868,14 +4687,14 @@ i32.const 0 end ) - (func $std/math/test_floorf (; 94 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_floorf (; 99 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.floor local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.hypot (; 95 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.hypot (; 100 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 f64) (local $4 i64) @@ -5048,7 +4867,7 @@ f64.sqrt f64.mul ) - (func $std/math/test_hypot (; 96 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) + (func $std/math/test_hypot (; 101 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.hypot @@ -5066,12 +4885,11 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.hypot (; 97 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.hypot (; 102 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 f32) - (local $5 f64) - (local $6 i32) + (local $5 i32) local.get $0 i32.reinterpret_f32 i32.const 2147483647 @@ -5085,10 +4903,10 @@ i32.lt_u if local.get $3 - local.set $6 + local.set $5 local.get $2 local.set $3 - local.get $6 + local.get $5 local.set $2 end local.get $3 @@ -5161,20 +4979,20 @@ local.get $4 local.get $0 f64.promote_f32 - local.tee $5 - local.get $5 + local.get $0 + f64.promote_f32 f64.mul local.get $1 f64.promote_f32 - local.tee $5 - local.get $5 + local.get $1 + f64.promote_f32 f64.mul f64.add f32.demote_f64 f32.sqrt f32.mul ) - (func $std/math/test_hypotf (; 98 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_hypotf (; 103 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.hypot @@ -5182,7 +5000,7 @@ local.get $3 call $std/math/check ) - (func $std/math/test_log (; 99 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log (; 104 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log local.get $1 @@ -5198,14 +5016,14 @@ i32.const 0 end ) - (func $std/math/test_logf (; 100 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_logf (; 105 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.log10 (; 101 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log10 (; 106 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -5409,7 +5227,7 @@ local.get $1 f64.add ) - (func $std/math/test_log10 (; 102 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log10 (; 107 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log10 local.get $1 @@ -5425,7 +5243,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log10 (; 103 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log10 (; 108 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 i32) @@ -5583,14 +5401,14 @@ f32.mul f32.add ) - (func $std/math/test_log10f (; 104 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log10f (; 109 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log10 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_log1p (; 105 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log1p (; 110 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log1p local.get $1 @@ -5606,14 +5424,14 @@ i32.const 0 end ) - (func $std/math/test_log1pf (; 106 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log1pf (; 111 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log1p local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.log2 (; 107 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.log2 (; 112 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -5810,7 +5628,7 @@ local.get $1 f64.add ) - (func $std/math/test_log2 (; 108 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_log2 (; 113 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.log2 local.get $1 @@ -5826,7 +5644,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.log2 (; 109 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.log2 (; 114 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 f32) (local $3 i32) @@ -5976,14 +5794,14 @@ f32.convert_i32_s f32.add ) - (func $std/math/test_log2f (; 110 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_log2f (; 115 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.log2 local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_max (; 111 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_max (; 116 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.max @@ -6001,7 +5819,7 @@ i32.const 0 end ) - (func $std/math/test_maxf (; 112 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_maxf (; 117 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.max @@ -6009,7 +5827,7 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_min (; 113 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_min (; 118 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 f64.min @@ -6027,7 +5845,7 @@ i32.const 0 end ) - (func $std/math/test_minf (; 114 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_minf (; 119 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 f32.min @@ -6035,7 +5853,7 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.mod (; 115 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.mod (; 120 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) @@ -6080,8 +5898,7 @@ i32.const 1 else local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN end if local.get $0 @@ -6163,7 +5980,7 @@ local.get $2 local.get $3 i64.ge_u - if + if (result i64) local.get $2 local.get $3 i64.eq @@ -6171,9 +5988,9 @@ local.get $2 local.get $3 i64.sub - local.set $2 + else + local.get $2 end - local.get $2 i64.const 1 i64.shl local.set $2 @@ -6208,21 +6025,21 @@ local.get $4 local.get $3 i64.sub - local.tee $3 + local.tee $4 i64.const 0 i64.gt_s if (result i64) local.get $2 i64.const 4503599627370496 i64.sub - local.get $3 + local.get $4 i64.const 52 i64.shl i64.or else local.get $2 i64.const 0 - local.get $3 + local.get $4 i64.sub i64.const 1 i64.add @@ -6239,7 +6056,7 @@ local.get $0 f64.mul ) - (func $std/math/test_mod (; 116 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_mod (; 121 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod @@ -6257,7 +6074,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.mod (; 117 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.mod (; 122 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6300,8 +6117,7 @@ i32.const 1 else local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN end if local.get $0 @@ -6377,7 +6193,7 @@ local.get $2 local.get $3 i32.ge_u - if + if (result i32) local.get $2 local.get $3 i32.eq @@ -6385,9 +6201,9 @@ local.get $2 local.get $3 i32.sub - local.set $2 + else + local.get $2 end - local.get $2 i32.const 1 i32.shl local.set $2 @@ -6422,21 +6238,21 @@ local.get $4 local.get $3 i32.sub - local.tee $3 + local.tee $4 i32.const 0 i32.gt_s if (result i32) local.get $2 i32.const 8388608 i32.sub - local.get $3 + local.get $4 i32.const 23 i32.shl i32.or else local.get $2 i32.const 1 - local.get $3 + local.get $4 i32.sub i32.shr_u end @@ -6449,7 +6265,7 @@ local.get $0 f32.mul ) - (func $std/math/test_modf (; 118 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_modf (; 123 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.mod @@ -6457,7 +6273,7 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.pow (; 119 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.pow (; 124 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 f64) (local $3 f64) (local $4 i32) @@ -6511,37 +6327,33 @@ return end i32.const 1 + local.get $6 + i32.const 0 + i32.ne + i32.const 0 + local.get $8 + i32.const 2146435072 + i32.eq + select + i32.const 1 local.get $8 i32.const 2146435072 i32.gt_s + i32.const 1 + local.get $19 + i32.const 0 + i32.ne + i32.const 0 + local.get $4 + i32.const 2146435072 + i32.eq + select local.get $4 i32.const 2146435072 i32.gt_s - if (result i32) - i32.const 1 - else - local.get $19 - i32.const 0 - i32.ne - i32.const 0 - local.get $4 - i32.const 2146435072 - i32.eq - select - end select - if (result i32) - i32.const 1 - else - local.get $6 - i32.const 0 - i32.ne - i32.const 0 - local.get $8 - i32.const 2146435072 - i32.eq - select - end + select + select if local.get $0 local.get $1 @@ -6805,44 +6617,40 @@ i32.const 1072693247 i32.lt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.lt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end local.get $4 i32.const 1072693248 i32.gt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.gt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end local.get $3 @@ -7163,7 +6971,6 @@ i32.sub local.get $5 i32.or - br_if $folding-inner0 local.get $1 f64.const 8.008566259537294e-17 f64.add @@ -7171,6 +6978,7 @@ local.get $2 f64.sub f64.gt + i32.or br_if $folding-inner0 else local.get $12 @@ -7184,12 +6992,12 @@ i32.sub local.get $5 i32.or - br_if $folding-inner1 local.get $1 local.get $0 local.get $2 f64.sub f64.le + i32.or br_if $folding-inner1 end end @@ -7377,7 +7185,7 @@ f64.const 1e-300 f64.mul ) - (func $std/math/test_pow (; 120 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) + (func $std/math/test_pow (; 125 ;) (type $FUNCSIG$idddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.pow @@ -7395,7 +7203,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.pow (; 121 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.pow (; 126 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 f32) (local $3 f32) (local $4 i32) @@ -7648,44 +7456,40 @@ i32.const 1065353208 i32.lt_s if + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul local.get $11 i32.const 0 i32.lt_s - if (result f32) - local.get $7 - f32.const 1000000015047466219876688e6 - f32.mul - f32.const 1000000015047466219876688e6 - f32.mul - else - local.get $7 - f32.const 1.0000000031710769e-30 - f32.mul - f32.const 1.0000000031710769e-30 - f32.mul - end + select return end local.get $5 i32.const 1065353223 i32.gt_s if + local.get $7 + f32.const 1000000015047466219876688e6 + f32.mul + f32.const 1000000015047466219876688e6 + f32.mul + local.get $7 + f32.const 1.0000000031710769e-30 + f32.mul + f32.const 1.0000000031710769e-30 + f32.mul local.get $11 i32.const 0 i32.gt_s - if (result f32) - local.get $7 - f32.const 1000000015047466219876688e6 - f32.mul - f32.const 1000000015047466219876688e6 - f32.mul - else - local.get $7 - f32.const 1.0000000031710769e-30 - f32.mul - f32.const 1.0000000031710769e-30 - f32.mul - end + select return end local.get $3 @@ -8185,7 +7989,7 @@ f32.const 1.0000000031710769e-30 f32.mul ) - (func $std/math/test_powf (; 122 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) + (func $std/math/test_powf (; 127 ;) (type $FUNCSIG$iffff) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.pow @@ -8193,7 +7997,28 @@ local.get $3 call $std/math/check ) - (func $~lib/math/splitMix32 (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/math/murmurHash3 (; 128 ;) (type $FUNCSIG$jj) (param $0 i64) (result i64) + local.get $0 + i64.const 33 + i64.shr_u + local.get $0 + i64.xor + i64.const -49064778989728563 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + i64.const -4265267296055464877 + i64.mul + local.tee $0 + local.get $0 + i64.const 33 + i64.shr_u + i64.xor + ) + (func $~lib/math/splitMix32 (; 129 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 1831565813 i32.add @@ -8225,8 +8050,7 @@ i32.shr_u i32.xor ) - (func $~lib/math/NativeMath.seedRandom (; 124 ;) (type $FUNCSIG$vj) (param $0 i64) - (local $1 i64) + (func $~lib/math/NativeMath.seedRandom (; 130 ;) (type $FUNCSIG$vj) (param $0 i64) local.get $0 i64.eqz if @@ -8240,47 +8064,12 @@ i32.const 1 global.set $~lib/math/random_seeded local.get $0 - i64.const 33 - i64.shr_u - local.get $0 - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state0_64 global.get $~lib/math/random_state0_64 i64.const -1 i64.xor - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -49064778989728563 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor - i64.const -4265267296055464877 - i64.mul - local.tee $1 - local.get $1 - i64.const 33 - i64.shr_u - i64.xor + call $~lib/math/murmurHash3 global.set $~lib/math/random_state1_64 local.get $0 i32.wrap_i64 @@ -8290,7 +8079,7 @@ call $~lib/math/splitMix32 global.set $~lib/math/random_state1_32 ) - (func $~lib/math/NativeMath.random (; 125 ;) (type $FUNCSIG$d) (result f64) + (func $~lib/math/NativeMath.random (; 131 ;) (type $FUNCSIG$d) (result f64) (local $0 i64) (local $1 i64) global.get $~lib/math/random_seeded @@ -8337,7 +8126,7 @@ f64.const 1 f64.sub ) - (func $~lib/math/NativeMathf.random (; 126 ;) (type $FUNCSIG$f) (result f32) + (func $~lib/math/NativeMathf.random (; 132 ;) (type $FUNCSIG$f) (result f32) (local $0 i32) (local $1 i32) global.get $~lib/math/random_seeded @@ -8383,7 +8172,7 @@ f32.const 1 f32.sub ) - (func $std/math/test_round (; 127 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_round (; 133 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.const 0.5 f64.add @@ -8394,7 +8183,7 @@ f64.const 0 call $std/math/check ) - (func $std/math/test_roundf (; 128 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_roundf (; 134 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.const 0.5 f32.add @@ -8405,18 +8194,16 @@ f32.const 0 call $std/math/check ) - (func $std/math/test_sign (; 129 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_sign (; 135 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 f64) local.get $0 local.set $2 f64.const 1 - f64.const -1 local.get $2 + f64.copysign local.get $2 - f64.const 0 - f64.lt - select local.get $0 + f64.abs f64.const 0 f64.gt select @@ -8433,15 +8220,13 @@ i32.const 0 end ) - (func $std/math/test_signf (; 130 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_signf (; 136 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) f32.const 1 - f32.const -1 + local.get $0 + f32.copysign local.get $0 local.get $0 - f32.const 0 - f32.lt - select - local.get $0 + f32.abs f32.const 0 f32.gt select @@ -8449,14 +8234,22 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.rem (; 131 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/math/NativeMath.rem (; 137 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) - (local $5 i64) - (local $6 i32) + (local $5 i32) + (local $6 i64) (local $7 f64) (local $8 i32) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i64.const 52 + i64.shr_u + i64.const 2047 + i64.and + local.set $3 local.get $1 i64.reinterpret_f64 local.tee $4 @@ -8464,21 +8257,14 @@ i64.shr_u i64.const 2047 i64.and - local.set $5 - local.get $0 - i64.reinterpret_f64 - local.tee $2 + local.set $6 + local.get $2 i64.const 63 i64.shr_u i32.wrap_i64 local.set $8 i32.const 1 - local.get $2 - i64.const 52 - i64.shr_u - i64.const 2047 - i64.and - local.tee $3 + local.get $3 i64.const 2047 i64.eq local.get $4 @@ -8491,8 +8277,7 @@ i32.const 1 else local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN end if local.get $0 @@ -8536,18 +8321,18 @@ i64.or end local.set $2 - local.get $5 + local.get $6 i64.eqz if (result i64) local.get $4 i64.const 0 - local.get $5 + local.get $6 local.get $4 i64.const 12 i64.shl i64.clz i64.sub - local.tee $5 + local.tee $6 i64.sub i64.const 1 i64.add @@ -8562,13 +8347,13 @@ local.set $4 block $break|0 local.get $3 - local.get $5 + local.get $6 i64.lt_s if local.get $3 i64.const 1 i64.add - local.get $5 + local.get $6 i64.eq br_if $break|0 local.get $0 @@ -8576,7 +8361,7 @@ end loop $continue|1 local.get $3 - local.get $5 + local.get $6 i64.gt_s if local.get $2 @@ -8587,19 +8372,19 @@ local.get $4 i64.sub local.set $2 - local.get $6 + local.get $5 i32.const 1 i32.add - local.set $6 + local.set $5 end local.get $2 i64.const 1 i64.shl local.set $2 - local.get $6 + local.get $5 i32.const 1 i32.shl - local.set $6 + local.set $5 local.get $3 i64.const 1 i64.sub @@ -8615,10 +8400,10 @@ local.get $4 i64.sub local.set $2 - local.get $6 + local.get $5 i32.const 1 i32.add - local.set $6 + local.set $5 end local.get $2 i64.const 0 @@ -8644,26 +8429,24 @@ local.get $1 f64.abs local.set $1 + local.get $2 + i64.const 4503599627370496 + i64.sub + local.get $3 + i64.const 52 + i64.shl + i64.or + local.get $2 + i64.const 0 + local.get $3 + i64.sub + i64.const 1 + i64.add + i64.shr_u local.get $3 i64.const 0 i64.gt_s - if (result i64) - local.get $2 - i64.const 4503599627370496 - i64.sub - local.get $3 - i64.const 52 - i64.shl - i64.or - else - local.get $2 - i64.const 0 - local.get $3 - i64.sub - i64.const 1 - i64.add - i64.shr_u - end + select f64.reinterpret_i64 local.tee $0 local.get $0 @@ -8673,46 +8456,42 @@ local.get $1 f64.sub local.get $0 - local.get $3 + i32.const 1 + i32.const 1 local.get $5 + i32.const 1 + i32.and + i32.const 0 + local.get $7 + local.get $1 + f64.eq + select + local.get $7 + local.get $1 + f64.gt + select + i32.const 0 + local.get $3 + i64.const 1 + i64.add + local.get $6 i64.eq - if (result i32) - i32.const 1 - else - local.get $3 - i64.const 1 - i64.add - local.get $5 - i64.eq - if (result i32) - local.get $7 - local.get $1 - f64.gt - if (result i32) - i32.const 1 - else - local.get $6 - i32.const 1 - i32.and - i32.const 0 - local.get $7 - local.get $1 - f64.eq - select - end - else - i32.const 0 - end - end + select + local.get $3 + local.get $6 + i64.eq + select select local.set $0 - local.get $0 - f64.neg - local.get $0 local.get $8 - select + if + local.get $0 + f64.neg + local.set $0 + end + local.get $0 ) - (func $std/math/test_rem (; 132 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_rem (; 138 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.rem @@ -8720,7 +8499,7 @@ f64.const 0 call $std/math/check ) - (func $~lib/math/NativeMathf.rem (; 133 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/math/NativeMathf.rem (; 139 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8728,6 +8507,14 @@ (local $6 i32) (local $7 f32) (local $8 i32) + local.get $0 + i32.reinterpret_f32 + local.tee $2 + i32.const 23 + i32.shr_u + i32.const 255 + i32.and + local.set $3 local.get $1 i32.reinterpret_f32 local.tee $4 @@ -8736,18 +8523,11 @@ i32.const 255 i32.and local.set $5 - local.get $0 - i32.reinterpret_f32 - local.tee $2 + local.get $2 i32.const 31 i32.shr_u local.set $8 - local.get $2 - i32.const 23 - i32.shr_u - i32.const 255 - i32.and - local.tee $3 + local.get $3 i32.const 255 i32.eq i32.const 1 @@ -8759,8 +8539,7 @@ i32.const 1 else local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN end if local.get $0 @@ -8820,6 +8599,8 @@ i32.sub i32.shl end + local.set $6 + i32.const 0 local.set $4 block $break|0 local.get $3 @@ -8841,26 +8622,26 @@ i32.gt_s if local.get $2 - local.get $4 + local.get $6 i32.ge_u - if - local.get $6 + if (result i32) + local.get $4 i32.const 1 i32.add - local.set $6 + local.set $4 local.get $2 - local.get $4 + local.get $6 i32.sub - local.set $2 + else + local.get $2 end - local.get $2 i32.const 1 i32.shl local.set $2 - local.get $6 + local.get $4 i32.const 1 i32.shl - local.set $6 + local.set $4 local.get $3 i32.const 1 i32.sub @@ -8870,15 +8651,15 @@ end block (result i32) local.get $2 - local.get $4 + local.get $6 i32.ge_u if - local.get $6 + local.get $4 i32.const 1 i32.add - local.set $6 + local.set $4 local.get $2 - local.get $4 + local.get $6 i32.sub local.set $2 end @@ -8894,11 +8675,11 @@ i32.const 8 i32.shl i32.clz - local.tee $4 + local.tee $6 i32.sub local.set $3 local.get $2 - local.get $4 + local.get $6 i32.shl local.set $2 end @@ -8906,24 +8687,22 @@ local.get $1 f32.abs local.set $1 + local.get $2 + i32.const 8388608 + i32.sub + local.get $3 + i32.const 23 + i32.shl + i32.or + local.get $2 + i32.const 1 + local.get $3 + i32.sub + i32.shr_u local.get $3 i32.const 0 i32.gt_s - if (result i32) - local.get $2 - i32.const 8388608 - i32.sub - local.get $3 - i32.const 23 - i32.shl - i32.or - else - local.get $2 - i32.const 1 - local.get $3 - i32.sub - i32.shr_u - end + select f32.reinterpret_i32 local.tee $0 local.get $0 @@ -8933,46 +8712,42 @@ local.get $1 f32.sub local.get $0 + i32.const 1 + i32.const 1 + local.get $4 + i32.const 1 + i32.and + i32.const 0 + local.get $7 + local.get $1 + f32.eq + select + local.get $7 + local.get $1 + f32.gt + select + i32.const 0 + local.get $3 + i32.const 1 + i32.add + local.get $5 + i32.eq + select local.get $3 local.get $5 i32.eq - if (result i32) - i32.const 1 - else - local.get $3 - i32.const 1 - i32.add - local.get $5 - i32.eq - if (result i32) - local.get $7 - local.get $1 - f32.gt - if (result i32) - i32.const 1 - else - local.get $6 - i32.const 1 - i32.and - i32.const 0 - local.get $7 - local.get $1 - f32.eq - select - end - else - i32.const 0 - end - end + select select local.set $0 - local.get $0 - f32.neg - local.get $0 local.get $8 - select + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 ) - (func $std/math/test_remf (; 134 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_remf (; 140 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.rem @@ -8980,519 +8755,287 @@ f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMathf.sin (; 135 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sin (; 141 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f64) - (local $2 f64) - (local $3 i32) - (local $4 i64) - (local $5 f64) - (local $6 i32) - (local $7 i32) - (local $8 i64) + (local $2 i32) + (local $3 f64) + (local $4 i32) + (local $5 i64) + (local $6 i64) + (local $7 f64) + (local $8 i32) (local $9 i32) (local $10 i64) (local $11 i64) local.get $0 i32.reinterpret_f32 - local.tee $3 + local.tee $2 i32.const 31 i32.shr_u - local.set $7 - block $folding-inner0 - local.get $3 - i32.const 2147483647 - i32.and + local.set $9 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + local.get $0 + return + end + local.get $0 + f64.promote_f32 local.tee $3 - i32.const 1061752794 - i32.le_u - if - local.get $3 - i32.const 964689920 - i32.lt_u - if - local.get $0 - return - end - local.get $0 - f64.promote_f32 - local.tee $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.set $5 - br $folding-inner0 - end local.get $3 - i32.const 1081824209 - i32.le_u - if - local.get $3 - i32.const 1075235811 - i32.le_u - if - local.get $7 - if (result f32) - local.get $0 - f64.promote_f32 - f64.const 1.5707963267948966 - f64.add - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - f32.neg - else - local.get $0 - f64.promote_f32 - f64.const 1.5707963267948966 - f64.sub - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - end - return - end - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 3.141592653589793 - f64.add - local.get $1 - f64.const 3.141592653589793 - f64.sub - local.get $7 - select - f64.neg - local.tee $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.set $5 - br $folding-inner0 - end + f64.mul + local.tee $1 local.get $3 - i32.const 1088565717 - i32.le_u - if - local.get $3 - i32.const 1085271519 - i32.le_u - if - local.get $7 - if (result f32) - local.get $0 - f64.promote_f32 - f64.const 4.71238898038469 - f64.add - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - else - local.get $0 - f64.promote_f32 - f64.const 4.71238898038469 - f64.sub - local.tee $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - f32.neg - end - return - end - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 6.283185307179586 - f64.add - local.get $1 - f64.const 6.283185307179586 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $5 - local.get $2 - local.get $5 - f64.const -0.16666666641626524 - local.get $1 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $5 - local.get $1 - local.get $1 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $1 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - return - end + f64.mul + local.set $7 local.get $3 - i32.const 2139095040 - i32.ge_u - if - local.get $0 - local.get $0 - f32.sub - return - end - block $~lib/math/rempio2f|inlined.1 (result i32) - local.get $3 - i32.const 1305022427 - i32.lt_u - if - local.get $0 - f64.promote_f32 - local.tee $2 - f64.const 0.6366197723675814 - f64.mul - f64.nearest - local.set $1 - local.get $2 - local.get $1 - f64.const 1.5707963109016418 - f64.mul - f64.sub - local.get $1 - f64.const 1.5893254773528196e-08 - f64.mul - f64.sub - global.set $~lib/math/rempio2f_y - local.get $1 - i32.trunc_f64_s - br $~lib/math/rempio2f|inlined.1 - end - i32.const 116 - i32.load - local.get $3 - i32.const 23 - i32.shr_s - i32.const 152 - i32.sub - local.tee $6 - i32.const 6 - i32.shr_s - local.tee $9 - i32.const 3 - i32.shl - i32.add - i64.load - local.set $10 - i32.const 116 - i32.load - local.get $9 - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load - local.set $4 - local.get $6 - i32.const 63 - i32.and - local.tee $6 - i32.const 32 - i32.gt_s - if (result i64) - local.get $4 - local.get $6 - i32.const 32 - i32.sub - i64.extend_i32_s - i64.shl - i32.const 116 - i32.load - local.get $9 - i32.const 2 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load - i64.const 96 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - i64.or - else - local.get $4 - i64.const 32 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - end - local.set $8 - f64.const 8.515303950216386e-20 - local.get $0 - f64.promote_f32 - f64.copysign - local.get $3 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or - i64.extend_i32_s - local.tee $11 - local.get $4 - i64.const 64 - local.get $6 - i64.extend_i32_s - local.tee $4 - i64.sub - i64.shr_u - local.get $10 - local.get $4 - i64.shl - i64.or - i64.mul - local.get $8 - local.get $11 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $4 - i64.const 2 - i64.shl - local.tee $8 - f64.convert_i64_s - f64.mul - global.set $~lib/math/rempio2f_y - i32.const 0 - local.get $4 - i64.const 62 - i64.shr_u - local.get $8 - i64.const 63 - i64.shr_u - i64.add - i32.wrap_i64 - local.tee $3 - i32.sub - local.get $3 - local.get $7 - select - end - local.set $3 - global.get $~lib/math/rempio2f_y - local.set $1 - local.get $3 - i32.const 1 - i32.and - if (result f32) - local.get $1 - local.get $1 - f64.mul - local.tee $1 - local.get $1 - f64.mul - local.set $2 - f64.const 1 - local.get $1 - f64.const -0.499999997251031 - f64.mul - f64.add - local.get $2 - f64.const 0.04166662332373906 - f64.mul - f64.add - local.get $2 - local.get $1 - f64.mul - f64.const -0.001388676377460993 - local.get $1 - f64.const 2.439044879627741e-05 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - else - local.get $1 - local.get $1 - local.get $1 - f64.mul - local.tee $2 - local.get $1 - f64.mul - local.tee $1 - f64.const -0.16666666641626524 - local.get $2 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $1 - local.get $2 - local.get $2 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $2 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 - end - local.set $0 - local.get $0 - f32.neg - local.get $0 - local.get $3 - i32.const 2 - i32.and - select + local.get $7 + f64.const -0.16666666641626524 + local.get $1 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $7 + local.get $1 + local.get $1 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $1 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 return end - local.get $1 - local.get $5 - f64.const -0.16666666641626524 local.get $2 - f64.const 0.008333329385889463 - f64.mul - f64.add - f64.mul - f64.add - local.get $5 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.1 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.1 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $8 + call $~lib/array/Array#__unchecked_get + local.set $10 + local.get $8 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $5 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $5 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $8 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $5 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $6 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $10 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $5 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $6 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $5 + i64.const 2 + i64.shl + local.tee $6 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $5 + i64.const 62 + i64.shr_u + local.get $6 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $9 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.set $1 local.get $2 + i32.const 1 + i32.and + if (result f32) + local.get $1 + local.get $1 + f64.mul + local.tee $1 + local.get $1 + f64.mul + local.set $3 + f64.const 1 + local.get $1 + f64.const -0.499999997251031 + f64.mul + f64.add + local.get $3 + f64.const 0.04166662332373906 + f64.mul + f64.add + local.get $3 + local.get $1 + f64.mul + f64.const -0.001388676377460993 + local.get $1 + f64.const 2.439044879627741e-05 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + else + local.get $1 + local.get $1 + local.get $1 + f64.mul + local.tee $3 + local.get $1 + f64.mul + local.tee $1 + f64.const -0.16666666641626524 + local.get $3 + f64.const 0.008333329385889463 + f64.mul + f64.add + f64.mul + f64.add + local.get $1 + local.get $3 + local.get $3 + f64.mul + f64.mul + f64.const -1.9839334836096632e-04 + local.get $3 + f64.const 2.718311493989822e-06 + f64.mul + f64.add + f64.mul + f64.add + f32.demote_f64 + end + local.set $0 local.get $2 - f64.mul - f64.mul - f64.const -1.9839334836096632e-04 - local.get $2 - f64.const 2.718311493989822e-06 - f64.mul - f64.add - f64.mul - f64.add - f32.demote_f64 + i32.const 2 + i32.and + if + local.get $0 + f32.neg + local.set $0 + end + local.get $0 ) - (func $std/math/test_sinf (; 136 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_sinf (; 142 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.sin local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.sinh (; 137 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.sinh (; 143 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 f64) (local $3 i32) @@ -9569,7 +9112,7 @@ f64.mul f64.mul ) - (func $std/math/test_sinh (; 138 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_sinh (; 144 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.sinh local.get $1 @@ -9585,7 +9128,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.sinh (; 139 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.sinh (; 145 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) (local $3 f32) @@ -9657,14 +9200,14 @@ f32.mul f32.mul ) - (func $std/math/test_sinhf (; 140 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_sinhf (; 146 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.sinh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_sqrt (; 141 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_sqrt (; 147 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 f64.sqrt local.get $1 @@ -9680,356 +9223,56 @@ i32.const 0 end ) - (func $std/math/test_sqrtf (; 142 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_sqrtf (; 148 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 f32.sqrt local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMathf.tan (; 143 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.tan (; 149 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f64) - (local $2 f64) + (local $2 i32) (local $3 f64) (local $4 i32) - (local $5 i64) - (local $6 i32) - (local $7 i32) - (local $8 i64) + (local $5 f64) + (local $6 i64) + (local $7 i64) + (local $8 i32) (local $9 i32) (local $10 i64) (local $11 i64) local.get $0 i32.reinterpret_f32 - local.tee $4 + local.tee $2 i32.const 31 i32.shr_u - local.set $7 - block $folding-inner1 - block $folding-inner0 - local.get $4 - i32.const 2147483647 - i32.and - local.tee $4 - i32.const 1061752794 - i32.le_u - if - local.get $4 - i32.const 964689920 - i32.lt_u - if - local.get $0 - return - end - local.get $0 - f64.promote_f32 - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner0 - end - local.get $4 - i32.const 1081824209 - i32.le_u - if - local.get $4 - i32.const 1075235811 - i32.le_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 1.5707963267948966 - f64.add - local.get $1 - f64.const 1.5707963267948966 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner1 - else - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 3.141592653589793 - f64.add - local.get $1 - f64.const 3.141592653589793 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner0 - end - unreachable - end - local.get $4 - i32.const 1088565717 - i32.le_u - if - local.get $4 - i32.const 1085271519 - i32.le_u - if - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 4.71238898038469 - f64.add - local.get $1 - f64.const 4.71238898038469 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner1 - else - local.get $0 - f64.promote_f32 - local.tee $1 - f64.const 6.283185307179586 - f64.add - local.get $1 - f64.const 6.283185307179586 - f64.sub - local.get $7 - select - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - br $folding-inner0 - end - unreachable - end - local.get $4 - i32.const 2139095040 - i32.ge_u - if - local.get $0 - local.get $0 - f32.sub - return - end - block $~lib/math/rempio2f|inlined.2 (result i32) - local.get $4 - i32.const 1305022427 - i32.lt_u - if - local.get $0 - f64.promote_f32 - local.tee $2 - f64.const 0.6366197723675814 - f64.mul - f64.nearest - local.set $1 - local.get $2 - local.get $1 - f64.const 1.5707963109016418 - f64.mul - f64.sub - local.get $1 - f64.const 1.5893254773528196e-08 - f64.mul - f64.sub - global.set $~lib/math/rempio2f_y - local.get $1 - i32.trunc_f64_s - br $~lib/math/rempio2f|inlined.2 - end - i32.const 116 - i32.load - local.get $4 - i32.const 23 - i32.shr_s - i32.const 152 - i32.sub - local.tee $6 - i32.const 6 - i32.shr_s - local.tee $9 - i32.const 3 - i32.shl - i32.add - i64.load - local.set $10 - i32.const 116 - i32.load - local.get $9 - i32.const 1 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load - local.set $5 - local.get $6 - i32.const 63 - i32.and - local.tee $6 - i32.const 32 - i32.gt_s - if (result i64) - local.get $5 - local.get $6 - i32.const 32 - i32.sub - i64.extend_i32_s - i64.shl - i32.const 116 - i32.load - local.get $9 - i32.const 2 - i32.add - i32.const 3 - i32.shl - i32.add - i64.load - i64.const 96 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - i64.or - else - local.get $5 - i64.const 32 - local.get $6 - i64.extend_i32_s - i64.sub - i64.shr_u - end - local.set $8 - f64.const 8.515303950216386e-20 - local.get $0 - f64.promote_f32 - f64.copysign - local.get $4 - i32.const 8388607 - i32.and - i32.const 8388608 - i32.or - i64.extend_i32_s - local.tee $11 - local.get $5 - i64.const 64 - local.get $6 - i64.extend_i32_s - local.tee $5 - i64.sub - i64.shr_u - local.get $10 - local.get $5 - i64.shl - i64.or - i64.mul - local.get $8 - local.get $11 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.tee $5 - i64.const 2 - i64.shl - local.tee $8 - f64.convert_i64_s - f64.mul - global.set $~lib/math/rempio2f_y - i32.const 0 - local.get $5 - i64.const 62 - i64.shr_u - local.get $8 - i64.const 63 - i64.shr_u - i64.add - i32.wrap_i64 - local.tee $4 - i32.sub - local.get $4 - local.get $7 - select - end - local.set $4 - global.get $~lib/math/rempio2f_y - local.tee $2 - local.get $2 - f64.mul - local.tee $1 - local.get $2 - f64.mul - local.set $3 - local.get $2 - local.get $3 - f64.const 0.3333313950307914 - local.get $1 - f64.const 0.13339200271297674 - f64.mul - f64.add - f64.mul - f64.add - local.get $3 - local.get $1 - local.get $1 - f64.mul - local.tee $2 - f64.mul - f64.const 0.05338123784456704 - local.get $1 - f64.const 0.024528318116654728 - f64.mul - f64.add - local.get $2 - f64.const 0.002974357433599673 - local.get $1 - f64.const 0.009465647849436732 - f64.mul - f64.add - f64.mul - f64.add - f64.mul - f64.add - local.set $1 - f64.const -1 - local.get $1 - f64.div - local.get $1 - local.get $4 - i32.const 1 - i32.and - select - f32.demote_f64 + local.set $9 + local.get $2 + i32.const 2147483647 + i32.and + local.tee $2 + i32.const 1061752794 + i32.le_u + if + local.get $2 + i32.const 964689920 + i32.lt_u + if + local.get $0 return end - local.get $2 + local.get $0 + f64.promote_f32 + local.tee $3 local.get $3 + f64.mul + local.tee $1 + local.get $3 + f64.mul + local.set $5 + local.get $3 + local.get $5 f64.const 0.3333313950307914 local.get $1 f64.const 0.13339200271297674 @@ -10037,18 +9280,18 @@ f64.add f64.mul f64.add - local.get $3 + local.get $5 local.get $1 local.get $1 f64.mul - local.tee $2 + local.tee $3 f64.mul f64.const 0.05338123784456704 local.get $1 f64.const 0.024528318116654728 f64.mul f64.add - local.get $2 + local.get $3 f64.const 0.002974357433599673 local.get $1 f64.const 0.009465647849436732 @@ -10061,9 +9304,150 @@ f32.demote_f64 return end - f64.const -1 local.get $2 + i32.const 2139095040 + i32.ge_u + if + local.get $0 + local.get $0 + f32.sub + return + end + block $~lib/math/rempio2f|inlined.2 (result i32) + local.get $2 + i32.const 1305022427 + i32.lt_u + if + local.get $0 + f64.promote_f32 + local.get $0 + f64.promote_f32 + f64.const 0.6366197723675814 + f64.mul + f64.nearest + local.tee $1 + f64.const 1.5707963109016418 + f64.mul + f64.sub + local.get $1 + f64.const 1.5893254773528196e-08 + f64.mul + f64.sub + global.set $~lib/math/rempio2f_y + local.get $1 + i32.trunc_f64_s + br $~lib/math/rempio2f|inlined.2 + end + local.get $2 + i32.const 23 + i32.shr_s + i32.const 152 + i32.sub + local.tee $4 + i32.const 6 + i32.shr_s + local.tee $8 + call $~lib/array/Array#__unchecked_get + local.set $10 + local.get $8 + i32.const 1 + i32.add + call $~lib/array/Array#__unchecked_get + local.set $6 + local.get $4 + i32.const 63 + i32.and + local.tee $4 + i32.const 32 + i32.gt_s + if (result i64) + local.get $6 + local.get $4 + i32.const 32 + i32.sub + i64.extend_i32_s + i64.shl + local.get $8 + i32.const 2 + i32.add + call $~lib/array/Array#__unchecked_get + i64.const 96 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + else + local.get $6 + i64.const 32 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + end + local.set $7 + f64.const 8.515303950216386e-20 + local.get $0 + f64.promote_f32 + f64.copysign + local.get $2 + i32.const 8388607 + i32.and + i32.const 8388608 + i32.or + i64.extend_i32_s + local.tee $11 + local.get $10 + local.get $4 + i64.extend_i32_s + i64.shl + local.get $6 + i64.const 64 + local.get $4 + i64.extend_i32_s + i64.sub + i64.shr_u + i64.or + i64.mul + local.get $7 + local.get $11 + i64.mul + i64.const 32 + i64.shr_u + i64.add + local.tee $6 + i64.const 2 + i64.shl + local.tee $7 + f64.convert_i64_s + f64.mul + global.set $~lib/math/rempio2f_y + i32.const 0 + local.get $6 + i64.const 62 + i64.shr_u + local.get $7 + i64.const 63 + i64.shr_u + i64.add + i32.wrap_i64 + local.tee $2 + i32.sub + local.get $2 + local.get $9 + select + end + local.set $2 + global.get $~lib/math/rempio2f_y + local.tee $3 local.get $3 + f64.mul + local.tee $1 + local.get $3 + f64.mul + local.set $5 + local.get $3 + local.get $5 f64.const 0.3333313950307914 local.get $1 f64.const 0.13339200271297674 @@ -10071,18 +9455,18 @@ f64.add f64.mul f64.add - local.get $3 + local.get $5 local.get $1 local.get $1 f64.mul - local.tee $2 + local.tee $3 f64.mul f64.const 0.05338123784456704 local.get $1 f64.const 0.024528318116654728 f64.mul f64.add - local.get $2 + local.get $3 f64.const 0.002974357433599673 local.get $1 f64.const 0.009465647849436732 @@ -10092,17 +9476,27 @@ f64.add f64.mul f64.add - f64.div + local.set $1 + local.get $2 + i32.const 1 + i32.and + if + f64.const -1 + local.get $1 + f64.div + local.set $1 + end + local.get $1 f32.demote_f64 ) - (func $std/math/test_tanf (; 144 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_tanf (; 150 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.tan local.get $1 local.get $2 call $std/math/check ) - (func $~lib/math/NativeMath.tanh (; 145 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.tanh (; 151 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 f64) (local $2 i32) (local $3 i64) @@ -10181,7 +9575,7 @@ local.get $0 f64.copysign ) - (func $std/math/test_tanh (; 146 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/math/test_tanh (; 152 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 call $~lib/math/NativeMath.tanh local.get $1 @@ -10197,7 +9591,7 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.tanh (; 147 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.tanh (; 153 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 f32) (local $2 i32) local.get $0 @@ -10271,14 +9665,14 @@ local.get $0 f32.copysign ) - (func $std/math/test_tanhf (; 148 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/math/test_tanhf (; 154 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 call $~lib/math/NativeMathf.tanh local.get $1 local.get $2 call $std/math/check ) - (func $std/math/test_trunc (; 149 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/math/test_trunc (; 155 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $0 f64.trunc local.get $1 @@ -10294,23 +9688,19 @@ i32.const 0 end ) - (func $std/math/test_truncf (; 150 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/math/test_truncf (; 156 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $0 f32.trunc local.get $1 f32.const 0 call $std/math/check ) - (func $~lib/math/NativeMath.imul (; 151 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) - (local $2 f64) + (func $~lib/math/NativeMath.imul (; 157 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) local.get $0 local.get $1 f64.add - local.tee $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if f64.const 0 return @@ -10338,12 +9728,10 @@ i32.mul f64.convert_i32_s ) - (func $~lib/math/NativeMath.clz32 (; 152 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.clz32 (; 158 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.ne + call $~lib/builtins/isFinite + i32.eqz if f64.const 32 return @@ -10361,169 +9749,11 @@ i32.clz f64.convert_i32_s ) - (func $~lib/math/ipow64 (; 153 ;) (type $FUNCSIG$jji) (param $0 i64) (param $1 i32) (result i64) + (func $~lib/math/ipow64 (; 159 ;) (type $FUNCSIG$jji) (param $0 i64) (param $1 i32) (result i64) (local $2 i64) - (local $3 i32) i64.const 1 local.set $2 - local.get $1 - i32.const 0 - i32.lt_s - if - i64.const 0 - return - end - block $break|0 - block $case2|0 - block $case1|0 - local.get $1 - if - local.get $1 - i32.const 1 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 2 - i32.eq - br_if $case2|0 - br $break|0 - end - i64.const 1 - return - end - local.get $0 - return - end - local.get $0 - local.get $0 - i64.mul - return - end - i32.const 32 - local.get $1 - i32.clz - i32.sub - local.tee $3 - i32.const 6 - i32.le_s - if - block $break|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - local.get $3 - i32.const 6 - i32.ne - if - local.get $3 - i32.const 1 - i32.sub - br_table $case5|1 $case4|1 $case3|1 $case2|1 $case1|1 $break|1 - end - local.get $0 - i64.const 1 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - local.get $1 - i32.const 1 - i32.shr_s - local.set $1 - local.get $0 - local.get $0 - i64.mul - local.set $0 - end - local.get $0 - local.get $2 - i64.mul - local.get $2 - local.get $1 - i32.const 1 - i32.and - select - local.set $2 - end - local.get $2 - return - end - loop $continue|2 + loop $continue|0 local.get $1 i32.const 0 i32.gt_s @@ -10545,12 +9775,12 @@ local.get $0 i64.mul local.set $0 - br $continue|2 + br $continue|0 end end local.get $2 ) - (func $~lib/math/ipow32f (; 154 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) + (func $~lib/math/ipow32f (; 160 ;) (type $FUNCSIG$ffi) (param $0 f32) (param $1 i32) (result f32) (local $2 f32) (local $3 i32) local.get $1 @@ -10596,7 +9826,7 @@ end local.get $2 ) - (func $~lib/math/ipow64f (; 155 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) + (func $~lib/math/ipow64f (; 161 ;) (type $FUNCSIG$ddi) (param $0 f64) (param $1 i32) (result f64) (local $2 f64) (local $3 i32) local.get $1 @@ -10642,10 +9872,10 @@ end local.get $2 ) - (func $start:std/math (; 156 ;) (type $FUNCSIG$v) - (local $0 f64) - (local $1 f32) - (local $2 i32) + (func $start:std/math (; 162 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 f64) + (local $2 f32) f64.const 2.718281828459045 global.get $~lib/bindings/Math/E f64.const 0 @@ -32172,27 +31402,29 @@ i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom loop $repeat|0 - local.get $2 - f64.convert_i32_s - f64.const 1e6 - f64.lt - if + block $break|0 + local.get $0 + f64.convert_i32_s + f64.const 1e6 + f64.lt + i32.eqz + br_if $break|0 call $~lib/math/NativeMath.random - local.tee $0 + local.tee $1 f64.const 0 f64.ge if (result i32) - local.get $0 + local.get $1 f64.const 1 f64.lt else i32.const 0 end if - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|0 else i32.const 0 @@ -32209,29 +31441,31 @@ i64.reinterpret_f64 call $~lib/math/NativeMath.seedRandom i32.const 0 - local.set $2 + local.set $0 loop $repeat|1 - local.get $2 - f64.convert_i32_s - f64.const 1e6 - f64.lt - if + block $break|1 + local.get $0 + f64.convert_i32_s + f64.const 1e6 + f64.lt + i32.eqz + br_if $break|1 call $~lib/math/NativeMathf.random - local.tee $1 + local.tee $2 f32.const 0 f32.ge if (result i32) - local.get $1 + local.get $2 f32.const 1 f32.lt else i32.const 0 end if - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $repeat|1 else i32.const 0 @@ -40277,9 +39511,8 @@ f32.const nan:0x400000 i32.const 1 call $~lib/math/ipow32f - local.tee $1 - local.get $1 - f32.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 i32.const 24 @@ -40291,9 +39524,8 @@ f32.const nan:0x400000 i32.const -1 call $~lib/math/ipow32f - local.tee $1 - local.get $1 - f32.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 i32.const 24 @@ -40305,9 +39537,8 @@ f32.const nan:0x400000 i32.const 2 call $~lib/math/ipow32f - local.tee $1 - local.get $1 - f32.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 i32.const 24 @@ -40488,9 +39719,8 @@ f64.const nan:0x8000000000000 i32.const 1 call $~lib/math/ipow64f - local.tee $0 - local.get $0 - f64.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 i32.const 24 @@ -40502,9 +39732,8 @@ f64.const nan:0x8000000000000 i32.const -1 call $~lib/math/ipow64f - local.tee $0 - local.get $0 - f64.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 i32.const 24 @@ -40516,9 +39745,8 @@ f64.const nan:0x8000000000000 i32.const 2 call $~lib/math/ipow64f - local.tee $0 - local.get $0 - f64.eq + call $~lib/builtins/isNaN + i32.eqz if i32.const 0 i32.const 24 @@ -40671,10 +39899,10 @@ unreachable end ) - (func $start (; 157 ;) (type $FUNCSIG$v) + (func $start (; 163 ;) (type $FUNCSIG$v) call $start:std/math ) - (func $null (; 158 ;) (type $FUNCSIG$v) + (func $null (; 164 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/mod.optimized.wat b/tests/compiler/std/mod.optimized.wat index ba92e95a..231cbc08 100644 --- a/tests/compiler/std/mod.optimized.wat +++ b/tests/compiler/std/mod.optimized.wat @@ -1,10 +1,12 @@ (module (type $FUNCSIG$iddd (func (param f64 f64 f64) (result i32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $FUNCSIG$id (func (param f64) (result i32))) (type $FUNCSIG$idd (func (param f64 f64) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ifff (func (param f32 f32 f32) (result i32))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) + (type $FUNCSIG$if (func (param f32) (result i32))) (type $FUNCSIG$iff (func (param f32 f32) (result i32))) (type $FUNCSIG$v (func)) (import "math" "mod" (func $std/mod/mod (param f64 f64) (result f64))) @@ -14,7 +16,12 @@ (export "memory" (memory $0)) (export "mod" (func $std/mod/mod)) (start $start) - (func $~lib/math/NativeMath.mod (; 2 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) + (func $~lib/builtins/isNaN (; 2 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + local.get $0 + local.get $0 + f64.ne + ) + (func $~lib/math/NativeMath.mod (; 3 ;) (type $FUNCSIG$ddd) (param $0 f64) (param $1 f64) (result f64) (local $2 i64) (local $3 i64) (local $4 i64) @@ -59,8 +66,7 @@ i32.const 1 else local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN end if local.get $0 @@ -142,7 +148,7 @@ local.get $2 local.get $3 i64.ge_u - if + if (result i64) local.get $2 local.get $3 i64.eq @@ -150,9 +156,9 @@ local.get $2 local.get $3 i64.sub - local.set $2 + else + local.get $2 end - local.get $2 i64.const 1 i64.shl local.set $2 @@ -187,21 +193,21 @@ local.get $4 local.get $3 i64.sub - local.tee $3 + local.tee $4 i64.const 0 i64.gt_s if (result i64) local.get $2 i64.const 4503599627370496 i64.sub - local.get $3 + local.get $4 i64.const 52 i64.shl i64.or else local.get $2 i64.const 0 - local.get $3 + local.get $4 i64.sub i64.const 1 i64.add @@ -218,14 +224,12 @@ local.get $0 f64.mul ) - (func $std/mod/check (; 3 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $std/mod/check (; 4 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) local.get $1 - local.get $1 - f64.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f64.ne + call $~lib/builtins/isNaN return end local.get $1 @@ -245,7 +249,7 @@ local.get $1 f64.eq ) - (func $std/mod/test_fmod (; 4 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) + (func $std/mod/test_fmod (; 5 ;) (type $FUNCSIG$iddd) (param $0 f64) (param $1 f64) (param $2 f64) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMath.mod @@ -261,7 +265,12 @@ i32.const 0 end ) - (func $~lib/math/NativeMathf.mod (; 5 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) + (func $~lib/builtins/isNaN (; 6 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + local.get $0 + local.get $0 + f32.ne + ) + (func $~lib/math/NativeMathf.mod (; 7 ;) (type $FUNCSIG$fff) (param $0 f32) (param $1 f32) (result f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -304,8 +313,7 @@ i32.const 1 else local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN end if local.get $0 @@ -381,7 +389,7 @@ local.get $2 local.get $3 i32.ge_u - if + if (result i32) local.get $2 local.get $3 i32.eq @@ -389,9 +397,9 @@ local.get $2 local.get $3 i32.sub - local.set $2 + else + local.get $2 end - local.get $2 i32.const 1 i32.shl local.set $2 @@ -426,21 +434,21 @@ local.get $4 local.get $3 i32.sub - local.tee $3 + local.tee $4 i32.const 0 i32.gt_s if (result i32) local.get $2 i32.const 8388608 i32.sub - local.get $3 + local.get $4 i32.const 23 i32.shl i32.or else local.get $2 i32.const 1 - local.get $3 + local.get $4 i32.sub i32.shr_u end @@ -453,14 +461,12 @@ local.get $0 f32.mul ) - (func $std/mod/check (; 6 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) + (func $std/mod/check (; 8 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32) local.get $1 - local.get $1 - f32.ne + call $~lib/builtins/isNaN if local.get $0 - local.get $0 - f32.ne + call $~lib/builtins/isNaN return end local.get $1 @@ -480,14 +486,14 @@ local.get $1 f32.eq ) - (func $std/mod/test_fmodf (; 7 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) + (func $std/mod/test_fmodf (; 9 ;) (type $FUNCSIG$ifff) (param $0 f32) (param $1 f32) (param $2 f32) (result i32) local.get $0 local.get $1 call $~lib/math/NativeMathf.mod local.get $2 call $std/mod/check ) - (func $start:std/mod (; 8 ;) (type $FUNCSIG$v) + (func $start:std/mod (; 10 ;) (type $FUNCSIG$v) f64.const 3 f64.const 2 f64.const 1 @@ -2244,10 +2250,10 @@ unreachable end ) - (func $start (; 9 ;) (type $FUNCSIG$v) + (func $start (; 11 ;) (type $FUNCSIG$v) call $start:std/mod ) - (func $null (; 10 ;) (type $FUNCSIG$v) + (func $null (; 12 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/object-literal.optimized.wat b/tests/compiler/std/object-literal.optimized.wat index 5bffdc35..dece1220 100644 --- a/tests/compiler/std/object-literal.optimized.wat +++ b/tests/compiler/std/object-literal.optimized.wat @@ -1,9 +1,9 @@ (module (type $FUNCSIG$iii (func (param i32 i32) (result i32))) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$v (func)) - (type $FUNCSIG$ii (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d") @@ -86,7 +86,15 @@ i32.store offset=12 local.get $3 ) - (func $~lib/util/string/compareImpl (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#get:length (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) i32.const 24 @@ -122,7 +130,7 @@ end local.get $3 ) - (func $~lib/string/String.__eq (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String.__eq (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 24 @@ -138,16 +146,10 @@ select br_if $folding-inner0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $1 - i32.const 20 - i32.load - i32.const 1 - i32.shr_u + i32.const 24 + call $~lib/string/String#get:length i32.ne br_if $folding-inner0 local.get $0 @@ -158,7 +160,7 @@ end i32.const 0 ) - (func $std/object-literal/bar (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/object-literal/bar (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.load i32.const 1 @@ -184,7 +186,7 @@ unreachable end ) - (func $start:std/object-literal (; 5 ;) (type $FUNCSIG$v) + (func $start:std/object-literal (; 6 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 112 global.set $~lib/rt/stub/startOffset @@ -238,10 +240,10 @@ unreachable end ) - (func $start (; 6 ;) (type $FUNCSIG$v) + (func $start (; 7 ;) (type $FUNCSIG$v) call $start:std/object-literal ) - (func $null (; 7 ;) (type $FUNCSIG$v) + (func $null (; 8 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 50181450..1fd696f1 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -282,37 +282,33 @@ return end i32.const 1 + local.get $6 + i32.const 0 + i32.ne + i32.const 0 + local.get $8 + i32.const 2146435072 + i32.eq + select + i32.const 1 local.get $8 i32.const 2146435072 i32.gt_s + i32.const 1 + local.get $19 + i32.const 0 + i32.ne + i32.const 0 + local.get $4 + i32.const 2146435072 + i32.eq + select local.get $4 i32.const 2146435072 i32.gt_s - if (result i32) - i32.const 1 - else - local.get $19 - i32.const 0 - i32.ne - i32.const 0 - local.get $4 - i32.const 2146435072 - i32.eq - select - end select - if (result i32) - i32.const 1 - else - local.get $6 - i32.const 0 - i32.ne - i32.const 0 - local.get $8 - i32.const 2146435072 - i32.eq - select - end + select + select if local.get $0 local.get $1 @@ -576,44 +572,40 @@ i32.const 1072693247 i32.lt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.lt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end local.get $4 i32.const 1072693248 i32.gt_s if + local.get $7 + f64.const 1.e+300 + f64.mul + f64.const 1.e+300 + f64.mul + local.get $7 + f64.const 1e-300 + f64.mul + f64.const 1e-300 + f64.mul local.get $9 i32.const 0 i32.gt_s - if (result f64) - local.get $7 - f64.const 1.e+300 - f64.mul - f64.const 1.e+300 - f64.mul - else - local.get $7 - f64.const 1e-300 - f64.mul - f64.const 1e-300 - f64.mul - end + select return end local.get $3 @@ -934,7 +926,6 @@ i32.sub local.get $5 i32.or - br_if $folding-inner0 local.get $1 f64.const 8.008566259537294e-17 f64.add @@ -942,6 +933,7 @@ local.get $2 f64.sub f64.gt + i32.or br_if $folding-inner0 else local.get $12 @@ -955,12 +947,12 @@ i32.sub local.get $5 i32.or - br_if $folding-inner1 local.get $1 local.get $0 local.get $2 f64.sub f64.le + i32.or br_if $folding-inner1 end end @@ -1167,7 +1159,39 @@ i32.trunc_f64_s call $std/operator-overloading/Tester#constructor ) - (func $std/operator-overloading/TesterInlineStatic#constructor (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/operator-overloading/Tester.equals (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load + local.get $1 + i32.load + i32.eq + if (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.load offset=4 + i32.eq + else + i32.const 0 + end + ) + (func $std/operator-overloading/Tester.notEquals (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.load + local.get $1 + i32.load + i32.ne + if (result i32) + local.get $0 + i32.load offset=4 + local.get $1 + i32.load offset=4 + i32.ne + else + i32.const 0 + end + ) + (func $std/operator-overloading/TesterInlineStatic#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) i32.const 4 call $~lib/rt/stub/__alloc @@ -1179,7 +1203,7 @@ i32.store offset=4 local.get $2 ) - (func $std/operator-overloading/TesterInlineInstance#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/operator-overloading/TesterInlineInstance#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) i32.const 5 call $~lib/rt/stub/__alloc @@ -1191,7 +1215,7 @@ i32.store offset=4 local.get $2 ) - (func $start:std/operator-overloading (; 8 ;) (type $FUNCSIG$v) + (func $start:std/operator-overloading (; 10 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 80 @@ -1581,21 +1605,8 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/eq2 global.get $std/operator-overloading/eq1 - local.tee $0 - i32.load global.get $std/operator-overloading/eq2 - local.tee $1 - i32.load - i32.eq - if (result i32) - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.eq - else - i32.const 0 - end + call $std/operator-overloading/Tester.equals global.set $std/operator-overloading/eq global.get $std/operator-overloading/eq i32.const 1 @@ -1617,21 +1628,8 @@ call $std/operator-overloading/Tester#constructor global.set $std/operator-overloading/eq4 global.get $std/operator-overloading/eq3 - local.tee $0 - i32.load global.get $std/operator-overloading/eq4 - local.tee $1 - i32.load - i32.eq - if (result i32) - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.eq - else - i32.const 0 - end + call $std/operator-overloading/Tester.equals global.set $std/operator-overloading/eqf global.get $std/operator-overloading/eqf if @@ -1643,21 +1641,8 @@ unreachable end global.get $std/operator-overloading/eq1 - local.tee $0 - i32.load global.get $std/operator-overloading/eq2 - local.tee $1 - i32.load - i32.ne - if (result i32) - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.ne - else - i32.const 0 - end + call $std/operator-overloading/Tester.notEquals global.set $std/operator-overloading/eq global.get $std/operator-overloading/eq if @@ -1669,21 +1654,8 @@ unreachable end global.get $std/operator-overloading/eq3 - local.tee $0 - i32.load global.get $std/operator-overloading/eq4 - local.tee $1 - i32.load - i32.ne - if (result i32) - local.get $0 - i32.load offset=4 - local.get $1 - i32.load offset=4 - i32.ne - else - i32.const 0 - end + call $std/operator-overloading/Tester.notEquals global.set $std/operator-overloading/eqf global.get $std/operator-overloading/eqf i32.const 1 @@ -2404,10 +2376,10 @@ unreachable end ) - (func $start (; 9 ;) (type $FUNCSIG$v) + (func $start (; 11 ;) (type $FUNCSIG$v) call $start:std/operator-overloading ) - (func $null (; 10 ;) (type $FUNCSIG$v) + (func $null (; 12 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index 5d6337a8..a1d95af2 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -1,5 +1,7 @@ (module + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) + (type $FUNCSIG$viif (func (param i32 i32 f32))) (type $FUNCSIG$v (func)) (type $FUNCSIG$vi (func (param i32))) (type $FUNCSIG$vii (func (param i32 i32))) @@ -14,7 +16,12 @@ (global $std/pointer/buf (mut i32) (i32.const 0)) (export "memory" (memory $0)) (start $start) - (func $~lib/memory/memory.fill (; 1 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/pointer/Pointer#dec (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 8 + i32.sub + ) + (func $~lib/memory/memory.fill (; 2 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.const 0 @@ -58,7 +65,7 @@ i32.const 0 i32.store8 ) - (func $~lib/memory/memory.copy (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/memory/memory.copy (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -232,7 +239,16 @@ end end ) - (func $start:std/pointer (; 3 ;) (type $FUNCSIG$v) + (func $std/pointer/Pointer#set (; 4 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + local.get $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + local.get $2 + f32.store + ) + (func $start:std/pointer (; 5 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 8 @@ -262,13 +278,12 @@ unreachable end global.get $std/pointer/one - local.tee $0 i32.const 1 i32.store - local.get $0 + global.get $std/pointer/one i32.const 2 i32.store offset=4 - local.get $0 + global.get $std/pointer/one i32.load i32.const 1 i32.ne @@ -338,10 +353,9 @@ i32.add global.set $std/pointer/one global.get $std/pointer/one - local.tee $0 global.set $std/pointer/nextOne global.get $std/pointer/nextOne - local.get $0 + global.get $std/pointer/one i32.ne if i32.const 0 @@ -374,12 +388,10 @@ unreachable end global.get $std/pointer/two - i32.const 8 - i32.sub + call $std/pointer/Pointer#dec global.set $std/pointer/two global.get $std/pointer/two - i32.const 8 - i32.sub + call $std/pointer/Pointer#dec global.set $std/pointer/two global.get $std/pointer/two i32.const 8 @@ -466,15 +478,14 @@ i32.const 0 global.set $std/pointer/buf global.get $std/pointer/buf - local.tee $0 + i32.const 0 f32.const 1.100000023841858 - f32.store - local.get $0 - i32.const 4 - i32.add + call $std/pointer/Pointer#set + global.get $std/pointer/buf + i32.const 1 f32.const 1.2000000476837158 - f32.store - local.get $0 + call $std/pointer/Pointer#set + global.get $std/pointer/buf f32.load f32.const 1.100000023841858 f32.ne @@ -553,10 +564,11 @@ global.get $std/pointer/buf i32.const 8 i32.add - local.tee $0 f32.const 1.2999999523162842 f32.store - local.get $0 + global.get $std/pointer/buf + i32.const 8 + i32.add f32.load f32.const 1.2999999523162842 f32.ne @@ -595,10 +607,9 @@ unreachable end global.get $std/pointer/buf - local.tee $0 f32.const 1.399999976158142 f32.store - local.get $0 + global.get $std/pointer/buf f32.load f32.const 1.399999976158142 f32.ne @@ -623,10 +634,10 @@ unreachable end ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 6 ;) (type $FUNCSIG$v) call $start:std/pointer ) - (func $null (; 5 ;) (type $FUNCSIG$v) + (func $null (; 7 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 1d22efe1..5c63c1f1 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1751,7 +1751,14 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash8 (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/set/Set#find (; 29 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -1794,7 +1801,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -1802,15 +1809,12 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/rt/pure/__retainRelease (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/__retainRelease (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 i32.ne @@ -1836,7 +1840,7 @@ end local.get $1 ) - (func $~lib/rt/pure/__release (; 31 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/__release (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 508 i32.gt_u @@ -1847,7 +1851,7 @@ call $~lib/rt/pure/decrement end ) - (func $~lib/set/Set#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1875,7 +1879,7 @@ local.set $5 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $2 local.get $0 i32.load offset=16 i32.const 3 @@ -1883,29 +1887,26 @@ i32.add local.set $7 local.get $5 - local.set $2 + local.set $3 loop $continue|0 - local.get $3 + local.get $2 local.get $7 i32.ne if - local.get $3 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - local.get $2 local.get $3 + local.get $2 i32.load8_s i32.store8 - local.get $2 local.get $3 + local.get $2 i32.load8_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 @@ -1916,17 +1917,17 @@ i32.load i32.store offset=4 local.get $8 - local.get $2 + local.get $3 i32.store - local.get $2 + local.get $3 i32.const 8 i32.add - local.set $2 + local.set $3 end - local.get $3 + local.get $2 i32.const 8 i32.add - local.set $3 + local.set $2 br $continue|0 end end @@ -1957,24 +1958,19 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash8 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -2049,7 +2045,7 @@ i32.store end ) - (func $~lib/set/Set#delete (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -2058,10 +2054,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -2115,7 +2108,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 35 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 36 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -2362,7 +2355,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 36 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 37 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 4 @@ -2390,21 +2383,18 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#has (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2432,7 +2422,7 @@ local.set $5 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $2 local.get $0 i32.load offset=16 i32.const 3 @@ -2440,29 +2430,26 @@ i32.add local.set $7 local.get $5 - local.set $2 + local.set $3 loop $continue|0 - local.get $3 + local.get $2 local.get $7 i32.ne if - local.get $3 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - local.get $2 local.get $3 + local.get $2 i32.load8_u i32.store8 - local.get $2 local.get $3 + local.get $2 i32.load8_u - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 local.get $1 i32.and i32.const 2 @@ -2473,17 +2460,17 @@ i32.load i32.store offset=4 local.get $8 - local.get $2 + local.get $3 i32.store - local.get $2 + local.get $3 i32.const 8 i32.add - local.set $2 + local.set $3 end - local.get $3 + local.get $2 i32.const 8 i32.add - local.set $3 + local.set $2 br $continue|0 end end @@ -2514,22 +2501,17 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash8 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -2604,17 +2586,14 @@ i32.store end ) - (func $~lib/set/Set#delete (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash8 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -2668,7 +2647,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 41 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 42 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -2915,7 +2894,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 42 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 43 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 5 @@ -2943,7 +2922,22 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/hash16 (; 44 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -2128831035 + i32.xor + i32.const 16777619 + i32.mul + local.get $0 + i32.const 8 + i32.shr_u + i32.xor + i32.const 16777619 + i32.mul + ) + (func $~lib/set/Set#find (; 45 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -2986,7 +2980,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -2994,24 +2988,12 @@ i32.shl i32.const 16 i32.shr_s - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3032,74 +3014,62 @@ f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $2 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 + local.set $7 local.get $5 - local.set $2 + local.set $3 loop $continue|0 - local.get $3 - local.get $8 + local.get $2 + local.get $7 i32.ne if - local.get $3 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - local.get $2 local.get $3 + local.get $2 i32.load16_s i32.store16 - local.get $2 local.get $3 + local.get $2 i32.load16_s - local.tee $6 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $6 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $4 i32.add - local.tee $6 + local.tee $8 i32.load i32.store offset=4 - local.get $6 - local.get $2 + local.get $8 + local.get $3 i32.store - local.get $2 + local.get $3 i32.const 8 i32.add - local.set $2 + local.set $3 end - local.get $3 + local.get $2 i32.const 8 i32.add - local.set $3 + local.set $2 br $continue|0 end end @@ -3119,7 +3089,7 @@ call $~lib/rt/pure/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 @@ -3130,33 +3100,19 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 16 i32.shl i32.const 16 i32.shr_s - local.tee $2 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $2 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash16 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -3231,7 +3187,7 @@ i32.store end ) - (func $~lib/set/Set#delete (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -3240,19 +3196,7 @@ i32.shl i32.const 16 i32.shr_s - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -3306,7 +3250,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 48 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 50 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -3553,7 +3497,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 49 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 51 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 6 @@ -3581,30 +3525,18 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#has (; 50 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 51 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3625,74 +3557,62 @@ f64.const 2.6666666666666665 f64.mul i32.trunc_f64_s - local.tee $7 + local.tee $6 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 local.get $0 i32.load offset=8 - local.tee $3 + local.tee $2 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $8 + local.set $7 local.get $5 - local.set $2 + local.set $3 loop $continue|0 - local.get $3 - local.get $8 + local.get $2 + local.get $7 i32.ne if - local.get $3 + local.get $2 i32.load offset=4 i32.const 1 i32.and i32.eqz if - local.get $2 local.get $3 + local.get $2 i32.load16_u i32.store16 - local.get $2 local.get $3 + local.get $2 i32.load16_u - local.tee $6 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $6 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 local.get $1 i32.and i32.const 2 i32.shl local.get $4 i32.add - local.tee $6 + local.tee $8 i32.load i32.store offset=4 - local.get $6 - local.get $2 + local.get $8 + local.get $3 i32.store - local.get $2 + local.get $3 i32.const 8 i32.add - local.set $2 + local.set $3 end - local.get $3 + local.get $2 i32.const 8 i32.add - local.set $3 + local.set $2 br $continue|0 end end @@ -3712,7 +3632,7 @@ call $~lib/rt/pure/__retainRelease i32.store offset=8 local.get $0 - local.get $7 + local.get $6 i32.store offset=12 local.get $0 local.get $0 @@ -3723,31 +3643,17 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $2 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $2 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash16 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -3822,26 +3728,14 @@ i32.store end ) - (func $~lib/set/Set#delete (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 local.get $1 i32.const 65535 i32.and - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash16 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -3895,7 +3789,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 54 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 56 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -4142,7 +4036,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 55 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 57 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 7 @@ -4170,7 +4064,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 56 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 58 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -4201,7 +4095,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/set/Set#find (; 57 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 59 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -4242,7 +4136,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -4251,7 +4145,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 59 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 61 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4358,7 +4252,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 60 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 62 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4441,7 +4335,7 @@ i32.store end ) - (func $~lib/set/Set#delete (; 61 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -4500,7 +4394,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 62 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 64 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -4747,7 +4641,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 63 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 65 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 8 @@ -4775,7 +4669,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $std/set/testNumeric (; 64 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 66 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -5022,7 +4916,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#clear (; 65 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 67 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load @@ -5050,7 +4944,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 66 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 68 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 9 @@ -5078,7 +4972,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 67 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 69 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 @@ -5144,7 +5038,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/set/Set#find (; 68 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 70 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -5185,7 +5079,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 69 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 71 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 @@ -5194,7 +5088,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 70 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 72 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5301,7 +5195,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 71 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#add (; 73 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5384,7 +5278,7 @@ i32.store end ) - (func $~lib/set/Set#delete (; 72 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#delete (; 74 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) local.get $0 @@ -5444,7 +5338,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 73 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 75 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/set/Set#constructor @@ -5691,7 +5585,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 74 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 76 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 10 @@ -5719,7 +5613,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $std/set/testNumeric (; 75 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 77 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/set/Set#constructor @@ -5966,7 +5860,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 76 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 78 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 11 @@ -5994,7 +5888,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 77 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 79 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -6035,7 +5929,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 78 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#has (; 80 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 local.get $1 local.get $1 @@ -6045,7 +5939,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 79 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6153,7 +6047,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 80 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#add (; 82 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6237,7 +6131,7 @@ i32.store end ) - (func $~lib/set/Set#delete (; 81 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#delete (; 83 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 i32) (local $3 i32) local.get $0 @@ -6298,7 +6192,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 82 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 84 ;) (type $FUNCSIG$v) (local $0 f32) (local $1 i32) call $~lib/set/Set#constructor @@ -6545,7 +6439,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#constructor (; 83 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 85 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 12 @@ -6573,7 +6467,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/set/Set#find (; 84 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 86 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -6614,7 +6508,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 85 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#has (; 87 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) local.get $0 local.get $1 local.get $1 @@ -6624,7 +6518,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 86 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 88 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6732,7 +6626,7 @@ local.get $5 call $~lib/rt/pure/__release ) - (func $~lib/set/Set#add (; 87 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#add (; 89 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6816,7 +6710,7 @@ i32.store end ) - (func $~lib/set/Set#delete (; 88 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#delete (; 90 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) local.get $0 @@ -6877,7 +6771,7 @@ call $~lib/set/Set#rehash end ) - (func $std/set/testNumeric (; 89 ;) (type $FUNCSIG$v) + (func $std/set/testNumeric (; 91 ;) (type $FUNCSIG$v) (local $0 f64) (local $1 i32) call $~lib/set/Set#constructor @@ -7124,7 +7018,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $start (; 90 ;) (type $FUNCSIG$v) + (func $start (; 92 ;) (type $FUNCSIG$v) call $std/set/testNumeric call $std/set/testNumeric call $std/set/testNumeric @@ -7136,7 +7030,7 @@ call $std/set/testNumeric call $std/set/testNumeric ) - (func $~lib/rt/pure/markGray (; 91 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/markGray (; 93 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -7160,7 +7054,7 @@ call $~lib/rt/__visit_members end ) - (func $~lib/rt/pure/scanBlack (; 92 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scanBlack (; 94 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load offset=4 @@ -7173,7 +7067,7 @@ i32.const 4 call $~lib/rt/__visit_members ) - (func $~lib/rt/pure/scan (; 93 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scan (; 95 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -7207,7 +7101,7 @@ end end ) - (func $~lib/rt/pure/collectWhite (; 94 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/collectWhite (; 96 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -7235,7 +7129,7 @@ local.get $0 call $~lib/rt/tlsf/freeBlock ) - (func $~lib/rt/pure/__visit (; 95 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 97 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i32.const 508 i32.lt_u @@ -7345,7 +7239,7 @@ unreachable end ) - (func $~lib/rt/__visit_members (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 98 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $folding-inner0 block $switch$1$default block $switch$1$case$4 @@ -7379,7 +7273,7 @@ local.get $1 call $~lib/rt/pure/__visit ) - (func $null (; 97 ;) (type $FUNCSIG$v) + (func $null (; 99 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index 369db30b..0499aa5e 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -22,7 +22,15 @@ (global $std/string-utf8/ptr (mut i32) (i32.const 0)) (export "memory" (memory $0)) (start $start) - (func $~lib/string/String#get:lengthUTF8 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/string/String#get:lengthUTF8 (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -30,11 +38,7 @@ i32.const 1 local.set $1 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $3 loop $continue|0 local.get $2 @@ -124,7 +128,7 @@ end local.get $1 ) - (func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/stub/__alloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -198,7 +202,7 @@ i32.store offset=12 local.get $3 ) - (func $~lib/string/String#toUTF8 (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#toUTF8 (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -212,18 +216,14 @@ call $~lib/rt/stub/__alloc local.set $5 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $6 loop $continue|0 - local.get $4 + local.get $3 local.get $6 i32.lt_u if - local.get $4 + local.get $3 i32.const 1 i32.shl local.get $0 @@ -232,7 +232,7 @@ local.tee $1 i32.const 128 i32.lt_u - if (result i32) + if local.get $2 local.get $5 i32.add @@ -241,22 +241,23 @@ local.get $2 i32.const 1 i32.add + local.set $2 else local.get $1 i32.const 2048 i32.lt_u - if (result i32) + if local.get $2 local.get $5 i32.add - local.tee $3 + local.tee $4 local.get $1 i32.const 6 i32.shr_u i32.const 192 i32.or i32.store8 - local.get $3 + local.get $4 local.get $1 i32.const 63 i32.and @@ -266,12 +267,13 @@ local.get $2 i32.const 2 i32.add + local.set $2 else local.get $2 local.get $5 i32.add - local.set $3 - local.get $4 + local.set $4 + local.get $3 i32.const 1 i32.add local.get $6 @@ -284,7 +286,7 @@ i32.eq select if - local.get $4 + local.get $3 i32.const 1 i32.add i32.const 1 @@ -298,7 +300,7 @@ i32.const 56320 i32.eq if - local.get $3 + local.get $4 local.get $1 i32.const 1023 i32.and @@ -316,7 +318,7 @@ i32.const 240 i32.or i32.store8 - local.get $3 + local.get $4 local.get $1 i32.const 12 i32.shr_u @@ -325,7 +327,7 @@ i32.const 128 i32.or i32.store8 offset=1 - local.get $3 + local.get $4 local.get $1 i32.const 6 i32.shr_u @@ -334,7 +336,7 @@ i32.const 128 i32.or i32.store8 offset=2 - local.get $3 + local.get $4 local.get $1 i32.const 63 i32.and @@ -345,21 +347,21 @@ i32.const 4 i32.add local.set $2 - local.get $4 + local.get $3 i32.const 2 i32.add - local.set $4 + local.set $3 br $continue|0 end end - local.get $3 + local.get $4 local.get $1 i32.const 12 i32.shr_u i32.const 224 i32.or i32.store8 - local.get $3 + local.get $4 local.get $1 i32.const 6 i32.shr_u @@ -368,7 +370,7 @@ i32.const 128 i32.or i32.store8 offset=1 - local.get $3 + local.get $4 local.get $1 i32.const 63 i32.and @@ -378,13 +380,13 @@ local.get $2 i32.const 3 i32.add + local.set $2 end end - local.set $2 - local.get $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $continue|0 end end @@ -395,7 +397,7 @@ i32.store8 local.get $5 ) - (func $~lib/memory/memory.copy (; 4 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) block $~lib/util/memory/memmove|inlined.0 @@ -568,7 +570,7 @@ end end ) - (func $~lib/string/String.fromUTF8 (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.fromUTF8 (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -820,7 +822,7 @@ call $~lib/memory/memory.copy local.get $0 ) - (func $~lib/util/string/compareImpl (; 6 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/compareImpl (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 local.get $2 @@ -853,7 +855,7 @@ end local.get $3 ) - (func $~lib/string/String.__eq (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -870,18 +872,10 @@ select br_if $folding-inner0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $2 local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.ne br_if $folding-inner0 local.get $0 @@ -893,7 +887,7 @@ end i32.const 0 ) - (func $start:std/string-utf8 (; 8 ;) (type $FUNCSIG$v) + (func $start:std/string-utf8 (; 9 ;) (type $FUNCSIG$v) global.get $std/string-utf8/str call $~lib/string/String#get:lengthUTF8 global.set $std/string-utf8/len @@ -1138,10 +1132,10 @@ unreachable end ) - (func $start (; 9 ;) (type $FUNCSIG$v) + (func $start (; 10 ;) (type $FUNCSIG$v) call $start:std/string-utf8 ) - (func $null (; 10 ;) (type $FUNCSIG$v) + (func $null (; 11 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 98e26c11..5f0f4669 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -95,89 +95,87 @@ (data (i32.const 2304) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00a\00,\00b\00,\00c") (data (i32.const 2336) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00.") (data (i32.const 2360) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00c") - (data (i32.const 2384) "\90\01\00\00\01\00\00\00\00\00\00\00\90\01\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009") - (data (i32.const 2800) "\10\00\00\00\01\00\00\00\05\00\00\00\10\00\00\00`\t\00\00`\t\00\00\90\01\00\00d") - (data (i32.const 2832) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\008") - (data (i32.const 2856) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00-\001\000\000\000") - (data (i32.const 2888) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\001\002\003\004") - (data (i32.const 2912) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\002\003\004\005") - (data (i32.const 2944) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\002\003\004\005\006") - (data (i32.const 2976) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\001\001\001\001\001\001") - (data (i32.const 3008) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\002\003\004\005\006\007") - (data (i32.const 3040) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\002\001\004\007\004\008\003\006\004\006") - (data (i32.const 3080) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\002\001\004\007\004\008\003\006\004\007") - (data (i32.const 3120) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 3160) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00-\001") - (data (i32.const 3184) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\001\000\000\000") - (data (i32.const 3208) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 3248) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\004\002\009\004\009\006\007\002\009\005") - (data (i32.const 3288) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\009\009\009\009\009\009\009\009") - (data (i32.const 3320) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\000\000\000\000\000\000\000\000") - (data (i32.const 3360) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3400) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3440) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3488) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3536) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3592) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005") - (data (i32.const 3648) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00-\001\002\003\004") - (data (i32.const 3680) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00-\004\002\009\004\009\006\007\002\009\005") - (data (i32.const 3720) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00-\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3760) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00-\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3808) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00-\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3856) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00-\001\009\009\009\009\008\006\008\007\001\009\004\007\006\007\003\005") - (data (i32.const 3912) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007") - (data (i32.const 3968) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00-\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\008") - (data (i32.const 4024) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") - (data (i32.const 4048) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") - (data (i32.const 4072) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 4112) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 4144) "\b8\02\00\00\01\00\00\00\00\00\00\00\b8\02\00\00\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8 (; 37 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/util/string/parse (; 38 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2407,11 +2366,7 @@ drop block $folding-inner0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $3 i32.eqz br_if $folding-inner0 @@ -2474,34 +2429,34 @@ block $case6|0 block $case5|0 block $case3|0 - block $case1|0 - local.get $2 - i32.const 2 - i32.add - i32.load16_u - local.tee $1 - i32.const 66 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 98 - i32.eq - br_if $case1|0 + local.get $2 + i32.const 2 + i32.add + i32.load16_u + local.tee $1 + i32.const 66 + i32.eq + local.get $1 + i32.const 98 + i32.eq + i32.or + i32.eqz + if local.get $1 i32.const 79 i32.eq - br_if $case3|0 local.get $1 i32.const 111 i32.eq + i32.or br_if $case3|0 local.get $1 i32.const 88 i32.eq - br_if $case5|0 local.get $1 i32.const 120 i32.eq + i32.or br_if $case5|0 br $case6|0 end @@ -2629,7 +2584,7 @@ call $~lib/rt/pure/__release f64.const nan:0x8000000000000 ) - (func $~lib/string/parseInt (; 38 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/string/parseInt (; 39 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 f64) local.get $0 call $~lib/rt/pure/__retain @@ -2641,7 +2596,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/string/parseFloat (; 39 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (func $~lib/string/parseFloat (; 40 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2653,14 +2608,12 @@ drop block $folding-inner0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $3 i32.eqz - br_if $folding-inner0 + if + br $folding-inner0 + end local.get $0 local.tee $2 i32.load16_u @@ -2673,7 +2626,9 @@ i32.sub local.tee $3 i32.eqz - br_if $folding-inner0 + if + br $folding-inner0 + end local.get $2 i32.const 2 i32.add @@ -2691,7 +2646,9 @@ i32.sub local.tee $3 i32.eqz - br_if $folding-inner0 + if + br $folding-inner0 + end local.get $2 i32.const 2 i32.add @@ -2813,44 +2770,34 @@ call $~lib/rt/pure/__release f64.const nan:0x8000000000000 ) - (func $~lib/string/String#concat (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $1 call $~lib/rt/pure/__retain drop - block (result i32) + local.get $1 + i32.eqz + if local.get $1 - i32.eqz - if - local.get $1 - i32.const 552 - call $~lib/rt/pure/__retainRelease - local.set $1 - end - local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $4 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $3 - i32.add - local.tee $2 - i32.eqz + i32.const 552 + call $~lib/rt/pure/__retainRelease + local.set $1 end + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $3 + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $4 + i32.add + local.tee $2 + i32.eqz if i32.const 120 call $~lib/rt/pure/__retain @@ -2878,7 +2825,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__concat (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2899,7 +2846,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__ne (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -2918,7 +2865,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__gt (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gt (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2939,25 +2886,22 @@ i32.eq select select - br_if $folding-inner0 - local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.set $2 + if + br $folding-inner0 + end local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.tee $3 - i32.eqz - br_if $folding-inner0 + call $~lib/string/String#get:length + local.set $2 + local.get $1 + call $~lib/string/String#get:length + local.set $3 local.get $2 i32.eqz + if + br $folding-inner0 + end + local.get $3 + i32.eqz if local.get $0 call $~lib/rt/pure/__release @@ -2969,10 +2913,10 @@ local.get $0 i32.const 0 local.get $1 - local.get $3 local.get $2 local.get $3 local.get $2 + local.get $3 i32.lt_s select call $~lib/util/string/compareImpl @@ -2992,7 +2936,7 @@ call $~lib/rt/pure/__release i32.const 0 ) - (func $~lib/string/String.__lt (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lt (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -3013,23 +2957,19 @@ i32.eq select select - br_if $folding-inner0 + if + br $folding-inner0 + end local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $2 local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $3 i32.eqz - br_if $folding-inner0 + if + br $folding-inner0 + end local.get $2 i32.eqz if @@ -3066,7 +3006,7 @@ call $~lib/rt/pure/__release i32.const 0 ) - (func $~lib/string/String.__gte (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gte (; 46 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 call $~lib/rt/pure/__retain @@ -3085,7 +3025,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/string/String.__lte (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String.__lte (; 47 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 120 call $~lib/rt/pure/__retain @@ -3104,7 +3044,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/string/String#repeat (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#repeat (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -3118,26 +3058,20 @@ unreachable end local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $2 + i32.const 1 + local.get $2 + i64.extend_i32_s + local.get $1 + i64.extend_i32_s + i64.mul + i64.const 268435456 + i64.gt_u local.get $1 i32.const 0 i32.lt_s - if (result i32) - i32.const 1 - else - local.get $2 - i64.extend_i32_s - local.get $1 - i64.extend_i32_s - i64.mul - i64.const 268435456 - i64.gt_u - end + select if i32.const 1744 i32.const 456 @@ -3181,14 +3115,10 @@ local.get $3 call $~lib/rt/pure/__retain ) - (func $~lib/string/String#slice (; 48 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/string/String#slice (; 49 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $3 local.get $1 i32.const 0 @@ -3260,7 +3190,7 @@ local.get $3 call $~lib/rt/pure/__retain ) - (func $~lib/rt/__allocArray (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/rt/__allocArray (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3288,7 +3218,7 @@ i32.store offset=12 local.get $1 ) - (func $~lib/rt/tlsf/reallocateBlock (; 50 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/rt/tlsf/reallocateBlock (; 51 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3402,7 +3332,7 @@ call $~lib/rt/tlsf/insertBlock local.get $3 ) - (func $~lib/rt/tlsf/__realloc (; 51 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/__realloc (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) global.get $~lib/rt/tlsf/ROOT i32.eqz if @@ -3438,7 +3368,7 @@ i32.const 16 i32.add ) - (func $~lib/memory/memory.fill (; 52 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/memory/memory.fill (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) block $~lib/util/memory/memset|inlined.0 local.get $1 @@ -3649,7 +3579,7 @@ end end ) - (func $~lib/array/ensureSize (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/ensureSize (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3704,7 +3634,7 @@ i32.store offset=8 end ) - (func $~lib/array/Array<~lib/string/String>#push (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/string/String>#push (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $1 @@ -3736,7 +3666,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/string/String#split (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#split (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3775,22 +3705,12 @@ br $folding-inner1 end local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.set $3 - local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - local.tee $5 - local.set $6 block $folding-inner0 - local.get $5 + local.get $1 + call $~lib/string/String#get:length + local.tee $6 if local.get $3 i32.eqz @@ -3905,7 +3825,9 @@ local.tee $9 i32.const 2147483647 i32.eq - br_if $folding-inner2 + if + br $folding-inner2 + end local.get $5 local.get $6 i32.add @@ -3966,9 +3888,9 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $~lib/rt/pure/__skippedRelease (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/__skippedRelease (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 7012 + i32.const 6564 i32.gt_u if local.get $0 @@ -3978,7 +3900,7 @@ end local.get $1 ) - (func $~lib/array/Array<~lib/string/String>#__get (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array<~lib/string/String>#__get (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=12 @@ -4014,171 +3936,81 @@ i32.load call $~lib/rt/pure/__retain ) - (func $~lib/util/number/decimalCount32 (; 58 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/decimalCount32 (; 59 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1 + i32.const 2 + local.get $0 + i32.const 10 + i32.lt_u + select + i32.const 3 + i32.const 4 + i32.const 5 + local.get $0 + i32.const 10000 + i32.lt_u + select + local.get $0 + i32.const 1000 + i32.lt_u + select + local.get $0 + i32.const 100 + i32.lt_u + select + i32.const 6 + i32.const 7 + local.get $0 + i32.const 1000000 + i32.lt_u + select + i32.const 8 + i32.const 9 + i32.const 10 + local.get $0 + i32.const 1000000000 + i32.lt_u + select + local.get $0 + i32.const 100000000 + i32.lt_u + select + local.get $0 + i32.const 10000000 + i32.lt_u + select local.get $0 i32.const 100000 i32.lt_u - if (result i32) - local.get $0 - i32.const 100 - i32.lt_u - if (result i32) - i32.const 1 - i32.const 2 - local.get $0 - i32.const 10 - i32.lt_u - select - else - i32.const 3 - i32.const 4 - i32.const 5 - local.get $0 - i32.const 10000 - i32.lt_u - select - local.get $0 - i32.const 1000 - i32.lt_u - select - end - else - local.get $0 - i32.const 10000000 - i32.lt_u - if (result i32) - i32.const 6 - i32.const 7 - local.get $0 - i32.const 1000000 - i32.lt_u - select - else - i32.const 8 - i32.const 9 - i32.const 10 - local.get $0 - i32.const 1000000000 - i32.lt_u - select - local.get $0 - i32.const 100000000 - i32.lt_u - select - end - end + select ) - (func $~lib/util/number/utoa32_lut (; 59 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/number/utoa_simple (; 60 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - i32.const 2820 - i32.load - local.set $3 loop $continue|0 local.get $1 - i32.const 10000 - i32.ge_u - if - local.get $1 - i32.const 10000 - i32.rem_u - local.set $4 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 - end - end - local.get $1 - i32.const 100 - i32.ge_u - if - local.get $1 - i32.const 100 - i32.rem_u - local.set $4 - local.get $1 - i32.const 100 + i32.const 10 i32.div_u - local.set $1 + local.set $3 local.get $2 - i32.const 2 + i32.const 1 i32.sub local.tee $2 i32.const 1 i32.shl local.get $0 i32.add - local.get $4 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - i32.store - end - local.get $1 - i32.const 10 - i32.ge_u - if - local.get $2 - i32.const 2 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - i32.load - i32.store - else - local.get $2 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - local.get $0 - i32.add local.get $1 + i32.const 10 + i32.rem_u i32.const 48 i32.add i32.store16 + local.get $3 + local.tee $1 + br_if $continue|0 end ) - (func $~lib/util/number/itoa32 (; 60 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/itoa32 (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4211,7 +4043,7 @@ local.tee $2 local.get $0 local.get $3 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $1 if local.get $2 @@ -4221,7 +4053,7 @@ local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/utoa32 (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/number/utoa32 (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) local.get $0 @@ -4241,162 +4073,88 @@ local.tee $2 local.get $0 local.get $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/decimalCount64 (; 62 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/decimalCount64 (; 63 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + i32.const 11 + i32.const 12 + local.get $0 + i64.const 100000000000 + i64.lt_u + select + i32.const 13 + i32.const 14 + i32.const 15 + local.get $0 + i64.const 100000000000000 + i64.lt_u + select + local.get $0 + i64.const 10000000000000 + i64.lt_u + select + local.get $0 + i64.const 1000000000000 + i64.lt_u + select + i32.const 16 + i32.const 17 + local.get $0 + i64.const 10000000000000000 + i64.lt_u + select + i32.const 18 + i32.const 19 + i32.const 20 + local.get $0 + i64.const -8446744073709551616 + i64.lt_u + select + local.get $0 + i64.const 1000000000000000000 + i64.lt_u + select + local.get $0 + i64.const 100000000000000000 + i64.lt_u + select local.get $0 i64.const 1000000000000000 i64.lt_u - if (result i32) - local.get $0 - i64.const 1000000000000 - i64.lt_u - if (result i32) - i32.const 11 - i32.const 12 - local.get $0 - i64.const 100000000000 - i64.lt_u - select - else - i32.const 13 - i32.const 14 - i32.const 15 - local.get $0 - i64.const 100000000000000 - i64.lt_u - select - local.get $0 - i64.const 10000000000000 - i64.lt_u - select - end - else - local.get $0 - i64.const 100000000000000000 - i64.lt_u - if (result i32) - i32.const 16 - i32.const 17 - local.get $0 - i64.const 10000000000000000 - i64.lt_u - select - else - i32.const 18 - i32.const 19 - i32.const 20 - local.get $0 - i64.const -8446744073709551616 - i64.lt_u - select - local.get $0 - i64.const 1000000000000000000 - i64.lt_u - select - end - end + select ) - (func $~lib/util/number/utoa64_lut (; 63 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - i32.const 2820 - i32.load - local.set $3 + (func $~lib/util/number/utoa_simple (; 64 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (local $3 i64) loop $continue|0 local.get $1 - i64.const 100000000 - i64.ge_u - if - local.get $1 - local.get $1 - i64.const 100000000 - i64.div_u - local.tee $1 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee $4 - i32.const 10000 - i32.div_u - local.tee $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $5 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $4 - i32.const 10000 - i32.rem_u - local.tee $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $6 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - local.get $5 - i32.const 2 - i32.shl - local.get $3 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $continue|0 - end + i64.const 10 + i64.div_u + local.set $3 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $1 + i64.const 10 + i64.rem_u + i32.wrap_i64 + i32.const 48 + i32.add + i32.store16 + local.get $3 + local.tee $1 + i64.const 0 + i64.ne + br_if $continue|0 end - local.get $0 - local.get $1 - i32.wrap_i64 - local.get $2 - call $~lib/util/number/utoa32_lut ) - (func $~lib/util/number/utoa64 (; 64 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/utoa64 (; 65 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4423,7 +4181,7 @@ local.tee $2 local.get $1 local.get $3 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 call $~lib/util/number/decimalCount64 @@ -4435,12 +4193,12 @@ local.tee $2 local.get $0 local.get $1 - call $~lib/util/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $2 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/itoa64 (; 65 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/number/itoa64 (; 66 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4482,7 +4240,7 @@ local.tee $3 local.get $2 local.get $4 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple else local.get $0 call $~lib/util/number/decimalCount64 @@ -4496,7 +4254,7 @@ local.tee $3 local.get $0 local.get $2 - call $~lib/util/number/utoa64_lut + call $~lib/util/number/utoa_simple end local.get $1 if @@ -4507,13 +4265,13 @@ local.get $3 call $~lib/rt/pure/__retain ) - (func $~lib/util/number/genDigits (; 66 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) + (func $~lib/util/number/genDigits (; 67 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) (local $8 i32) (local $9 i64) - (local $10 i64) + (local $10 i32) (local $11 i64) - (local $12 i32) + (local $12 i64) (local $13 i32) (local $14 i64) local.get $3 @@ -4524,25 +4282,25 @@ i32.const 0 local.get $4 i32.sub - local.tee $12 - i64.extend_i32_s - local.tee $1 - i64.shl local.tee $10 + i64.extend_i32_s + i64.shl + local.tee $11 i64.const 1 i64.sub local.tee $14 local.get $3 i64.and - local.set $11 + local.set $12 local.get $3 - local.get $1 + local.get $10 + i64.extend_i32_s i64.shr_u i32.wrap_i64 local.tee $7 call $~lib/util/number/decimalCount32 local.set $4 - i32.const 5188 + i32.const 4740 i32.load local.set $13 loop $continue|0 @@ -4703,10 +4461,10 @@ local.set $4 local.get $7 i64.extend_i32_u - local.get $12 + local.get $10 i64.extend_i32_s i64.shl - local.get $11 + local.get $12 i64.add local.tee $1 local.get $5 @@ -4722,7 +4480,7 @@ local.get $13 i32.add i64.load32_u - local.get $12 + local.get $10 i64.extend_i32_s i64.shl local.set $3 @@ -4737,6 +4495,23 @@ i32.load16_u local.set $4 loop $continue|2 + i32.const 1 + local.get $9 + local.get $1 + i64.sub + local.get $1 + local.get $3 + i64.add + local.get $9 + i64.sub + i64.gt_u + local.get $1 + local.get $3 + i64.add + local.get $9 + i64.lt_u + select + i32.const 0 local.get $5 local.get $1 i64.sub @@ -4747,26 +4522,7 @@ local.get $9 i64.lt_u select - if (result i32) - i32.const 1 - local.get $9 - local.get $1 - i64.sub - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.sub - i64.gt_u - local.get $1 - local.get $3 - i64.add - local.get $9 - i64.lt_u - select - else - i32.const 0 - end + select if local.get $4 i32.const 1 @@ -4793,11 +4549,11 @@ i64.const 10 i64.mul local.set $5 - local.get $11 + local.get $12 i64.const 10 i64.mul local.tee $3 - local.get $12 + local.get $10 i64.extend_i32_s i64.shr_u local.tee $1 @@ -4832,7 +4588,7 @@ local.get $3 local.get $14 i64.and - local.tee $11 + local.tee $12 local.get $5 i64.ge_u br_if $continue|3 @@ -4840,7 +4596,7 @@ local.get $4 i32.add global.set $~lib/util/number/_K - local.get $11 + local.get $12 local.set $1 i32.const 0 local.get $4 @@ -4864,43 +4620,41 @@ i32.load16_u local.set $4 loop $continue|4 + i32.const 1 + local.get $3 + local.get $1 + i64.sub + local.get $1 + local.get $11 + i64.add + local.get $3 + i64.sub + i64.gt_u + local.get $1 + local.get $11 + i64.add + local.get $3 + i64.lt_u + select + i32.const 0 local.get $5 local.get $1 i64.sub - local.get $10 + local.get $11 i64.ge_u i32.const 0 local.get $1 local.get $3 i64.lt_u select - if (result i32) - i32.const 1 - local.get $3 - local.get $1 - i64.sub - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.sub - i64.gt_u - local.get $1 - local.get $10 - i64.add - local.get $3 - i64.lt_u - select - else - i32.const 0 - end + select if local.get $4 i32.const 1 i32.sub local.set $4 local.get $1 - local.get $10 + local.get $11 i64.add local.set $1 br $continue|4 @@ -4912,7 +4666,7 @@ local.get $6 end ) - (func $~lib/util/number/prettify (; 67 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/number/prettify (; 68 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $2 i32.eqz @@ -5088,7 +4842,7 @@ i32.const 1 i32.add local.tee $1 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $0 i32.const 45 i32.const 43 @@ -5146,7 +4900,7 @@ i32.const 1 i32.add local.tee $0 - call $~lib/util/number/utoa32_lut + call $~lib/util/number/utoa_simple local.get $2 i32.const 45 i32.const 43 @@ -5163,7 +4917,7 @@ end end ) - (func $~lib/util/number/dtoa_core (; 68 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/util/number/dtoa_core (; 69 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 i64) (local $3 i32) (local $4 i64) @@ -5279,7 +5033,7 @@ i32.shl i32.sub global.set $~lib/util/number/_K - i32.const 4876 + i32.const 4428 i32.load local.get $3 i32.const 3 @@ -5287,7 +5041,7 @@ i32.add i64.load global.set $~lib/util/number/_frc_pow - i32.const 5100 + i32.const 4652 i32.load local.get $3 i32.const 1 @@ -5451,7 +5205,7 @@ local.get $10 i32.add ) - (func $~lib/string/String#substring (; 69 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#substring (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -5466,11 +5220,7 @@ end i32.const 0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $2 i32.const 0 local.get $2 @@ -5519,11 +5269,7 @@ i32.const 0 else local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl local.get $1 @@ -5546,7 +5292,7 @@ local.get $1 call $~lib/rt/pure/__retain ) - (func $~lib/rt/tlsf/__free (; 70 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/tlsf/__free (; 71 ;) (type $FUNCSIG$vi) (param $0 i32) global.get $~lib/rt/tlsf/ROOT i32.eqz if @@ -5579,14 +5325,14 @@ i32.sub call $~lib/rt/tlsf/freeBlock ) - (func $~lib/util/number/dtoa (; 71 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/number/dtoa (; 72 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) (local $1 i32) (local $2 i32) local.get $0 f64.const 0 f64.eq if - i32.const 4040 + i32.const 3592 call $~lib/rt/pure/__retain return end @@ -5600,12 +5346,12 @@ local.get $0 f64.ne if - i32.const 4064 + i32.const 3616 call $~lib/rt/pure/__retain return end - i32.const 4088 - i32.const 4128 + i32.const 3640 + i32.const 3680 local.get $0 f64.const 0 f64.lt @@ -5635,7 +5381,7 @@ call $~lib/rt/tlsf/__free local.get $2 ) - (func $start:std/string (; 72 ;) (type $FUNCSIG$v) + (func $start:std/string (; 73 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -5777,11 +5523,7 @@ unreachable end global.get $std/string/str - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 16 i32.ne if @@ -5797,11 +5539,7 @@ i32.const 0 global.get $std/string/str local.tee $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.ge_u br_if $__inlined_func$~lib/string/String#charCodeAt drop @@ -6275,8 +6013,7 @@ unreachable end global.get $std/string/str - local.tee $0 - local.get $0 + global.get $std/string/str i32.const 0 call $~lib/string/String#indexOf if @@ -6400,11 +6137,7 @@ i32.const 2147483647 call $~lib/string/String#lastIndexOf global.get $std/string/str - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.ne if i32.const 0 @@ -7085,10 +6818,8 @@ call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release - i32.const 732 - i32.load - i32.const 1 - i32.shr_u + i32.const 736 + call $~lib/string/String#get:length i32.const 3 i32.ne if @@ -7560,7 +7291,7 @@ i32.const 8 call $~lib/util/number/itoa32 local.tee $2 - i32.const 2848 + i32.const 2400 call $~lib/string/String.__eq i32.eqz if @@ -7588,7 +7319,7 @@ i32.const -1000 call $~lib/util/number/itoa32 local.tee $42 - i32.const 2872 + i32.const 2424 call $~lib/string/String.__eq i32.eqz if @@ -7602,7 +7333,7 @@ i32.const 1234 call $~lib/util/number/itoa32 local.tee $43 - i32.const 2904 + i32.const 2456 call $~lib/string/String.__eq i32.eqz if @@ -7616,7 +7347,7 @@ i32.const 12345 call $~lib/util/number/itoa32 local.tee $44 - i32.const 2928 + i32.const 2480 call $~lib/string/String.__eq i32.eqz if @@ -7630,7 +7361,7 @@ i32.const 123456 call $~lib/util/number/itoa32 local.tee $45 - i32.const 2960 + i32.const 2512 call $~lib/string/String.__eq i32.eqz if @@ -7644,7 +7375,7 @@ i32.const 1111111 call $~lib/util/number/itoa32 local.tee $46 - i32.const 2992 + i32.const 2544 call $~lib/string/String.__eq i32.eqz if @@ -7658,7 +7389,7 @@ i32.const 1234567 call $~lib/util/number/itoa32 local.tee $47 - i32.const 3024 + i32.const 2576 call $~lib/string/String.__eq i32.eqz if @@ -7672,7 +7403,7 @@ i32.const 2147483646 call $~lib/util/number/itoa32 local.tee $48 - i32.const 3056 + i32.const 2608 call $~lib/string/String.__eq i32.eqz if @@ -7686,7 +7417,7 @@ i32.const 2147483647 call $~lib/util/number/itoa32 local.tee $49 - i32.const 3096 + i32.const 2648 call $~lib/string/String.__eq i32.eqz if @@ -7700,7 +7431,7 @@ i32.const -2147483648 call $~lib/util/number/itoa32 local.tee $50 - i32.const 3136 + i32.const 2688 call $~lib/string/String.__eq i32.eqz if @@ -7714,7 +7445,7 @@ i32.const -1 call $~lib/util/number/itoa32 local.tee $51 - i32.const 3176 + i32.const 2728 call $~lib/string/String.__eq i32.eqz if @@ -7742,7 +7473,7 @@ i32.const 1000 call $~lib/util/number/utoa32 local.tee $53 - i32.const 3200 + i32.const 2752 call $~lib/string/String.__eq i32.eqz if @@ -7756,7 +7487,7 @@ i32.const 2147483647 call $~lib/util/number/utoa32 local.tee $54 - i32.const 3096 + i32.const 2648 call $~lib/string/String.__eq i32.eqz if @@ -7770,7 +7501,7 @@ i32.const -2147483648 call $~lib/util/number/utoa32 local.tee $55 - i32.const 3224 + i32.const 2776 call $~lib/string/String.__eq i32.eqz if @@ -7784,7 +7515,7 @@ i32.const -1 call $~lib/util/number/utoa32 local.tee $56 - i32.const 3264 + i32.const 2816 call $~lib/string/String.__eq i32.eqz if @@ -7812,7 +7543,7 @@ i64.const 1234 call $~lib/util/number/utoa64 local.tee $58 - i32.const 2904 + i32.const 2456 call $~lib/string/String.__eq i32.eqz if @@ -7826,7 +7557,7 @@ i64.const 99999999 call $~lib/util/number/utoa64 local.tee $59 - i32.const 3304 + i32.const 2856 call $~lib/string/String.__eq i32.eqz if @@ -7840,7 +7571,7 @@ i64.const 100000000 call $~lib/util/number/utoa64 local.tee $60 - i32.const 3336 + i32.const 2888 call $~lib/string/String.__eq i32.eqz if @@ -7854,7 +7585,7 @@ i64.const 4294967295 call $~lib/util/number/utoa64 local.tee $61 - i32.const 3264 + i32.const 2816 call $~lib/string/String.__eq i32.eqz if @@ -7868,7 +7599,7 @@ i64.const 68719476735 call $~lib/util/number/utoa64 local.tee $62 - i32.const 3376 + i32.const 2928 call $~lib/string/String.__eq i32.eqz if @@ -7882,7 +7613,7 @@ i64.const 868719476735 call $~lib/util/number/utoa64 local.tee $63 - i32.const 3416 + i32.const 2968 call $~lib/string/String.__eq i32.eqz if @@ -7896,7 +7627,7 @@ i64.const 999868719476735 call $~lib/util/number/utoa64 local.tee $64 - i32.const 3456 + i32.const 3008 call $~lib/string/String.__eq i32.eqz if @@ -7910,7 +7641,7 @@ i64.const 9999868719476735 call $~lib/util/number/utoa64 local.tee $65 - i32.const 3504 + i32.const 3056 call $~lib/string/String.__eq i32.eqz if @@ -7924,7 +7655,7 @@ i64.const 19999868719476735 call $~lib/util/number/utoa64 local.tee $66 - i32.const 3552 + i32.const 3104 call $~lib/string/String.__eq i32.eqz if @@ -7938,7 +7669,7 @@ i64.const -1 call $~lib/util/number/utoa64 local.tee $67 - i32.const 3608 + i32.const 3160 call $~lib/string/String.__eq i32.eqz if @@ -7966,7 +7697,7 @@ i64.const -1234 call $~lib/util/number/itoa64 local.tee $69 - i32.const 3664 + i32.const 3216 call $~lib/string/String.__eq i32.eqz if @@ -7980,7 +7711,7 @@ i64.const 4294967295 call $~lib/util/number/itoa64 local.tee $70 - i32.const 3264 + i32.const 2816 call $~lib/string/String.__eq i32.eqz if @@ -7994,7 +7725,7 @@ i64.const -4294967295 call $~lib/util/number/itoa64 local.tee $71 - i32.const 3696 + i32.const 3248 call $~lib/string/String.__eq i32.eqz if @@ -8008,7 +7739,7 @@ i64.const 68719476735 call $~lib/util/number/itoa64 local.tee $72 - i32.const 3376 + i32.const 2928 call $~lib/string/String.__eq i32.eqz if @@ -8022,7 +7753,7 @@ i64.const -68719476735 call $~lib/util/number/itoa64 local.tee $73 - i32.const 3736 + i32.const 3288 call $~lib/string/String.__eq i32.eqz if @@ -8036,7 +7767,7 @@ i64.const -868719476735 call $~lib/util/number/itoa64 local.tee $74 - i32.const 3776 + i32.const 3328 call $~lib/string/String.__eq i32.eqz if @@ -8050,7 +7781,7 @@ i64.const -999868719476735 call $~lib/util/number/itoa64 local.tee $75 - i32.const 3824 + i32.const 3376 call $~lib/string/String.__eq i32.eqz if @@ -8064,7 +7795,7 @@ i64.const -19999868719476735 call $~lib/util/number/itoa64 local.tee $76 - i32.const 3872 + i32.const 3424 call $~lib/string/String.__eq i32.eqz if @@ -8078,7 +7809,7 @@ i64.const 9223372036854775807 call $~lib/util/number/itoa64 local.tee $77 - i32.const 3928 + i32.const 3480 call $~lib/string/String.__eq i32.eqz if @@ -8092,7 +7823,7 @@ i64.const -9223372036854775808 call $~lib/util/number/itoa64 local.tee $78 - i32.const 3984 + i32.const 3536 call $~lib/string/String.__eq i32.eqz if @@ -8106,7 +7837,7 @@ f64.const 0 call $~lib/util/number/dtoa local.tee $79 - i32.const 4040 + i32.const 3592 call $~lib/string/String.__eq i32.eqz if @@ -8120,7 +7851,7 @@ f64.const -0 call $~lib/util/number/dtoa local.tee $80 - i32.const 4040 + i32.const 3592 call $~lib/string/String.__eq i32.eqz if @@ -8134,7 +7865,7 @@ f64.const nan:0x8000000000000 call $~lib/util/number/dtoa local.tee $81 - i32.const 4064 + i32.const 3616 call $~lib/string/String.__eq i32.eqz if @@ -8148,7 +7879,7 @@ f64.const inf call $~lib/util/number/dtoa local.tee $82 - i32.const 4128 + i32.const 3680 call $~lib/string/String.__eq i32.eqz if @@ -8162,7 +7893,7 @@ f64.const -inf call $~lib/util/number/dtoa local.tee $83 - i32.const 4088 + i32.const 3640 call $~lib/string/String.__eq i32.eqz if @@ -8176,7 +7907,7 @@ f64.const 2.220446049250313e-16 call $~lib/util/number/dtoa local.tee $84 - i32.const 5216 + i32.const 4768 call $~lib/string/String.__eq i32.eqz if @@ -8190,7 +7921,7 @@ f64.const -2.220446049250313e-16 call $~lib/util/number/dtoa local.tee $85 - i32.const 5280 + i32.const 4832 call $~lib/string/String.__eq i32.eqz if @@ -8204,7 +7935,7 @@ f64.const 1797693134862315708145274e284 call $~lib/util/number/dtoa local.tee $86 - i32.const 5344 + i32.const 4896 call $~lib/string/String.__eq i32.eqz if @@ -8218,7 +7949,7 @@ f64.const -1797693134862315708145274e284 call $~lib/util/number/dtoa local.tee $87 - i32.const 5408 + i32.const 4960 call $~lib/string/String.__eq i32.eqz if @@ -8232,7 +7963,7 @@ f64.const 4185580496821356722454785e274 call $~lib/util/number/dtoa local.tee $88 - i32.const 5472 + i32.const 5024 call $~lib/string/String.__eq i32.eqz if @@ -8246,7 +7977,7 @@ f64.const 2.2250738585072014e-308 call $~lib/util/number/dtoa local.tee $89 - i32.const 5536 + i32.const 5088 call $~lib/string/String.__eq i32.eqz if @@ -8260,7 +7991,7 @@ f64.const 4.940656e-318 call $~lib/util/number/dtoa local.tee $90 - i32.const 5600 + i32.const 5152 call $~lib/string/String.__eq i32.eqz if @@ -8274,7 +8005,7 @@ f64.const 9060801153433600 call $~lib/util/number/dtoa local.tee $91 - i32.const 5648 + i32.const 5200 call $~lib/string/String.__eq i32.eqz if @@ -8288,7 +8019,7 @@ f64.const 4708356024711512064 call $~lib/util/number/dtoa local.tee $92 - i32.const 5704 + i32.const 5256 call $~lib/string/String.__eq i32.eqz if @@ -8302,7 +8033,7 @@ f64.const 9409340012568248320 call $~lib/util/number/dtoa local.tee $93 - i32.const 5768 + i32.const 5320 call $~lib/string/String.__eq i32.eqz if @@ -8316,7 +8047,7 @@ f64.const 5e-324 call $~lib/util/number/dtoa local.tee $94 - i32.const 5832 + i32.const 5384 call $~lib/string/String.__eq i32.eqz if @@ -8330,7 +8061,7 @@ f64.const 1 call $~lib/util/number/dtoa local.tee $95 - i32.const 5864 + i32.const 5416 call $~lib/string/String.__eq i32.eqz if @@ -8358,7 +8089,7 @@ f64.const -1 call $~lib/util/number/dtoa local.tee $97 - i32.const 5888 + i32.const 5440 call $~lib/string/String.__eq i32.eqz if @@ -8372,7 +8103,7 @@ f64.const -0.1 call $~lib/util/number/dtoa local.tee $98 - i32.const 5912 + i32.const 5464 call $~lib/string/String.__eq i32.eqz if @@ -8386,7 +8117,7 @@ f64.const 1e6 call $~lib/util/number/dtoa local.tee $99 - i32.const 5936 + i32.const 5488 call $~lib/string/String.__eq i32.eqz if @@ -8400,7 +8131,7 @@ f64.const 1e-06 call $~lib/util/number/dtoa local.tee $100 - i32.const 5976 + i32.const 5528 call $~lib/string/String.__eq i32.eqz if @@ -8414,7 +8145,7 @@ f64.const -1e6 call $~lib/util/number/dtoa local.tee $101 - i32.const 6008 + i32.const 5560 call $~lib/string/String.__eq i32.eqz if @@ -8428,7 +8159,7 @@ f64.const -1e-06 call $~lib/util/number/dtoa local.tee $102 - i32.const 6048 + i32.const 5600 call $~lib/string/String.__eq i32.eqz if @@ -8442,7 +8173,7 @@ f64.const 1e7 call $~lib/util/number/dtoa local.tee $103 - i32.const 6088 + i32.const 5640 call $~lib/string/String.__eq i32.eqz if @@ -8456,7 +8187,7 @@ f64.const 1e-07 call $~lib/util/number/dtoa local.tee $104 - i32.const 6128 + i32.const 5680 call $~lib/string/String.__eq i32.eqz if @@ -8470,7 +8201,7 @@ f64.const 1.e+308 call $~lib/util/number/dtoa local.tee $105 - i32.const 6152 + i32.const 5704 call $~lib/string/String.__eq i32.eqz if @@ -8484,7 +8215,7 @@ f64.const -1.e+308 call $~lib/util/number/dtoa local.tee $106 - i32.const 6184 + i32.const 5736 call $~lib/string/String.__eq i32.eqz if @@ -8498,7 +8229,7 @@ f64.const inf call $~lib/util/number/dtoa local.tee $107 - i32.const 4128 + i32.const 3680 call $~lib/string/String.__eq i32.eqz if @@ -8512,7 +8243,7 @@ f64.const -inf call $~lib/util/number/dtoa local.tee $108 - i32.const 4088 + i32.const 3640 call $~lib/string/String.__eq i32.eqz if @@ -8526,7 +8257,7 @@ f64.const 1e-308 call $~lib/util/number/dtoa local.tee $109 - i32.const 6216 + i32.const 5768 call $~lib/string/String.__eq i32.eqz if @@ -8540,7 +8271,7 @@ f64.const -1e-308 call $~lib/util/number/dtoa local.tee $110 - i32.const 6248 + i32.const 5800 call $~lib/string/String.__eq i32.eqz if @@ -8554,7 +8285,7 @@ f64.const 1e-323 call $~lib/util/number/dtoa local.tee $111 - i32.const 6280 + i32.const 5832 call $~lib/string/String.__eq i32.eqz if @@ -8568,7 +8299,7 @@ f64.const -1e-323 call $~lib/util/number/dtoa local.tee $112 - i32.const 6312 + i32.const 5864 call $~lib/string/String.__eq i32.eqz if @@ -8582,7 +8313,7 @@ f64.const 0 call $~lib/util/number/dtoa local.tee $113 - i32.const 4040 + i32.const 3592 call $~lib/string/String.__eq i32.eqz if @@ -8596,7 +8327,7 @@ f64.const 4294967272 call $~lib/util/number/dtoa local.tee $114 - i32.const 6344 + i32.const 5896 call $~lib/string/String.__eq i32.eqz if @@ -8610,7 +8341,7 @@ f64.const 1.2312145673456234e-08 call $~lib/util/number/dtoa local.tee $115 - i32.const 6384 + i32.const 5936 call $~lib/string/String.__eq i32.eqz if @@ -8624,7 +8355,7 @@ f64.const 555555555.5555556 call $~lib/util/number/dtoa local.tee $116 - i32.const 6448 + i32.const 6000 call $~lib/string/String.__eq i32.eqz if @@ -8638,7 +8369,7 @@ f64.const 0.9999999999999999 call $~lib/util/number/dtoa local.tee $117 - i32.const 6504 + i32.const 6056 call $~lib/string/String.__eq i32.eqz if @@ -8652,7 +8383,7 @@ f64.const 1 call $~lib/util/number/dtoa local.tee $118 - i32.const 5864 + i32.const 5416 call $~lib/string/String.__eq i32.eqz if @@ -8666,7 +8397,7 @@ f64.const 12.34 call $~lib/util/number/dtoa local.tee $119 - i32.const 6560 + i32.const 6112 call $~lib/string/String.__eq i32.eqz if @@ -8680,7 +8411,7 @@ f64.const 0.3333333333333333 call $~lib/util/number/dtoa local.tee $120 - i32.const 6592 + i32.const 6144 call $~lib/string/String.__eq i32.eqz if @@ -8694,7 +8425,7 @@ f64.const 1234e17 call $~lib/util/number/dtoa local.tee $121 - i32.const 6648 + i32.const 6200 call $~lib/string/String.__eq i32.eqz if @@ -8708,7 +8439,7 @@ f64.const 1234e18 call $~lib/util/number/dtoa local.tee $122 - i32.const 6712 + i32.const 6264 call $~lib/string/String.__eq i32.eqz if @@ -8722,7 +8453,7 @@ f64.const 2.71828 call $~lib/util/number/dtoa local.tee $123 - i32.const 6752 + i32.const 6304 call $~lib/string/String.__eq i32.eqz if @@ -8736,7 +8467,7 @@ f64.const 0.0271828 call $~lib/util/number/dtoa local.tee $124 - i32.const 6784 + i32.const 6336 call $~lib/string/String.__eq i32.eqz if @@ -8750,7 +8481,7 @@ f64.const 271.828 call $~lib/util/number/dtoa local.tee $125 - i32.const 6824 + i32.const 6376 call $~lib/string/String.__eq i32.eqz if @@ -8764,7 +8495,7 @@ f64.const 1.1e+128 call $~lib/util/number/dtoa local.tee $126 - i32.const 6856 + i32.const 6408 call $~lib/string/String.__eq i32.eqz if @@ -8778,7 +8509,7 @@ f64.const 1.1e-64 call $~lib/util/number/dtoa local.tee $127 - i32.const 6888 + i32.const 6440 call $~lib/string/String.__eq i32.eqz if @@ -8792,7 +8523,7 @@ f64.const 0.000035689 call $~lib/util/number/dtoa local.tee $128 - i32.const 6920 + i32.const 6472 call $~lib/string/String.__eq i32.eqz if @@ -9064,14 +8795,20 @@ local.get $128 call $~lib/rt/pure/__release ) - (func $std/string/getString (; 73 ;) (type $FUNCSIG$i) (result i32) + (func $std/string/getString (; 74 ;) (type $FUNCSIG$i) (result i32) global.get $std/string/str call $~lib/rt/pure/__retain ) - (func $start (; 74 ;) (type $FUNCSIG$v) - call $start:std/string + (func $std/string/main (; 75 ;) (type $FUNCSIG$v) + global.get $~lib/started + i32.eqz + if + call $start:std/string + i32.const 1 + global.set $~lib/started + end ) - (func $~lib/rt/pure/markGray (; 75 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/markGray (; 76 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -9095,7 +8832,7 @@ call $~lib/rt/__visit_members end ) - (func $~lib/rt/pure/scanBlack (; 76 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scanBlack (; 77 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load offset=4 @@ -9108,7 +8845,7 @@ i32.const 4 call $~lib/rt/__visit_members ) - (func $~lib/rt/pure/scan (; 77 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scan (; 78 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -9142,7 +8879,7 @@ end end ) - (func $~lib/rt/pure/collectWhite (; 78 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/collectWhite (; 79 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -9170,9 +8907,9 @@ local.get $0 call $~lib/rt/tlsf/freeBlock ) - (func $~lib/rt/pure/__visit (; 79 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 80 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 - i32.const 7012 + i32.const 6564 i32.lt_u if return @@ -9280,7 +9017,7 @@ unreachable end ) - (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 80 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $0 @@ -9311,7 +9048,7 @@ end end ) - (func $~lib/rt/__visit_members (; 81 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 82 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $block$4$break block $switch$1$default block $switch$1$case$5 @@ -9340,7 +9077,7 @@ call $~lib/rt/pure/__visit end ) - (func $null (; 82 ;) (type $FUNCSIG$v) + (func $null (; 83 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/string.ts b/tests/compiler/std/string.ts index 9bc5f101..c7d4bc9a 100644 --- a/tests/compiler/std/string.ts +++ b/tests/compiler/std/string.ts @@ -305,3 +305,5 @@ export function getString(): string { // Unleak globals __release(changetype(str)); + +@start export function main(): void {} diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index d668b28e..d8144a95 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -204,11 +204,12 @@ (global $~lib/util/number/_exp_pow (mut i32) (i32.const 0)) (global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16)) (global $~lib/builtins/f64.MAX_VALUE f64 (f64.const 1797693134862315708145274e284)) + (global $~lib/started (mut i32) (i32.const 0)) (global $~lib/rt/RTTI_BASE i32 (i32.const 6944)) (global $~lib/heap/HEAP_BASE i32 (i32.const 7012)) (export "memory" (memory $0)) (export "getString" (func $std/string/getString)) - (start $start) + (export "main" (func $std/string/main)) (func $~lib/string/String#get:length (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 16 @@ -10746,10 +10747,19 @@ global.get $std/string/str call $~lib/rt/pure/__retain ) - (func $start (; 82 ;) (type $FUNCSIG$v) + (func $std/string/main (; 82 ;) (type $FUNCSIG$v) + global.get $~lib/started + i32.eqz + if + call $start + i32.const 1 + global.set $~lib/started + end + ) + (func $start (; 83 ;) (type $FUNCSIG$v) call $start:std/string ) - (func $~lib/rt/pure/markGray (; 83 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/markGray (; 84 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -10776,7 +10786,7 @@ call $~lib/rt/__visit_members end ) - (func $~lib/rt/pure/scanBlack (; 84 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scanBlack (; 85 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load offset=4 @@ -10793,7 +10803,7 @@ i32.const 4 call $~lib/rt/__visit_members ) - (func $~lib/rt/pure/scan (; 85 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scan (; 86 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -10830,7 +10840,7 @@ end end ) - (func $~lib/rt/pure/collectWhite (; 86 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/collectWhite (; 87 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -10859,7 +10869,7 @@ local.get $0 call $~lib/rt/tlsf/freeBlock ) - (func $~lib/rt/pure/__visit (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 88 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) local.get $0 @@ -11013,7 +11023,7 @@ end end ) - (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 88 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array<~lib/string/String>#__visit_impl (; 89 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11049,19 +11059,19 @@ end end ) - (func $~lib/array/Array#__visit_impl (; 89 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 90 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 91 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 92 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/array/Array#__visit_impl (; 92 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#__visit_impl (; 93 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/rt/__visit_members (; 93 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 94 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) block $block$4$break block @@ -11211,6 +11221,6 @@ end unreachable ) - (func $null (; 94 ;) (type $FUNCSIG$v) + (func $null (; 95 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 2dbd3001..eb972431 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -50,7 +50,20 @@ (global $std/symbol/isConcatSpreadable (mut i32) (i32.const 0)) (export "memory" (memory $0)) (start $start) - (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/symbol/Symbol (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + global.get $~lib/symbol/nextId + local.tee $0 + i32.const 1 + i32.add + global.set $~lib/symbol/nextId + local.get $0 + i32.eqz + if + unreachable + end + local.get $0 + ) + (func $~lib/rt/stub/__alloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -124,7 +137,7 @@ i32.store offset=12 local.get $3 ) - (func $~lib/memory/memory.fill (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/memory/memory.fill (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) block $~lib/util/memory/memset|inlined.0 local.get $1 @@ -335,7 +348,7 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 1073741808 @@ -356,7 +369,7 @@ call $~lib/memory/memory.fill local.get $1 ) - (func $~lib/map/Map<~lib/string/String,usize>#clear (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map<~lib/string/String,usize>#clear (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.load drop @@ -384,7 +397,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map<~lib/string/String,usize>#constructor (; 5 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map<~lib/string/String,usize>#constructor (; 6 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 3 @@ -411,7 +424,7 @@ call $~lib/map/Map<~lib/string/String,usize>#clear local.get $0 ) - (func $~lib/map/Map#constructor (; 6 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 i32.const 4 @@ -438,7 +451,15 @@ call $~lib/map/Map<~lib/string/String,usize>#clear local.get $0 ) - (func $~lib/util/hash/hashStr (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/string/String#get:length (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/hash/hashStr (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -448,11 +469,7 @@ if block $break|0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl local.set $3 @@ -482,7 +499,7 @@ end local.get $1 ) - (func $~lib/util/string/compareImpl (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/string/compareImpl (; 10 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) loop $continue|0 local.get $2 @@ -515,7 +532,7 @@ end local.get $3 ) - (func $~lib/string/String.__eq (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -532,18 +549,10 @@ select br_if $folding-inner0 local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length local.tee $2 local.get $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.ne br_if $folding-inner0 local.get $0 @@ -555,7 +564,7 @@ end i32.const 0 ) - (func $~lib/map/Map<~lib/string/String,usize>#find (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map<~lib/string/String,usize>#find (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.load local.get $0 @@ -596,7 +605,7 @@ end i32.const 0 ) - (func $~lib/map/Map<~lib/string/String,usize>#rehash (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map<~lib/string/String,usize>#rehash (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -703,7 +712,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map<~lib/string/String,usize>#set (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map<~lib/string/String,usize>#set (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -792,7 +801,7 @@ i32.store end ) - (func $~lib/util/hash/hash32 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -823,7 +832,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -864,7 +873,7 @@ end i32.const 0 ) - (func $~lib/map/Map#rehash (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -971,7 +980,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#set (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1064,7 +1073,7 @@ i32.store end ) - (func $~lib/symbol/_Symbol.for (; 17 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/symbol/_Symbol.for (; 19 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) global.get $~lib/symbol/stringToId if @@ -1110,7 +1119,7 @@ call $~lib/map/Map#set local.get $0 ) - (func $~lib/map/Map#has (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -1119,7 +1128,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#get (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -1133,7 +1142,7 @@ unreachable end ) - (func $~lib/symbol/_Symbol.keyFor (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/symbol/_Symbol.keyFor (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) global.get $~lib/symbol/idToString if (result i32) global.get $~lib/symbol/idToString @@ -1150,7 +1159,7 @@ i32.const 0 end ) - (func $~lib/memory/memory.copy (; 21 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) block $~lib/util/memory/memmove|inlined.0 @@ -1323,32 +1332,24 @@ end end ) - (func $~lib/string/String#concat (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.tee $3 local.get $1 i32.const 656 local.get $1 select local.tee $1 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u + call $~lib/string/String#get:length i32.const 1 i32.shl local.tee $4 - local.get $0 - i32.const 16 - i32.sub - i32.load offset=12 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $3 i32.add local.tee $2 i32.eqz @@ -1371,7 +1372,7 @@ call $~lib/memory/memory.copy local.get $2 ) - (func $~lib/string/String.__concat (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.const 656 local.get $0 @@ -1379,7 +1380,7 @@ local.get $1 call $~lib/string/String#concat ) - (func $~lib/symbol/_Symbol#toString (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/symbol/_Symbol#toString (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 624 block $break|0 (result i32) block $case11|0 @@ -1462,31 +1463,12 @@ i32.const 680 call $~lib/string/String.__concat ) - (func $start:std/symbol (; 25 ;) (type $FUNCSIG$v) - (local $0 i32) - global.get $~lib/symbol/nextId - local.tee $0 - i32.const 1 - i32.add - global.set $~lib/symbol/nextId - local.get $0 - i32.eqz - if - unreachable - end - local.get $0 + (func $start:std/symbol (; 27 ;) (type $FUNCSIG$v) + i32.const 24 + call $~lib/symbol/Symbol global.set $std/symbol/sym1 - global.get $~lib/symbol/nextId - local.tee $0 - i32.const 1 - i32.add - global.set $~lib/symbol/nextId - local.get $0 - i32.eqz - if - unreachable - end - local.get $0 + i32.const 24 + call $~lib/symbol/Symbol global.set $std/symbol/sym2 global.get $std/symbol/sym1 global.get $std/symbol/sym2 @@ -1572,17 +1554,8 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/symbol/nextId - local.tee $0 - i32.const 1 - i32.add - global.set $~lib/symbol/nextId - local.get $0 - i32.eqz - if - unreachable - end - local.get $0 + i32.const 0 + call $~lib/symbol/Symbol call $~lib/symbol/_Symbol#toString i32.const 704 call $~lib/string/String.__eq @@ -1639,10 +1612,10 @@ unreachable end ) - (func $start (; 26 ;) (type $FUNCSIG$v) + (func $start (; 28 ;) (type $FUNCSIG$v) call $start:std/symbol ) - (func $null (; 27 ;) (type $FUNCSIG$v) + (func $null (; 29 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index e1eaf491..1553da31 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -1588,7 +1588,14 @@ i32.const 0 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Uint8Array#constructor (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + local.get $0 + i32.load + i32.sub + ) + (func $~lib/typedarray/Uint8Array#constructor (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 4 call $~lib/rt/tlsf/__alloc @@ -1597,7 +1604,7 @@ i32.const 0 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Uint8ClampedArray#constructor (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#constructor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 5 call $~lib/rt/tlsf/__alloc @@ -1606,7 +1613,7 @@ i32.const 0 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Int16Array#constructor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#constructor (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 6 call $~lib/rt/tlsf/__alloc @@ -1615,7 +1622,13 @@ i32.const 1 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Uint16Array#constructor (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#get:length (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + ) + (func $~lib/typedarray/Uint16Array#constructor (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 7 call $~lib/rt/tlsf/__alloc @@ -1624,7 +1637,7 @@ i32.const 1 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Int32Array#constructor (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int32Array#constructor (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 8 call $~lib/rt/tlsf/__alloc @@ -1633,7 +1646,13 @@ i32.const 2 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Uint32Array#constructor (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int32Array#get:length (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + ) + (func $~lib/typedarray/Uint32Array#constructor (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 9 call $~lib/rt/tlsf/__alloc @@ -1642,7 +1661,7 @@ i32.const 2 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Int64Array#constructor (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int64Array#constructor (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 10 call $~lib/rt/tlsf/__alloc @@ -1651,7 +1670,13 @@ i32.const 3 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Uint64Array#constructor (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int64Array#get:length (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + ) + (func $~lib/typedarray/Uint64Array#constructor (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 11 call $~lib/rt/tlsf/__alloc @@ -1660,7 +1685,7 @@ i32.const 3 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Float32Array#constructor (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float32Array#constructor (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 12 call $~lib/rt/tlsf/__alloc @@ -1669,7 +1694,7 @@ i32.const 2 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/typedarray/Float64Array#constructor (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float64Array#constructor (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 i32.const 13 call $~lib/rt/tlsf/__alloc @@ -1678,7 +1703,7 @@ i32.const 3 call $~lib/arraybuffer/ArrayBufferView#constructor ) - (func $~lib/rt/pure/__release (; 36 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/__release (; 40 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 1820 i32.gt_u @@ -1689,7 +1714,7 @@ call $~lib/rt/pure/decrement end ) - (func $std/typedarray/testInstantiate (; 37 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $std/typedarray/testInstantiate (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -1704,10 +1729,7 @@ local.get $0 call $~lib/typedarray/Int8Array#constructor local.tee $1 - i32.load offset=4 - local.get $1 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -1743,10 +1765,7 @@ local.get $0 call $~lib/typedarray/Uint8Array#constructor local.tee $2 - i32.load offset=4 - local.get $2 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -1782,10 +1801,7 @@ local.get $0 call $~lib/typedarray/Uint8ClampedArray#constructor local.tee $3 - i32.load offset=4 - local.get $3 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -1821,10 +1837,7 @@ local.get $0 call $~lib/typedarray/Int16Array#constructor local.tee $4 - i32.load offset=4 - local.get $4 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -1848,9 +1861,7 @@ unreachable end local.get $4 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.get $0 i32.ne if @@ -1864,10 +1875,7 @@ local.get $0 call $~lib/typedarray/Uint16Array#constructor local.tee $5 - i32.load offset=4 - local.get $5 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -1891,9 +1899,7 @@ unreachable end local.get $5 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.get $0 i32.ne if @@ -1907,10 +1913,7 @@ local.get $0 call $~lib/typedarray/Int32Array#constructor local.tee $6 - i32.load offset=4 - local.get $6 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -1934,9 +1937,7 @@ unreachable end local.get $6 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.get $0 i32.ne if @@ -1950,10 +1951,7 @@ local.get $0 call $~lib/typedarray/Uint32Array#constructor local.tee $7 - i32.load offset=4 - local.get $7 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -1977,9 +1975,7 @@ unreachable end local.get $7 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.get $0 i32.ne if @@ -1993,10 +1989,7 @@ local.get $0 call $~lib/typedarray/Int64Array#constructor local.tee $8 - i32.load offset=4 - local.get $8 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -2020,9 +2013,7 @@ unreachable end local.get $8 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.get $0 i32.ne if @@ -2036,10 +2027,7 @@ local.get $0 call $~lib/typedarray/Uint64Array#constructor local.tee $9 - i32.load offset=4 - local.get $9 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -2063,9 +2051,7 @@ unreachable end local.get $9 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.get $0 i32.ne if @@ -2079,10 +2065,7 @@ local.get $0 call $~lib/typedarray/Float32Array#constructor local.tee $10 - i32.load offset=4 - local.get $10 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -2106,9 +2089,7 @@ unreachable end local.get $10 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.get $0 i32.ne if @@ -2122,10 +2103,7 @@ local.get $0 call $~lib/typedarray/Float64Array#constructor local.tee $11 - i32.load offset=4 - local.get $11 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -2149,9 +2127,7 @@ unreachable end local.get $11 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.get $0 i32.ne if @@ -2185,7 +2161,7 @@ local.get $11 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#__set (; 38 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Int32Array#__set (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -2209,7 +2185,7 @@ local.get $2 i32.store ) - (func $~lib/typedarray/Int32Array#__get (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#__get (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -2232,15 +2208,13 @@ i32.add i32.load ) - (func $~lib/typedarray/Int32Array#subarray (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int32Array#subarray (; 44 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain local.tee $4 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $3 local.get $1 i32.const 0 @@ -2327,7 +2301,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/rt/pure/__skippedRelease (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/pure/__skippedRelease (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.const 1820 i32.gt_u @@ -2339,7 +2313,7 @@ end local.get $1 ) - (func $~lib/typedarray/Float64Array#__set (; 42 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) + (func $~lib/typedarray/Float64Array#__set (; 46 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) local.get $1 local.get $0 i32.load offset=8 @@ -2363,15 +2337,13 @@ local.get $2 f64.store ) - (func $~lib/typedarray/Float64Array#subarray (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Float64Array#subarray (; 47 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain local.tee $4 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $3 local.get $1 i32.const 0 @@ -2458,7 +2430,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/util/sort/insertionSort (; 44 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/insertionSort (; 48 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) @@ -2540,7 +2512,7 @@ unreachable end ) - (func $~lib/memory/memory.fill (; 45 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.fill (; 49 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i64) block $~lib/util/memory/memset|inlined.0 @@ -2723,8 +2695,8 @@ local.set $2 local.get $0 i64.extend_i32_u - local.tee $4 - local.get $4 + local.get $0 + i64.extend_i32_u i64.const 32 i64.shl i64.or @@ -2765,7 +2737,7 @@ end end ) - (func $~lib/rt/tlsf/__free (; 46 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/tlsf/__free (; 50 ;) (type $FUNCSIG$vi) (param $0 i32) global.get $~lib/rt/tlsf/ROOT i32.eqz if @@ -2798,7 +2770,7 @@ i32.sub call $~lib/rt/tlsf/freeBlock ) - (func $~lib/util/sort/weakHeapSort (; 47 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/sort/weakHeapSort (; 51 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 f64) @@ -3059,7 +3031,7 @@ local.get $5 f64.store ) - (func $~lib/typedarray/Float64Array#sort (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#sort (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 f64) @@ -3067,29 +3039,27 @@ block $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 local.get $0 call $~lib/rt/pure/__retain - local.tee $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.tee $0 + call $~lib/typedarray/Int64Array#get:length local.tee $3 i32.const 1 i32.le_s if - local.get $2 + local.get $0 call $~lib/rt/pure/__release br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 end - local.get $2 + local.get $0 i32.load offset=4 - local.set $0 + local.set $2 local.get $3 i32.const 2 i32.eq if - local.get $0 + local.get $2 f64.load offset=8 local.set $4 - local.get $0 + local.get $2 f64.load local.set $5 i32.const 2 @@ -3101,14 +3071,14 @@ i32.const 0 i32.lt_s if - local.get $0 + local.get $2 local.get $5 f64.store offset=8 - local.get $0 + local.get $2 local.get $4 f64.store end - local.get $2 + local.get $0 call $~lib/rt/pure/__release br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0 end @@ -3116,25 +3086,25 @@ i32.const 256 i32.lt_s if - local.get $0 + local.get $2 local.get $3 local.get $1 call $~lib/util/sort/insertionSort else - local.get $0 + local.get $2 local.get $3 local.get $1 call $~lib/util/sort/weakHeapSort end end - local.get $2 - call $~lib/rt/pure/__retain - local.set $0 - local.get $2 - call $~lib/rt/pure/__release local.get $0 + call $~lib/rt/pure/__retain + local.set $1 + local.get $0 + call $~lib/rt/pure/__release + local.get $1 ) - (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 49 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/util/sort/COMPARATOR~anonymous|0 (; 53 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) local.get $0 @@ -3163,7 +3133,7 @@ i64.lt_s i32.sub ) - (func $~lib/typedarray/Float64Array#__get (; 50 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/typedarray/Float64Array#__get (; 54 ;) (type $FUNCSIG$dii) (param $0 i32) (param $1 i32) (result f64) local.get $1 local.get $0 i32.load offset=8 @@ -3186,7 +3156,7 @@ i32.add f64.load ) - (func $~lib/typedarray/Uint8ClampedArray#__set (; 51 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint8ClampedArray#__set (; 55 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -3218,7 +3188,7 @@ i32.and i32.store8 ) - (func $~lib/typedarray/Uint8ClampedArray#__get (; 52 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#__get (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -3237,7 +3207,7 @@ i32.add i32.load8_u ) - (func $~lib/typedarray/Int8Array#__set (; 53 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Int8Array#__set (; 57 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -3257,7 +3227,7 @@ local.get $2 i32.store8 ) - (func $~lib/typedarray/Int8Array#fill (; 54 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int8Array#fill (; 58 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3331,7 +3301,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/rt/__allocArray (; 55 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/rt/__allocArray (; 59 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) i32.const 16 local.get $2 @@ -3364,7 +3334,7 @@ end local.get $2 ) - (func $~lib/typedarray/Int8Array#__get (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#__get (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -3383,7 +3353,7 @@ i32.add i32.load8_s ) - (func $~lib/array/Array#__get (; 57 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 61 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -3402,7 +3372,7 @@ i32.add i32.load8_s ) - (func $std/typedarray/isInt8ArrayEqual (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/typedarray/isInt8ArrayEqual (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -3454,7 +3424,7 @@ call $~lib/rt/pure/__release i32.const 0 ) - (func $~lib/typedarray/Int8Array#subarray (; 59 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int8Array#subarray (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -3543,7 +3513,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int32Array#fill (; 60 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int32Array#fill (; 64 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3555,9 +3525,7 @@ i32.load offset=4 local.set $6 local.get $4 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $1 local.get $2 i32.const 0 @@ -3606,7 +3574,8 @@ loop $repeat|0 local.get $0 local.get $1 - i32.lt_s + i32.ge_s + i32.eqz if local.get $0 i32.const 2 @@ -3629,7 +3598,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/array/Array#__get (; 61 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 65 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -3652,7 +3621,7 @@ i32.add i32.load ) - (func $std/typedarray/isInt32ArrayEqual (; 62 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/typedarray/isInt32ArrayEqual (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -3662,18 +3631,14 @@ call $~lib/rt/pure/__retain drop block $folding-inner0 + local.get $0 + call $~lib/typedarray/Int32Array#get:length local.get $1 i32.load offset=12 - local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u i32.ne br_if $folding-inner0 local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $3 loop $repeat|0 local.get $2 @@ -3708,7 +3673,7 @@ call $~lib/rt/pure/__release i32.const 0 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 63 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 67 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) local.get $3 call $~lib/rt/pure/__retain drop @@ -3718,7 +3683,7 @@ local.get $1 i32.add ) - (func $~lib/typedarray/Int8Array#reduce (; 64 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#reduce (; 68 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3760,7 +3725,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> (; 65 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8> (; 69 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -3798,7 +3763,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#__set (; 66 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint8Array#__set (; 70 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -3818,7 +3783,7 @@ local.get $2 i32.store8 ) - (func $~lib/typedarray/Uint8Array#reduce (; 67 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#reduce (; 71 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3861,7 +3826,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> (; 68 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8> (; 72 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -3900,7 +3865,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8> (; 69 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8> (; 73 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -3939,7 +3904,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#__set (; 70 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Int16Array#__set (; 74 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -3963,22 +3928,20 @@ local.get $2 i32.store16 ) - (func $~lib/typedarray/Int16Array#reduce (; 71 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#reduce (; 75 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 i32.const 0 local.set $0 - local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int16Array#get:length local.set $4 loop $repeat|0 local.get $0 @@ -3987,7 +3950,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 1 i32.shl @@ -3995,9 +3958,9 @@ i32.add i32.load16_s local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.add @@ -4005,11 +3968,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16> (; 72 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16> (; 76 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4047,7 +4010,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#__set (; 73 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint16Array#__set (; 77 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -4071,22 +4034,20 @@ local.get $2 i32.store16 ) - (func $~lib/typedarray/Uint16Array#reduce (; 74 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reduce (; 78 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 i32.const 0 local.set $0 - local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int16Array#get:length local.set $4 loop $repeat|0 local.get $0 @@ -4095,7 +4056,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 1 i32.shl @@ -4103,9 +4064,9 @@ i32.add i32.load16_u local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.add @@ -4113,11 +4074,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16> (; 75 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16> (; 79 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4155,22 +4116,20 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#reduce (; 76 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#reduce (; 80 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=4 local.set $4 i32.const 0 local.set $0 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.get $3 + call $~lib/typedarray/Int32Array#get:length local.set $5 loop $repeat|0 local.get $0 @@ -4179,7 +4138,7 @@ if i32.const 4 global.set $~lib/argc - local.get $3 + local.get $2 local.get $0 i32.const 2 i32.shl @@ -4187,10 +4146,10 @@ i32.add i32.load local.get $0 - local.get $2 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$iiiii) - local.set $3 + local.set $2 local.get $0 i32.const 1 i32.add @@ -4198,11 +4157,11 @@ br $repeat|0 end end - local.get $2 - call $~lib/rt/pure/__release local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32> (; 77 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32> (; 81 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4239,7 +4198,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint32Array#__set (; 78 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint32Array#__set (; 82 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $1 local.get $0 i32.load offset=8 @@ -4263,7 +4222,7 @@ local.get $2 i32.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32> (; 79 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32> (; 83 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4300,7 +4259,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#__set (; 80 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/typedarray/Int64Array#__set (; 84 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) local.get $1 local.get $0 i32.load offset=8 @@ -4324,7 +4283,7 @@ local.get $2 i64.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 81 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 85 ;) (type $FUNCSIG$jjjii) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) local.get $3 call $~lib/rt/pure/__retain drop @@ -4334,22 +4293,20 @@ local.get $1 i64.add ) - (func $~lib/typedarray/Int64Array#reduce (; 82 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i64) + (func $~lib/typedarray/Int64Array#reduce (; 86 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (local $2 i64) + (local $3 i32) (local $4 i32) (local $5 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=4 local.set $4 i32.const 0 local.set $0 - local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.get $3 + call $~lib/typedarray/Int64Array#get:length local.set $5 loop $repeat|0 local.get $0 @@ -4358,7 +4315,7 @@ if i32.const 4 global.set $~lib/argc - local.get $3 + local.get $2 local.get $0 i32.const 3 i32.shl @@ -4366,10 +4323,10 @@ i32.add i64.load local.get $0 - local.get $2 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$jjjii) - local.set $3 + local.set $2 local.get $0 i32.const 1 i32.add @@ -4377,11 +4334,11 @@ br $repeat|0 end end - local.get $2 - call $~lib/rt/pure/__release local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64> (; 83 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64> (; 87 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4418,7 +4375,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint64Array#__set (; 84 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/typedarray/Uint64Array#__set (; 88 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64) local.get $1 local.get $0 i32.load offset=8 @@ -4442,7 +4399,7 @@ local.get $2 i64.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64> (; 85 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64> (; 89 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4479,7 +4436,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#__set (; 86 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/typedarray/Float32Array#__set (; 90 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32) local.get $1 local.get $0 i32.load offset=8 @@ -4503,7 +4460,7 @@ local.get $2 f32.store ) - (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 87 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 91 ;) (type $FUNCSIG$fffii) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) local.get $3 call $~lib/rt/pure/__retain drop @@ -4513,22 +4470,20 @@ local.get $1 f32.add ) - (func $~lib/typedarray/Float32Array#reduce (; 88 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) - (local $1 i32) - (local $2 f32) + (func $~lib/typedarray/Float32Array#reduce (; 92 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) + (local $1 f32) + (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 i32.const 0 local.set $0 - local.get $1 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int32Array#get:length local.set $4 loop $repeat|0 local.get $0 @@ -4537,7 +4492,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 2 i32.shl @@ -4545,9 +4500,9 @@ i32.add f32.load local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.add @@ -4555,11 +4510,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32> (; 89 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32> (; 93 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4595,7 +4550,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 90 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 94 ;) (type $FUNCSIG$dddii) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) local.get $3 call $~lib/rt/pure/__retain drop @@ -4605,22 +4560,20 @@ local.get $1 f64.add ) - (func $~lib/typedarray/Float64Array#reduce (; 91 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) - (local $1 i32) - (local $2 f64) + (func $~lib/typedarray/Float64Array#reduce (; 95 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (local $1 f64) + (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 i32.const 0 local.set $0 - local.get $1 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int64Array#get:length local.set $4 loop $repeat|0 local.get $0 @@ -4629,7 +4582,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 3 i32.shl @@ -4637,9 +4590,9 @@ i32.add f64.load local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.add @@ -4647,11 +4600,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64> (; 92 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64> (; 96 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4687,7 +4640,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#reduceRight (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#reduceRight (; 97 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -4728,7 +4681,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8> (; 94 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8> (; 98 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4766,7 +4719,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#reduceRight (; 95 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#reduceRight (; 99 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4808,7 +4761,7 @@ call $~lib/rt/pure/__release local.get $3 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8> (; 96 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8> (; 100 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4847,7 +4800,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8> (; 97 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8> (; 101 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4886,19 +4839,17 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#reduceRight (; 98 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#reduceRight (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 - local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub local.set $0 @@ -4909,7 +4860,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 1 i32.shl @@ -4917,9 +4868,9 @@ i32.add i32.load16_s local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.sub @@ -4927,11 +4878,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16> (; 99 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16> (; 103 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -4969,19 +4920,17 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#reduceRight (; 100 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reduceRight (; 104 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 - local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub local.set $0 @@ -4992,7 +4941,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 1 i32.shl @@ -5000,9 +4949,9 @@ i32.add i32.load16_u local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.sub @@ -5010,11 +4959,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16> (; 101 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16> (; 105 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -5052,19 +5001,17 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#reduceRight (; 102 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#reduceRight (; 106 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=4 local.set $4 - local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.get $3 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub local.set $0 @@ -5075,7 +5022,7 @@ if i32.const 4 global.set $~lib/argc - local.get $3 + local.get $2 local.get $0 i32.const 2 i32.shl @@ -5083,10 +5030,10 @@ i32.add i32.load local.get $0 - local.get $2 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$iiiii) - local.set $3 + local.set $2 local.get $0 i32.const 1 i32.sub @@ -5094,11 +5041,11 @@ br $repeat|0 end end - local.get $2 - call $~lib/rt/pure/__release local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32> (; 103 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32> (; 107 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -5135,7 +5082,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32> (; 104 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32> (; 108 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -5172,19 +5119,17 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#reduceRight (; 105 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) - (local $2 i32) - (local $3 i64) + (func $~lib/typedarray/Int64Array#reduceRight (; 109 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (local $2 i64) + (local $3 i32) (local $4 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $2 + local.tee $3 i32.load offset=4 local.set $4 - local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.get $3 + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub local.set $0 @@ -5195,7 +5140,7 @@ if i32.const 4 global.set $~lib/argc - local.get $3 + local.get $2 local.get $0 i32.const 3 i32.shl @@ -5203,10 +5148,10 @@ i32.add i64.load local.get $0 - local.get $2 + local.get $3 local.get $1 call_indirect (type $FUNCSIG$jjjii) - local.set $3 + local.set $2 local.get $0 i32.const 1 i32.sub @@ -5214,11 +5159,11 @@ br $repeat|0 end end - local.get $2 - call $~lib/rt/pure/__release local.get $3 + call $~lib/rt/pure/__release + local.get $2 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64> (; 106 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64> (; 110 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -5255,7 +5200,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64> (; 107 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64> (; 111 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -5292,19 +5237,17 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#reduceRight (; 108 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) - (local $1 i32) - (local $2 f32) + (func $~lib/typedarray/Float32Array#reduceRight (; 112 ;) (type $FUNCSIG$fi) (param $0 i32) (result f32) + (local $1 f32) + (local $2 i32) (local $3 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 - local.get $1 - i32.load offset=8 - i32.const 2 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub local.set $0 @@ -5315,7 +5258,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 2 i32.shl @@ -5323,9 +5266,9 @@ i32.add f32.load local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.sub @@ -5333,11 +5276,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32> (; 109 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32> (; 113 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -5373,19 +5316,17 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#reduceRight (; 110 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) - (local $1 i32) - (local $2 f64) + (func $~lib/typedarray/Float64Array#reduceRight (; 114 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) + (local $1 f64) + (local $2 i32) (local $3 i32) local.get $0 call $~lib/rt/pure/__retain - local.tee $1 + local.tee $2 i32.load offset=4 local.set $3 - local.get $1 - i32.load offset=8 - i32.const 3 - i32.shr_u + local.get $2 + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub local.set $0 @@ -5396,7 +5337,7 @@ if i32.const 4 global.set $~lib/argc - local.get $2 + local.get $1 local.get $0 i32.const 3 i32.shl @@ -5404,9 +5345,9 @@ i32.add f64.load local.get $0 - local.get $1 + local.get $2 call $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 - local.set $2 + local.set $1 local.get $0 i32.const 1 i32.sub @@ -5414,11 +5355,11 @@ br $repeat|0 end end - local.get $1 - call $~lib/rt/pure/__release local.get $2 + call $~lib/rt/pure/__release + local.get $1 ) - (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64> (; 111 ;) (type $FUNCSIG$v) + (func $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64> (; 115 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -5454,7 +5395,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 112 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 116 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -5464,7 +5405,7 @@ local.get $0 i32.mul ) - (func $~lib/typedarray/Int8Array#map (; 113 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#map (; 117 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5524,7 +5465,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8> (; 114 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8> (; 118 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -5592,7 +5533,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#map (; 115 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8Array#map (; 119 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5652,7 +5593,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Uint8Array#__get (; 116 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#__get (; 120 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -5671,7 +5612,7 @@ i32.add i32.load8_u ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8> (; 117 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8> (; 121 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -5739,7 +5680,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8ClampedArray#map (; 118 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#map (; 122 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5799,7 +5740,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8> (; 119 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8> (; 123 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -5867,7 +5808,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#map (; 120 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#map (; 124 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5879,9 +5820,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -5936,7 +5875,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int16Array#__get (; 121 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#__get (; 125 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -5959,7 +5898,7 @@ i32.add i32.load16_s ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16> (; 122 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16> (; 126 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6027,7 +5966,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#map (; 123 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#map (; 127 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6039,9 +5978,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -6096,7 +6033,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Uint16Array#__get (; 124 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#__get (; 128 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -6119,7 +6056,7 @@ i32.add i32.load16_u ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16> (; 125 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16> (; 129 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6187,7 +6124,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#map (; 126 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int32Array#map (; 130 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6199,9 +6136,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -6256,7 +6191,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32> (; 127 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32> (; 131 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6324,7 +6259,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint32Array#map (; 128 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint32Array#map (; 132 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6336,9 +6271,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -6393,7 +6326,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Uint32Array#__get (; 129 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint32Array#__get (; 133 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 local.get $0 i32.load offset=8 @@ -6416,7 +6349,7 @@ i32.add i32.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32> (; 130 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32> (; 134 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6484,7 +6417,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 131 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 135 ;) (type $FUNCSIG$jjii) (param $0 i64) (param $1 i32) (param $2 i32) (result i64) local.get $2 call $~lib/rt/pure/__retain drop @@ -6494,7 +6427,7 @@ local.get $0 i64.mul ) - (func $~lib/typedarray/Int64Array#map (; 132 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int64Array#map (; 136 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6506,9 +6439,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -6563,7 +6494,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int64Array#__get (; 133 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/typedarray/Int64Array#__get (; 137 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) local.get $1 local.get $0 i32.load offset=8 @@ -6586,7 +6517,7 @@ i32.add i64.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64> (; 134 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64> (; 138 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6654,7 +6585,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint64Array#map (; 135 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint64Array#map (; 139 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6666,9 +6597,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -6723,7 +6652,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Uint64Array#__get (; 136 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/typedarray/Uint64Array#__get (; 140 ;) (type $FUNCSIG$jii) (param $0 i32) (param $1 i32) (result i64) local.get $1 local.get $0 i32.load offset=8 @@ -6746,7 +6675,7 @@ i32.add i64.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64> (; 137 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64> (; 141 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6814,7 +6743,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 138 ;) (type $FUNCSIG$ffii) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 142 ;) (type $FUNCSIG$ffii) (param $0 f32) (param $1 i32) (param $2 i32) (result f32) local.get $2 call $~lib/rt/pure/__retain drop @@ -6824,7 +6753,7 @@ local.get $0 f32.mul ) - (func $~lib/typedarray/Float32Array#map (; 139 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float32Array#map (; 143 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -6836,9 +6765,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -6893,7 +6820,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Float32Array#__get (; 140 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/typedarray/Float32Array#__get (; 144 ;) (type $FUNCSIG$fii) (param $0 i32) (param $1 i32) (result f32) local.get $1 local.get $0 i32.load offset=8 @@ -6916,7 +6843,7 @@ i32.add f32.load ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32> (; 141 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32> (; 145 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -6984,7 +6911,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 142 ;) (type $FUNCSIG$ddii) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 146 ;) (type $FUNCSIG$ddii) (param $0 f64) (param $1 i32) (param $2 i32) (result f64) local.get $2 call $~lib/rt/pure/__retain drop @@ -6994,7 +6921,7 @@ local.get $0 f64.mul ) - (func $~lib/typedarray/Float64Array#map (; 143 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float64Array#map (; 147 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -7006,9 +6933,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $1 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $2 local.get $1 i32.load offset=4 @@ -7063,7 +6988,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64> (; 144 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64> (; 148 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -7131,7 +7056,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 145 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 149 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7143,7 +7068,7 @@ i32.const 2 i32.eq ) - (func $~lib/typedarray/Int8Array#some (; 146 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#some (; 150 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7193,7 +7118,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 147 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 151 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7204,7 +7129,7 @@ i32.and i32.eqz ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8> (; 148 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8> (; 152 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7251,7 +7176,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#some (; 149 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#some (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7301,7 +7226,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8> (; 150 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8> (; 154 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7348,7 +7273,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8> (; 151 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8> (; 155 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7395,7 +7320,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 152 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 156 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7407,7 +7332,7 @@ i32.const 2 i32.eq ) - (func $~lib/typedarray/Int16Array#some (; 153 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#some (; 157 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7420,15 +7345,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -7461,7 +7385,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 154 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 158 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7472,7 +7396,7 @@ i32.and i32.eqz ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16> (; 155 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16> (; 159 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7519,7 +7443,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#some (; 156 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#some (; 160 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7532,15 +7456,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -7573,7 +7496,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16> (; 157 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16> (; 161 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7620,7 +7543,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 158 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 162 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7630,7 +7553,7 @@ i32.const 2 i32.eq ) - (func $~lib/typedarray/Int32Array#some (; 159 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#some (; 163 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7643,15 +7566,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -7684,7 +7606,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 160 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 164 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7693,7 +7615,7 @@ local.get $0 i32.eqz ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32> (; 161 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32> (; 165 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7740,7 +7662,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32> (; 162 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32> (; 166 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7787,7 +7709,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 163 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 167 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7797,7 +7719,7 @@ i64.const 2 i64.eq ) - (func $~lib/typedarray/Int64Array#some (; 164 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#some (; 168 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7810,15 +7732,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -7851,7 +7772,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 165 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 169 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7861,7 +7782,7 @@ i64.const 0 i64.eq ) - (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64> (; 166 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64> (; 170 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7908,7 +7829,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64> (; 167 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64> (; 171 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -7955,7 +7876,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 168 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 172 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -7965,7 +7886,7 @@ f32.const 2 f32.eq ) - (func $~lib/typedarray/Float32Array#some (; 169 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#some (; 173 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7978,15 +7899,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -8019,7 +7939,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 170 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 174 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -8029,7 +7949,7 @@ f32.const 0 f32.eq ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32> (; 171 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32> (; 175 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8076,7 +7996,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 172 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 176 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -8086,7 +8006,7 @@ f64.const 2 f64.eq ) - (func $~lib/typedarray/Float64Array#some (; 173 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#some (; 177 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8099,15 +8019,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -8140,7 +8059,7 @@ i32.const 0 end ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 174 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 178 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -8150,7 +8069,7 @@ f64.const 0 f64.eq ) - (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64> (; 175 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64> (; 179 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8197,7 +8116,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#findIndex (; 176 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#findIndex (; 180 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8248,7 +8167,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 177 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 (; 181 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -8260,7 +8179,7 @@ i32.const 4 i32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8> (; 178 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8> (; 182 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8310,7 +8229,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#findIndex (; 179 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#findIndex (; 183 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8361,7 +8280,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8> (; 180 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8> (; 184 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8411,7 +8330,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8> (; 181 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8> (; 185 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8461,7 +8380,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#findIndex (; 182 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#findIndex (; 186 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8473,16 +8392,15 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $4 block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int16Array,i16>|inlined.0 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -8516,7 +8434,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 183 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 (; 187 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -8528,7 +8446,7 @@ i32.const 4 i32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16> (; 184 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16> (; 188 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8578,7 +8496,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#findIndex (; 185 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#findIndex (; 189 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8590,16 +8508,15 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $4 block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Uint16Array,u16>|inlined.0 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -8633,7 +8550,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16> (; 186 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16> (; 190 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8683,7 +8600,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#findIndex (; 187 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#findIndex (; 191 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8695,16 +8612,15 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $4 block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int32Array,i32>|inlined.0 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -8738,7 +8654,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 188 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 (; 192 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -8748,7 +8664,7 @@ i32.const 4 i32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32> (; 189 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32> (; 193 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8798,7 +8714,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32> (; 190 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32> (; 194 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8848,7 +8764,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#findIndex (; 191 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#findIndex (; 195 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8860,16 +8776,15 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $4 block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Int64Array,i64>|inlined.0 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -8903,7 +8818,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 192 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 (; 196 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -8913,7 +8828,7 @@ i64.const 4 i64.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64> (; 193 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64> (; 197 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -8963,7 +8878,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64> (; 194 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64> (; 198 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9013,7 +8928,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#findIndex (; 195 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#findIndex (; 199 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9025,16 +8940,15 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $4 block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float32Array,f32>|inlined.0 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -9068,7 +8982,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 196 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 (; 200 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -9078,7 +8992,7 @@ f32.const 4 f32.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32> (; 197 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32> (; 201 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9128,7 +9042,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#findIndex (; 198 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#findIndex (; 202 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9140,16 +9054,15 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $4 block $~lib/typedarray/FIND_INDEX<~lib/typedarray/Float64Array,f64>|inlined.0 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -9183,7 +9096,7 @@ end local.get $0 ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 199 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 (; 203 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -9193,7 +9106,7 @@ f64.const 4 f64.eq ) - (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64> (; 200 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64> (; 204 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9243,7 +9156,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 201 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 205 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -9260,7 +9173,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int8Array#every (; 202 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int8Array#every (; 206 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9310,7 +9223,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8> (; 203 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8> (; 207 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9357,7 +9270,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 204 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 (; 208 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -9368,7 +9281,7 @@ i32.and i32.eqz ) - (func $~lib/typedarray/Uint8Array#every (; 205 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint8Array#every (; 209 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9418,7 +9331,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8> (; 206 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8> (; 210 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9465,7 +9378,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8> (; 207 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8> (; 211 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9512,7 +9425,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 208 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 212 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -9529,7 +9442,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int16Array#every (; 209 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int16Array#every (; 213 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9542,15 +9455,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -9563,19 +9475,18 @@ local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) + i32.eqz if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else local.get $2 call $~lib/rt/pure/__release i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int16Array,i16>|inlined.0 end - unreachable + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 end end local.get $2 @@ -9583,7 +9494,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16> (; 210 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16> (; 214 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9630,7 +9541,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#every (; 211 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Uint16Array#every (; 215 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9643,15 +9554,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -9664,19 +9574,18 @@ local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) + i32.eqz if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else local.get $2 call $~lib/rt/pure/__release i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Uint16Array,u16>|inlined.0 end - unreachable + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 end end local.get $2 @@ -9684,7 +9593,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16> (; 212 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16> (; 216 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9731,7 +9640,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 213 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 217 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -9744,7 +9653,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int32Array#every (; 214 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int32Array#every (; 218 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9757,15 +9666,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -9778,19 +9686,18 @@ local.get $2 local.get $1 call_indirect (type $FUNCSIG$iiii) + i32.eqz if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else local.get $2 call $~lib/rt/pure/__release i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int32Array,i32>|inlined.0 end - unreachable + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 end end local.get $2 @@ -9798,7 +9705,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32> (; 215 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32> (; 219 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9845,7 +9752,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32> (; 216 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32> (; 220 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -9892,7 +9799,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 217 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 221 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -9906,7 +9813,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/typedarray/Int64Array#every (; 218 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Int64Array#every (; 222 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -9919,15 +9826,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -9940,19 +9846,18 @@ local.get $2 local.get $1 call_indirect (type $FUNCSIG$ijii) + i32.eqz if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else local.get $2 call $~lib/rt/pure/__release i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Int64Array,i64>|inlined.0 end - unreachable + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 end end local.get $2 @@ -9960,7 +9865,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64> (; 219 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64> (; 223 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -10007,7 +9912,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 220 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 (; 224 ;) (type $FUNCSIG$ijii) (param $0 i64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -10021,7 +9926,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64> (; 221 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64> (; 225 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -10068,7 +9973,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/math/NativeMathf.mod (; 222 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) + (func $~lib/math/NativeMathf.mod (; 226 ;) (type $FUNCSIG$ff) (param $0 f32) (result f32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10217,7 +10122,7 @@ local.get $0 f32.mul ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 223 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 227 ;) (type $FUNCSIG$ifii) (param $0 f32) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -10230,7 +10135,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/typedarray/Float32Array#every (; 224 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float32Array#every (; 228 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10243,15 +10148,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -10264,19 +10168,18 @@ local.get $2 local.get $1 call_indirect (type $FUNCSIG$ifii) + i32.eqz if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else local.get $2 call $~lib/rt/pure/__release i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Float32Array,f32>|inlined.0 end - unreachable + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 end end local.get $2 @@ -10284,7 +10187,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32> (; 225 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32> (; 229 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -10331,7 +10234,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/math/NativeMath.mod (; 226 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) + (func $~lib/math/NativeMath.mod (; 230 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (local $1 i64) (local $2 i64) (local $3 i64) @@ -10487,7 +10390,7 @@ local.get $0 f64.mul ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 227 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 231 ;) (type $FUNCSIG$idii) (param $0 f64) (param $1 i32) (param $2 i32) (result i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -10500,7 +10403,7 @@ call $~lib/rt/pure/__release local.get $1 ) - (func $~lib/typedarray/Float64Array#every (; 228 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#every (; 232 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10513,15 +10416,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -10534,19 +10436,18 @@ local.get $2 local.get $1 call_indirect (type $FUNCSIG$idii) + i32.eqz if - local.get $0 - i32.const 1 - i32.add - local.set $0 - br $repeat|0 - else local.get $2 call $~lib/rt/pure/__release i32.const 0 br $~lib/typedarray/EVERY<~lib/typedarray/Float64Array,f64>|inlined.0 end - unreachable + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 end end local.get $2 @@ -10554,7 +10455,7 @@ i32.const 1 end ) - (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64> (; 229 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64> (; 233 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 3 @@ -10601,7 +10502,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 230 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 (; 234 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -10651,7 +10552,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#forEach (; 231 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/typedarray/Int8Array#forEach (; 235 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10689,7 +10590,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8> (; 232 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8> (; 236 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -10748,7 +10649,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#forEach (; 233 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Uint8Array#forEach (; 237 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -10787,7 +10688,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8> (; 234 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8> (; 238 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -10841,7 +10742,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8> (; 235 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8> (; 239 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -10895,7 +10796,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 236 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 (; 240 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -10945,7 +10846,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#forEach (; 237 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/typedarray/Int16Array#forEach (; 241 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -10957,9 +10858,7 @@ i32.const 0 local.set $0 local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $3 loop $repeat|0 local.get $0 @@ -10987,7 +10886,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16> (; 238 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16> (; 242 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11046,7 +10945,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#forEach (; 239 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/typedarray/Uint16Array#forEach (; 243 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11058,9 +10957,7 @@ i32.const 0 local.set $0 local.get $1 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.set $3 loop $repeat|0 local.get $0 @@ -11088,7 +10985,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16> (; 240 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16> (; 244 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11141,7 +11038,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 241 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 (; 245 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -11187,7 +11084,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#forEach (; 242 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Int32Array#forEach (; 246 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11199,15 +11096,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -11230,7 +11126,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32> (; 243 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32> (; 247 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11278,7 +11174,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32> (; 244 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32> (; 248 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11326,7 +11222,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 245 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 (; 249 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -11373,7 +11269,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#forEach (; 246 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/typedarray/Int64Array#forEach (; 250 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -11385,15 +11281,14 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $4 loop $repeat|0 - local.get $0 - local.get $4 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $4 + i32.ge_s + br_if $break|0 i32.const 3 global.set $~lib/argc local.get $0 @@ -11416,7 +11311,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64> (; 247 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64> (; 251 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11467,7 +11362,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64> (; 248 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64> (; 252 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11518,7 +11413,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 249 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 (; 253 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -11565,7 +11460,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#forEach (; 250 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/typedarray/Float32Array#forEach (; 254 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11577,9 +11472,7 @@ i32.const 0 local.set $0 local.get $1 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.set $3 loop $repeat|0 local.get $0 @@ -11607,7 +11500,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32> (; 251 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32> (; 255 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11657,7 +11550,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 252 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0 (; 256 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) local.get $2 call $~lib/rt/pure/__retain drop @@ -11704,7 +11597,7 @@ local.get $2 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#forEach (; 253 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/typedarray/Float64Array#forEach (; 257 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11716,9 +11609,7 @@ i32.const 0 local.set $0 local.get $1 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.set $3 loop $repeat|0 local.get $0 @@ -11746,7 +11637,7 @@ local.get $1 call $~lib/rt/pure/__release ) - (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64> (; 254 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64> (; 258 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -11796,7 +11687,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int8Array#reverse (; 255 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int8Array#reverse (; 259 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -11853,7 +11744,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> (; 256 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int8Array,i8> (; 260 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -12021,7 +11912,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8Array#reverse (; 257 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8Array#reverse (; 261 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12078,7 +11969,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Uint8Array#subarray (; 258 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8Array#subarray (; 262 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12135,7 +12026,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 259 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 263 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -12295,7 +12186,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint8ClampedArray#subarray (; 260 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint8ClampedArray#subarray (; 264 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12352,7 +12243,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 261 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 265 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -12512,7 +12403,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int16Array#reverse (; 262 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#reverse (; 266 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12526,17 +12417,16 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub local.set $1 loop $repeat|0 - local.get $0 - local.get $1 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $1 + i32.ge_s + br_if $break|0 local.get $0 i32.const 1 i32.shl @@ -12575,70 +12465,70 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int16Array#subarray (; 263 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int16Array#subarray (; 267 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - i32.const 8 + i32.const 4 local.get $0 call $~lib/rt/pure/__retain local.tee $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 i32.const 8 local.get $1 i32.lt_s select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 i32.const 6 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.load local.get $2 i32.load call $~lib/rt/pure/__retainRelease i32.store - local.get $0 + local.get $1 local.get $2 i32.load offset=4 - i32.const 4 - local.get $1 - i32.const 4 - local.get $1 - i32.lt_s - select - local.tee $1 + local.get $0 i32.const 1 i32.shl i32.add i32.store offset=4 + local.get $1 + local.get $3 local.get $0 - local.get $3 - local.get $1 - local.get $3 - local.get $1 - i32.gt_s - select - local.get $1 i32.sub i32.const 1 i32.shl i32.store offset=8 local.get $2 call $~lib/rt/pure/__release - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $2 - local.get $0 + local.set $0 + local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 264 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 268 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -12804,7 +12694,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint16Array#reverse (; 265 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reverse (; 269 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -12818,17 +12708,16 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length i32.const 1 i32.sub local.set $1 loop $repeat|0 - local.get $0 - local.get $1 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $1 + i32.ge_s + br_if $break|0 local.get $0 i32.const 1 i32.shl @@ -12867,70 +12756,70 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Uint16Array#subarray (; 266 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint16Array#subarray (; 270 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - i32.const 8 + i32.const 4 local.get $0 call $~lib/rt/pure/__retain local.tee $2 - i32.load offset=8 - i32.const 1 - i32.shr_u + call $~lib/typedarray/Int16Array#get:length local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 i32.const 8 local.get $1 i32.lt_s select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 i32.const 7 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.load local.get $2 i32.load call $~lib/rt/pure/__retainRelease i32.store - local.get $0 + local.get $1 local.get $2 i32.load offset=4 - i32.const 4 - local.get $1 - i32.const 4 - local.get $1 - i32.lt_s - select - local.tee $1 + local.get $0 i32.const 1 i32.shl i32.add i32.store offset=4 + local.get $1 + local.get $3 local.get $0 - local.get $3 - local.get $1 - local.get $3 - local.get $1 - i32.gt_s - select - local.get $1 i32.sub i32.const 1 i32.shl i32.store offset=8 local.get $2 call $~lib/rt/pure/__release - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $2 - local.get $0 + local.set $0 + local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 267 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 271 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -13090,7 +12979,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int32Array#reverse (; 268 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int32Array#reverse (; 272 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -13104,17 +12993,16 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub local.set $1 loop $repeat|0 - local.get $0 - local.get $1 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $1 + i32.ge_s + br_if $break|0 local.get $0 i32.const 2 i32.shl @@ -13153,7 +13041,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> (; 269 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int32Array,i32> (; 273 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -13309,70 +13197,70 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint32Array#subarray (; 270 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint32Array#subarray (; 274 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - i32.const 8 + i32.const 4 local.get $0 call $~lib/rt/pure/__retain local.tee $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 i32.const 8 local.get $1 i32.lt_s select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 i32.const 9 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.load local.get $2 i32.load call $~lib/rt/pure/__retainRelease i32.store - local.get $0 + local.get $1 local.get $2 i32.load offset=4 - i32.const 4 - local.get $1 - i32.const 4 - local.get $1 - i32.lt_s - select - local.tee $1 + local.get $0 i32.const 2 i32.shl i32.add i32.store offset=4 + local.get $1 + local.get $3 local.get $0 - local.get $3 - local.get $1 - local.get $3 - local.get $1 - i32.gt_s - select - local.get $1 i32.sub i32.const 2 i32.shl i32.store offset=8 local.get $2 call $~lib/rt/pure/__release - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $2 - local.get $0 + local.set $0 + local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> (; 271 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> (; 275 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -13526,7 +13414,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Int64Array#reverse (; 272 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int64Array#reverse (; 276 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -13540,17 +13428,16 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub local.set $1 loop $repeat|0 - local.get $0 - local.get $1 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $1 + i32.ge_s + br_if $break|0 local.get $0 i32.const 3 i32.shl @@ -13589,70 +13476,70 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Int64Array#subarray (; 273 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Int64Array#subarray (; 277 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - i32.const 8 + i32.const 4 local.get $0 call $~lib/rt/pure/__retain local.tee $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 i32.const 8 local.get $1 i32.lt_s select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 i32.const 10 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.load local.get $2 i32.load call $~lib/rt/pure/__retainRelease i32.store - local.get $0 + local.get $1 local.get $2 i32.load offset=4 - i32.const 4 - local.get $1 - i32.const 4 - local.get $1 - i32.lt_s - select - local.tee $1 + local.get $0 i32.const 3 i32.shl i32.add i32.store offset=4 + local.get $1 + local.get $3 local.get $0 - local.get $3 - local.get $1 - local.get $3 - local.get $1 - i32.gt_s - select - local.get $1 i32.sub i32.const 3 i32.shl i32.store offset=8 local.get $2 call $~lib/rt/pure/__release - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $2 - local.get $0 + local.set $0 + local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 274 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 278 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -13809,70 +13696,70 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Uint64Array#subarray (; 275 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Uint64Array#subarray (; 279 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - i32.const 8 + i32.const 4 local.get $0 call $~lib/rt/pure/__retain local.tee $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 i32.const 8 local.get $1 i32.lt_s select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 i32.const 11 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.load local.get $2 i32.load call $~lib/rt/pure/__retainRelease i32.store - local.get $0 + local.get $1 local.get $2 i32.load offset=4 - i32.const 4 - local.get $1 - i32.const 4 - local.get $1 - i32.lt_s - select - local.tee $1 + local.get $0 i32.const 3 i32.shl i32.add i32.store offset=4 + local.get $1 + local.get $3 local.get $0 - local.get $3 - local.get $1 - local.get $3 - local.get $1 - i32.gt_s - select - local.get $1 i32.sub i32.const 3 i32.shl i32.store offset=8 local.get $2 call $~lib/rt/pure/__release - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $2 - local.get $0 + local.set $0 + local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> (; 276 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> (; 280 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -14029,7 +13916,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float32Array#reverse (; 277 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float32Array#reverse (; 281 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -14043,17 +13930,16 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.sub local.set $1 loop $repeat|0 - local.get $0 - local.get $1 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $1 + i32.ge_s + br_if $break|0 local.get $0 i32.const 2 i32.shl @@ -14092,70 +13978,70 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $~lib/typedarray/Float32Array#subarray (; 278 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float32Array#subarray (; 282 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) - i32.const 8 + i32.const 4 local.get $0 call $~lib/rt/pure/__retain local.tee $2 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $0 + i32.const 8 + local.get $1 i32.const 8 local.get $1 i32.lt_s select + local.tee $1 + local.get $0 + local.get $1 + local.get $0 + i32.gt_s + select local.set $3 i32.const 12 i32.const 12 call $~lib/rt/tlsf/__alloc call $~lib/rt/pure/__retain - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.load local.get $2 i32.load call $~lib/rt/pure/__retainRelease i32.store - local.get $0 + local.get $1 local.get $2 i32.load offset=4 - i32.const 4 - local.get $1 - i32.const 4 - local.get $1 - i32.lt_s - select - local.tee $1 + local.get $0 i32.const 2 i32.shl i32.add i32.store offset=4 + local.get $1 + local.get $3 local.get $0 - local.get $3 - local.get $1 - local.get $3 - local.get $1 - i32.gt_s - select - local.get $1 i32.sub i32.const 2 i32.shl i32.store offset=8 local.get $2 call $~lib/rt/pure/__release - local.get $0 + local.get $1 call $~lib/rt/pure/__retain - local.set $2 - local.get $0 + local.set $0 + local.get $1 call $~lib/rt/pure/__release - local.get $2 + local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 279 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 283 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -14312,7 +14198,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/typedarray/Float64Array#reverse (; 280 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/typedarray/Float64Array#reverse (; 284 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -14326,17 +14212,16 @@ i32.const 0 local.set $0 local.get $2 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length i32.const 1 i32.sub local.set $1 loop $repeat|0 - local.get $0 - local.get $1 - i32.lt_s - if + block $break|0 + local.get $0 + local.get $1 + i32.ge_s + br_if $break|0 local.get $0 i32.const 3 i32.shl @@ -14375,7 +14260,7 @@ call $~lib/rt/pure/__release local.get $0 ) - (func $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> (; 281 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayReverse<~lib/typedarray/Float64Array,f64> (; 285 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -14534,7 +14419,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $start:std/typedarray (; 282 ;) (type $FUNCSIG$v) + (func $start:std/typedarray (; 286 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -14563,9 +14448,7 @@ i32.const 3 call $~lib/typedarray/Int32Array#__set local.get $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length i32.const 3 i32.ne if @@ -14577,10 +14460,7 @@ unreachable end local.get $0 - i32.load offset=4 - local.get $0 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset if i32.const 0 i32.const 24 @@ -14647,9 +14527,7 @@ call $~lib/typedarray/Int32Array#subarray call $~lib/rt/pure/__skippedRelease local.tee $0 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length i32.const 1 i32.ne if @@ -14661,10 +14539,7 @@ unreachable end local.get $0 - i32.load offset=4 - local.get $0 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 4 i32.ne if @@ -14743,9 +14618,7 @@ call $~lib/typedarray/Float64Array#subarray call $~lib/rt/pure/__skippedRelease local.tee $0 - i32.load offset=8 - i32.const 3 - i32.shr_u + call $~lib/typedarray/Int64Array#get:length i32.const 4 i32.ne if @@ -14757,10 +14630,7 @@ unreachable end local.get $0 - i32.load offset=4 - local.get $0 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 16 i32.ne if @@ -15061,10 +14931,7 @@ unreachable end local.get $1 - i32.load offset=4 - local.get $1 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.ne if @@ -15294,9 +15161,7 @@ call $~lib/typedarray/Int32Array#fill call $~lib/rt/pure/__release local.get $1 - i32.load offset=8 - i32.const 2 - i32.shr_u + call $~lib/typedarray/Int32Array#get:length i32.const 3 i32.ne if @@ -15308,10 +15173,7 @@ unreachable end local.get $1 - i32.load offset=4 - local.get $1 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 4 i32.ne if @@ -15444,10 +15306,7 @@ unreachable end local.get $1 - i32.load offset=4 - local.get $1 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.ne if @@ -15500,10 +15359,7 @@ unreachable end local.get $2 - i32.load offset=4 - local.get $2 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 2 i32.ne if @@ -15556,10 +15412,7 @@ unreachable end local.get $3 - i32.load offset=4 - local.get $3 - i32.load - i32.sub + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 3 i32.ne if @@ -15683,7 +15536,7 @@ global.get $std/typedarray/testArrayReverseValues call $~lib/rt/pure/__release ) - (func $std/typedarray/main (; 283 ;) (type $FUNCSIG$v) + (func $std/typedarray/main (; 287 ;) (type $FUNCSIG$v) global.get $~lib/started i32.eqz if @@ -15692,7 +15545,7 @@ global.set $~lib/started end ) - (func $~lib/rt/pure/markGray (; 284 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/markGray (; 288 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -15716,7 +15569,7 @@ call $~lib/rt/__visit_members end ) - (func $~lib/rt/pure/scanBlack (; 285 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scanBlack (; 289 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 local.get $0 i32.load offset=4 @@ -15729,7 +15582,7 @@ i32.const 4 call $~lib/rt/__visit_members ) - (func $~lib/rt/pure/scan (; 286 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/scan (; 290 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -15763,7 +15616,7 @@ end end ) - (func $~lib/rt/pure/collectWhite (; 287 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/rt/pure/collectWhite (; 291 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.load offset=4 @@ -15791,7 +15644,7 @@ local.get $0 call $~lib/rt/tlsf/freeBlock ) - (func $~lib/rt/pure/__visit (; 288 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/pure/__visit (; 292 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i32.const 1820 i32.lt_u @@ -15901,7 +15754,7 @@ unreachable end ) - (func $~lib/rt/__visit_members (; 289 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/rt/__visit_members (; 293 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) block $block$4$break block $switch$1$default block $switch$1$case$2 @@ -15924,7 +15777,7 @@ call $~lib/rt/pure/__visit end ) - (func $null (; 290 ;) (type $FUNCSIG$v) + (func $null (; 294 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/switch.optimized.wat b/tests/compiler/switch.optimized.wat index 64f90523..36e820fc 100644 --- a/tests/compiler/switch.optimized.wat +++ b/tests/compiler/switch.optimized.wat @@ -20,10 +20,10 @@ local.get $0 i32.const 2 i32.eq - br_if $case4|0 local.get $0 i32.const 3 i32.eq + i32.or br_if $case4|0 br $case2|0 end @@ -45,10 +45,10 @@ local.get $0 i32.const 2 i32.eq - br_if $case2|0 local.get $0 i32.const 3 i32.eq + i32.or br_if $case2|0 br $break|0 end @@ -60,7 +60,27 @@ end i32.const 0 ) - (func $start:switch (; 3 ;) (type $FUNCSIG$v) + (func $switch/doSwitchBreakCase (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1 + i32.ne + if + i32.const 2 + return + end + i32.const 1 + ) + (func $switch/doSwitchBreakDefault (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1 + i32.eq + if + i32.const 1 + return + end + i32.const 2 + ) + (func $start:switch (; 5 ;) (type $FUNCSIG$v) i32.const 0 call $switch/doSwitch if @@ -229,11 +249,155 @@ call $~lib/builtins/abort unreachable end + i32.const 0 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 51 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakCase + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 52 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 53 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 62 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakDefault + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 63 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 64 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 73 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakCase + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 74 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakCase + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 75 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 84 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + call $switch/doSwitchBreakDefault + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 85 + i32.const 0 + call $~lib/builtins/abort + unreachable + end + i32.const 2 + call $switch/doSwitchBreakDefault + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 86 + i32.const 0 + call $~lib/builtins/abort + unreachable + end ) - (func $start (; 4 ;) (type $FUNCSIG$v) + (func $start (; 6 ;) (type $FUNCSIG$v) call $start:switch ) - (func $null (; 5 ;) (type $FUNCSIG$v) + (func $null (; 7 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/unary.optimized.wat b/tests/compiler/unary.optimized.wat index 1f25f27c..38c2bba4 100644 --- a/tests/compiler/unary.optimized.wat +++ b/tests/compiler/unary.optimized.wat @@ -8,10 +8,10 @@ (export "memory" (memory $0)) (start $start) (func $start:unary (; 0 ;) (type $FUNCSIG$v) - (local $0 f32) - (local $1 f64) - (local $2 i32) - (local $3 i64) + (local $0 i32) + (local $1 i64) + (local $2 f32) + (local $3 f64) global.get $unary/i i32.const 1 i32.add @@ -56,18 +56,18 @@ i32.sub global.set $unary/i global.get $unary/i - local.tee $2 + local.tee $0 i32.const 1 i32.add global.set $unary/i - local.get $2 + local.get $0 global.set $unary/i global.get $unary/i - local.tee $2 + local.tee $0 i32.const 1 i32.sub global.set $unary/i - local.get $2 + local.get $0 global.set $unary/i global.get $unary/I i64.const 1 @@ -114,18 +114,18 @@ i64.sub global.set $unary/I global.get $unary/I - local.tee $3 + local.tee $1 i64.const 1 i64.add global.set $unary/I - local.get $3 + local.get $1 global.set $unary/I global.get $unary/I - local.tee $3 + local.tee $1 i64.const 1 i64.sub global.set $unary/I - local.get $3 + local.get $1 global.set $unary/I global.get $unary/f f32.const 1 @@ -153,11 +153,10 @@ f32.neg global.set $unary/f global.get $unary/f - local.tee $0 f32.const 0 f32.eq global.set $unary/i - local.get $0 + global.get $unary/f f32.const 1 f32.add global.set $unary/f @@ -166,18 +165,18 @@ f32.sub global.set $unary/f global.get $unary/f - local.tee $0 + local.tee $2 f32.const 1 f32.add global.set $unary/f - local.get $0 + local.get $2 global.set $unary/f global.get $unary/f - local.tee $0 + local.tee $2 f32.const 1 f32.sub global.set $unary/f - local.get $0 + local.get $2 global.set $unary/f global.get $unary/F f64.const 1 @@ -205,12 +204,11 @@ f64.neg global.set $unary/F global.get $unary/F - local.tee $1 f64.const 0 f64.eq i64.extend_i32_u global.set $unary/I - local.get $1 + global.get $unary/F f64.const 1 f64.add global.set $unary/F @@ -219,18 +217,18 @@ f64.sub global.set $unary/F global.get $unary/F - local.tee $1 + local.tee $3 f64.const 1 f64.add global.set $unary/F - local.get $1 + local.get $3 global.set $unary/F global.get $unary/F - local.tee $1 + local.tee $3 f64.const 1 f64.sub global.set $unary/F - local.get $1 + local.get $3 global.set $unary/F ) (func $start (; 1 ;) (type $FUNCSIG$v)