Implement itoa32/64 for base 10 (#151)

This commit is contained in:
Max Graey
2018-07-13 16:40:37 +03:00
committed by Daniel Wirtz
parent 5ce57a6434
commit d7c1c608bd
13 changed files with 4369 additions and 829 deletions

View File

@ -132,7 +132,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 12)
(i32.const 255)
(i32.const 265)
(i32.const 4)
)
(unreachable)

View File

@ -213,7 +213,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 12)
(i32.const 255)
(i32.const 265)
(i32.const 4)
)
(unreachable)

View File

@ -5855,7 +5855,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 696)
(i32.const 19)
(i32.const 29)
(i32.const 4)
)
(unreachable)
@ -5903,7 +5903,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 696)
(i32.const 75)
(i32.const 85)
(i32.const 4)
)
(unreachable)

View File

@ -8647,7 +8647,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 696)
(i32.const 19)
(i32.const 29)
(i32.const 4)
)
(unreachable)
@ -8699,7 +8699,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 696)
(i32.const 75)
(i32.const 85)
(i32.const 4)
)
(unreachable)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,9 @@
import "allocator/arena";
import { utoa32, itoa32, utoa64, itoa64 } from "internal/itoa";
// declare function logi(i: i32): void;
// preliminary
var str: string = "hi, I'm a string";
@ -91,3 +95,48 @@ assert("ab".repeat(4) == "abababab");
assert("a".repeat(5) == "aaaaa");
assert("a".repeat(6) == "aaaaaa");
assert("a".repeat(7) == "aaaaaaa");
assert(itoa32(0) == "0");
assert(itoa32(1) == "1");
assert(itoa32(8) == "8");
assert(itoa32(123) == "123");
assert(itoa32(-1000) == "-1000");
assert(itoa32(1234) == "1234");
assert(itoa32(12345) == "12345");
assert(itoa32(123456) == "123456");
assert(itoa32(1111111) == "1111111");
assert(itoa32(1234567) == "1234567");
assert(itoa32(0x7ffffffe) == "2147483646");
assert(itoa32(0x7fffffff) == "2147483647");
assert(itoa32(0x80000000) == "-2147483648");
assert(itoa32(0xffffffff) == "-1");
assert(utoa32(0) == "0");
assert(utoa32(1000) == "1000");
assert(utoa32(0x7fffffff) == "2147483647");
assert(utoa32(0x80000000) == "2147483648");
assert(utoa32(u32.MAX_VALUE) == "4294967295");
assert(utoa64(0) == "0");
assert(utoa64(1234) == "1234");
assert(utoa64(99999999) == "99999999");
assert(utoa64(100000000) == "100000000");
assert(utoa64(0xffffffff) == "4294967295");
assert(utoa64(0xfffffffff) == "68719476735");
assert(utoa64(868719476735) == "868719476735");
assert(utoa64(999868719476735) == "999868719476735");
assert(utoa64(9999868719476735) == "9999868719476735");
assert(utoa64(19999868719476735) == "19999868719476735");
assert(utoa64(u64.MAX_VALUE) == "18446744073709551615");
assert(itoa64(0) == "0");
assert(itoa64(-1234) == "-1234");
assert(itoa64(0xffffffff) == "4294967295");
assert(itoa64(-0xffffffff) == "-4294967295");
assert(itoa64(68719476735) == "68719476735");
assert(itoa64(-68719476735) == "-68719476735");
assert(itoa64(-868719476735) == "-868719476735");
assert(itoa64(-999868719476735) == "-999868719476735");
assert(itoa64(-19999868719476735) == "-19999868719476735");
assert(itoa64(i64.MAX_VALUE) == "9223372036854775807");
assert(itoa64(i64.MIN_VALUE) == "-9223372036854775808");

File diff suppressed because it is too large Load Diff

View File

@ -543,17 +543,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i8,i32>#get:length (; 6 ;) (type $ii) (param $0 i32) (result i32)
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
)
(func $~lib/internal/typedarray/TypedArray<i16,i32>#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i16,i32>#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(if
(i32.gt_u
@ -624,20 +614,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i16,i32>#get:length (; 8 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 1)
)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(if
(i32.gt_u
@ -708,20 +685,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#get:length (; 10 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
(func $~lib/internal/typedarray/TypedArray<i64,i64>#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i64,i64>#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(if
(i32.gt_u
@ -792,20 +756,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i64,i64>#get:length (; 12 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 3)
)
)
(func $std/typedarray/testInstantiate (; 13 ;) (type $iv) (param $0 i32)
(func $std/typedarray/testInstantiate (; 9 ;) (type $iv) (param $0 i32)
(local $1 i32)
(if
(i32.load offset=4
@ -845,8 +796,13 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i8,i32>#get:length
(get_local $1)
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(get_local $0)
)
@ -898,8 +854,13 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i8,i32>#get:length
(get_local $1)
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(get_local $0)
)
@ -951,8 +912,13 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i8,i32>#get:length
(get_local $1)
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(get_local $0)
)
@ -1007,8 +973,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i16,i32>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 1)
)
(get_local $0)
)
@ -1063,8 +1037,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i16,i32>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 1)
)
(get_local $0)
)
@ -1119,8 +1101,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 2)
)
(get_local $0)
)
@ -1175,8 +1165,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 2)
)
(get_local $0)
)
@ -1231,8 +1229,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i64,i64>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 3)
)
(get_local $0)
)
@ -1287,8 +1293,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i64,i64>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 3)
)
(get_local $0)
)
@ -1343,8 +1357,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 2)
)
(get_local $0)
)
@ -1399,8 +1421,16 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i64,i64>#get:length
(get_local $1)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 3)
)
(get_local $0)
)
@ -1415,7 +1445,7 @@
)
)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__set (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__set (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(if
(i32.ge_u
@ -1438,7 +1468,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 48)
(i32.const 49)
(i32.const 42)
)
(unreachable)
@ -1460,7 +1490,7 @@
(get_local $2)
)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__get (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__get (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(if
(i32.ge_u
@ -1483,7 +1513,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 35)
(i32.const 36)
(i32.const 42)
)
(unreachable)
@ -1504,12 +1534,20 @@
)
)
)
(func $~lib/typedarray/Int32Array#subarray (; 16 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/typedarray/Int32Array#subarray (; 12 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_local $0)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
(set_local $1
@ -1607,7 +1645,7 @@
)
(get_local $3)
)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__set (; 17 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__set (; 13 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(if
(i32.ge_u
@ -1627,7 +1665,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 48)
(i32.const 49)
(i32.const 42)
)
(unreachable)
@ -1646,7 +1684,7 @@
(get_local $2)
)
)
(func $~lib/typedarray/Uint8ClampedArray#__set (; 18 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/typedarray/Uint8ClampedArray#__set (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(call $~lib/internal/typedarray/TypedArray<u8,u32>#__set
(get_local $0)
@ -1670,7 +1708,7 @@
)
)
)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__get (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__get (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(if
(i32.ge_u
@ -1690,7 +1728,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 35)
(i32.const 36)
(i32.const 42)
)
(unreachable)
@ -1708,7 +1746,8 @@
)
)
)
(func $start (; 20 ;) (type $v)
(func $start (; 16 ;) (type $v)
(local $0 i32)
(set_global $~lib/allocator/arena/startOffset
(i32.and
(i32.add
@ -1750,8 +1789,18 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_global $std/typedarray/arr)
(i32.shr_s
(i32.sub
(i32.load offset=8
(tee_local $0
(get_global $std/typedarray/arr)
)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
(i32.const 3)
)
@ -1859,8 +1908,18 @@
)
(if
(i32.ne
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_global $std/typedarray/arr)
(i32.shr_s
(i32.sub
(i32.load offset=8
(tee_local $0
(get_global $std/typedarray/arr)
)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
(i32.const 1)
)

View File

@ -613,20 +613,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i8,i32>#get:length (; 6 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 0)
)
)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -705,20 +692,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#get:length (; 8 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 0)
)
)
(func $~lib/internal/typedarray/TypedArray<i16,i32>#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i16,i32>#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -797,20 +771,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i16,i32>#get:length (; 10 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 1)
)
)
(func $~lib/internal/typedarray/TypedArray<u16,u32>#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<u16,u32>#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -889,20 +850,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<u16,u32>#get:length (; 12 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 1)
)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -981,20 +929,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#get:length (; 14 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
(func $~lib/internal/typedarray/TypedArray<u32,u32>#constructor (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<u32,u32>#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1073,20 +1008,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<u32,u32>#get:length (; 16 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
(func $~lib/internal/typedarray/TypedArray<i64,i64>#constructor (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i64,i64>#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1165,20 +1087,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<i64,i64>#get:length (; 18 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 3)
)
)
(func $~lib/internal/typedarray/TypedArray<u64,u64>#constructor (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<u64,u64>#constructor (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1257,20 +1166,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<u64,u64>#get:length (; 20 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 3)
)
)
(func $~lib/internal/typedarray/TypedArray<f32,f32>#constructor (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<f32,f32>#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1349,20 +1245,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<f32,f32>#get:length (; 22 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
(func $~lib/internal/typedarray/TypedArray<f64,f64>#constructor (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<f64,f64>#constructor (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1441,20 +1324,7 @@
)
(get_local $0)
)
(func $~lib/internal/typedarray/TypedArray<f64,f64>#get:length (; 24 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 3)
)
)
(func $std/typedarray/testInstantiate (; 25 ;) (type $iv) (param $0 i32)
(func $std/typedarray/testInstantiate (; 15 ;) (type $iv) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -1516,8 +1386,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<i8,i32>#get:length
(get_local $1)
(block $~lib/internal/typedarray/TypedArray<i8,i32>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $1)
)
(i32.load offset=4
(get_local $1)
)
)
(i32.const 0)
)
)
(get_local $0)
)
@ -1582,8 +1462,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<u8,u32>#get:length
(get_local $2)
(block $~lib/internal/typedarray/TypedArray<u8,u32>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $2)
)
(i32.load offset=4
(get_local $2)
)
)
(i32.const 0)
)
)
(get_local $0)
)
@ -1648,8 +1538,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<u8,u32>#get:length
(get_local $3)
(block $~lib/internal/typedarray/TypedArray<u8,u32>#get:length|inlined.1 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $3)
)
(i32.load offset=4
(get_local $3)
)
)
(i32.const 0)
)
)
(get_local $0)
)
@ -1714,8 +1614,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<i16,i32>#get:length
(get_local $4)
(block $~lib/internal/typedarray/TypedArray<i16,i32>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $4)
)
(i32.load offset=4
(get_local $4)
)
)
(i32.const 1)
)
)
(get_local $0)
)
@ -1780,8 +1690,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<u16,u32>#get:length
(get_local $5)
(block $~lib/internal/typedarray/TypedArray<u16,u32>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $5)
)
(i32.load offset=4
(get_local $5)
)
)
(i32.const 1)
)
)
(get_local $0)
)
@ -1846,8 +1766,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_local $6)
(block $~lib/internal/typedarray/TypedArray<i32,i32>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $6)
)
(i32.load offset=4
(get_local $6)
)
)
(i32.const 2)
)
)
(get_local $0)
)
@ -1912,8 +1842,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<u32,u32>#get:length
(get_local $7)
(block $~lib/internal/typedarray/TypedArray<u32,u32>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $7)
)
(i32.load offset=4
(get_local $7)
)
)
(i32.const 2)
)
)
(get_local $0)
)
@ -1978,8 +1918,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<i64,i64>#get:length
(get_local $8)
(block $~lib/internal/typedarray/TypedArray<i64,i64>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $8)
)
(i32.load offset=4
(get_local $8)
)
)
(i32.const 3)
)
)
(get_local $0)
)
@ -2044,8 +1994,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<u64,u64>#get:length
(get_local $9)
(block $~lib/internal/typedarray/TypedArray<u64,u64>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $9)
)
(i32.load offset=4
(get_local $9)
)
)
(i32.const 3)
)
)
(get_local $0)
)
@ -2110,8 +2070,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<f32,f32>#get:length
(get_local $10)
(block $~lib/internal/typedarray/TypedArray<f32,f32>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $10)
)
(i32.load offset=4
(get_local $10)
)
)
(i32.const 2)
)
)
(get_local $0)
)
@ -2176,8 +2146,18 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<f64,f64>#get:length
(get_local $11)
(block $~lib/internal/typedarray/TypedArray<f64,f64>#get:length|inlined.0 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $11)
)
(i32.load offset=4
(get_local $11)
)
)
(i32.const 3)
)
)
(get_local $0)
)
@ -2193,7 +2173,7 @@
)
)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__set (; 26 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__set (; 16 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -2222,7 +2202,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 48)
(i32.const 49)
(i32.const 42)
)
(unreachable)
@ -2249,7 +2229,7 @@
)
)
)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__get (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<i32,i32>#__get (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -2278,7 +2258,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 35)
(i32.const 36)
(i32.const 42)
)
(unreachable)
@ -2304,14 +2284,24 @@
)
)
)
(func $~lib/typedarray/Int32Array#subarray (; 28 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/typedarray/Int32Array#subarray (; 18 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(block $~lib/internal/typedarray/TypedArray<i32,i32>#subarray|inlined.0 (result i32)
(set_local $3
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_local $0)
(block $~lib/internal/typedarray/TypedArray<i32,i32>#get:length|inlined.2 (result i32)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
)
(if
@ -2427,7 +2417,7 @@
(get_local $4)
)
)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__set (; 29 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__set (; 19 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -2456,7 +2446,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 48)
(i32.const 49)
(i32.const 42)
)
(unreachable)
@ -2483,7 +2473,7 @@
)
)
)
(func $~lib/typedarray/Uint8ClampedArray#__set (; 30 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/typedarray/Uint8ClampedArray#__set (; 20 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(call $~lib/internal/typedarray/TypedArray<u8,u32>#__set
@ -2514,7 +2504,7 @@
)
)
)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__get (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/internal/typedarray/TypedArray<u8,u32>#__get (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -2543,7 +2533,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 48)
(i32.const 35)
(i32.const 36)
(i32.const 42)
)
(unreachable)
@ -2569,7 +2559,8 @@
)
)
)
(func $start (; 32 ;) (type $v)
(func $start (; 22 ;) (type $v)
(local $0 i32)
(if
(i32.eqz
(i32.eq
@ -2802,8 +2793,21 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_global $std/typedarray/arr)
(block $~lib/internal/typedarray/TypedArray<i32,i32>#get:length|inlined.1 (result i32)
(set_local $0
(get_global $std/typedarray/arr)
)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
(i32.const 3)
)
@ -2929,8 +2933,21 @@
(if
(i32.eqz
(i32.eq
(call $~lib/internal/typedarray/TypedArray<i32,i32>#get:length
(get_global $std/typedarray/arr)
(block $~lib/internal/typedarray/TypedArray<i32,i32>#get:length|inlined.3 (result i32)
(set_local $0
(get_global $std/typedarray/arr)
)
(i32.shr_s
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.load offset=4
(get_local $0)
)
)
(i32.const 2)
)
)
(i32.const 1)
)