diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index ba83b860..7c22e8a9 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1136,7 +1136,9 @@ declare abstract class TypedArray implements ArrayBufferView { /** The findIndex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned. See also the find() [not implemented] method, which returns the value of a found element in the typed array instead of its index. */ findIndex(callbackfn: (value: T, index: i32, self: this) => bool): i32; /** The every() method tests whether all elements in the typed array pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.every(). */ - every(callbackfn: (value: T, index: i32, self: this) => bool): i32; + every(callbackfn: (value: T, index: i32, self: this) => bool): bool; + /** The forEach() method executes a provided function once per array element. This method has the same algorithm as Array.prototype.forEach().*/ + forEach(callbackfn: (value: T, index: i32, self: this) => void): void; } /** An array of twos-complement 8-bit signed integers. */ diff --git a/std/assembly/internal/typedarray.ts b/std/assembly/internal/typedarray.ts index a3f3f185..69d4d5b1 100644 --- a/std/assembly/internal/typedarray.ts +++ b/std/assembly/internal/typedarray.ts @@ -231,3 +231,16 @@ export function EVERY, T>( } return true; } + +@inline +export function FOREACH, T>( + array: TArray, + callbackfn: (value: T, index: i32, array: TArray) => void, +): void { + var length = array.length; + var buffer = array.buffer; + var byteOffset = array.byteOffset; + for (let i = 0; i < length; i++) { + callbackfn(LOAD(buffer, i, byteOffset), i, array); + } +} diff --git a/std/assembly/typedarray.ts b/std/assembly/typedarray.ts index 04ef041e..a894b66b 100644 --- a/std/assembly/typedarray.ts +++ b/std/assembly/typedarray.ts @@ -9,6 +9,7 @@ import { FIND_INDEX, SOME, EVERY, + FOREACH, } from "./internal/typedarray"; import { @@ -63,6 +64,10 @@ export class Int8Array extends TypedArray { every(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: i8, index: i32, self: Int8Array) => void): void { + FOREACH(this, callbackfn); + } } export class Uint8Array extends TypedArray { @@ -109,6 +114,10 @@ export class Uint8Array extends TypedArray { every(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: u8, index: i32, self: Uint8Array) => void): void { + FOREACH(this, callbackfn); + } } export class Uint8ClampedArray extends Uint8Array { @@ -165,6 +174,10 @@ export class Uint8ClampedArray extends Uint8Array { every(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => void): void { + FOREACH(this, callbackfn); + } } export class Int16Array extends TypedArray { @@ -211,6 +224,10 @@ export class Int16Array extends TypedArray { every(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: i16, index: i32, self: Int16Array) => void): void { + FOREACH(this, callbackfn); + } } export class Uint16Array extends TypedArray { @@ -257,6 +274,10 @@ export class Uint16Array extends TypedArray { every(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: u16, index: i32, self: Uint16Array) => void): void { + FOREACH(this, callbackfn); + } } export class Int32Array extends TypedArray { @@ -303,6 +324,10 @@ export class Int32Array extends TypedArray { every(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: i32, index: i32, self: Int32Array) => void): void { + FOREACH(this, callbackfn); + } } export class Uint32Array extends TypedArray { @@ -349,6 +374,10 @@ export class Uint32Array extends TypedArray { every(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: u32, index: i32, self: Uint32Array) => void): void { + FOREACH(this, callbackfn); + } } export class Int64Array extends TypedArray { @@ -395,6 +424,10 @@ export class Int64Array extends TypedArray { every(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: i64, index: i32, self: Int64Array) => void): void { + FOREACH(this, callbackfn); + } } export class Uint64Array extends TypedArray { @@ -441,6 +474,10 @@ export class Uint64Array extends TypedArray { every(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: u64, index: i32, self: Uint64Array) => void): void { + FOREACH(this, callbackfn); + } } export class Float32Array extends TypedArray { @@ -487,6 +524,10 @@ export class Float32Array extends TypedArray { every(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: f32, index: i32, self: Float32Array) => void): void { + FOREACH(this, callbackfn); + } } export class Float64Array extends TypedArray { @@ -533,4 +574,8 @@ export class Float64Array extends TypedArray { every(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): bool { return EVERY(this, callbackfn); } + + forEach(callbackfn: (value: f64, index: i32, self: Float64Array) => void): void { + FOREACH(this, callbackfn); + } } diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 014095ac..863b767d 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -24,6 +24,9 @@ (type $FUNCSIG$ifii (func (param f32 i32 i32) (result i32))) (type $FUNCSIG$idii (func (param f64 i32 i32) (result i32))) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$vjii (func (param i64 i32 i32))) + (type $FUNCSIG$vfii (func (param f32 i32 i32))) + (type $FUNCSIG$vdii (func (param f64 i32 i32))) (type $FUNCSIG$fi (func (param i32) (result f32))) (type $FUNCSIG$di (func (param i32) (result f64))) (type $FUNCSIG$ff (func (param f32) (result f32))) @@ -62,8 +65,14 @@ (data (i32.const 584) "\14\00\00\00\00\00\00\00\01") (data (i32.const 608) "\02") (data (i32.const 616) "H\02\00\00\05") - (table $0 101 funcref) - (elem (i32.const 0) $null $~lib/internal/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0) + (data (i32.const 624) "\0c\00\00\00\00\00\00\00\n\00\00\00\0c\00\00\00\0e") + (data (i32.const 656) "p\02\00\00\03") + (data (i32.const 664) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 712) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00i\00n\00d\00e\00x\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 760) "\1f\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00s\00e\00l\00f\00 \00p\00a\00r\00a\00m\00e\00t\00e\00r\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 832) "\1b\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00c\00a\00l\00l\00 \00c\00o\00u\00n\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (table $0 112 funcref) + (elem (i32.const 0) $null $~lib/internal/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $std/typedarray/arr (mut i32) (i32.const 0)) @@ -78,6 +87,9 @@ (global $std/typedarray/multisubarr1 (mut i32) (i32.const 0)) (global $std/typedarray/multisubarr2 (mut i32) (i32.const 0)) (global $std/typedarray/multisubarr3 (mut i32) (i32.const 0)) + (global $std/typedarray/forEachCallCount (mut i32) (i32.const 0)) + (global $std/typedarray/forEachSelf (mut i32) (i32.const 0)) + (global $std/typedarray/forEachValues (mut i32) (i32.const 656)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) @@ -8108,10 +8120,1620 @@ unreachable end ) - (func $start:std/typedarray (; 193 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 193 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + i32.const 255 + i32.and + local.get $1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + i32.ne + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + local.get $1 + i32.ne + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.ne + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int8Array#forEach (; 194 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=8 + local.set $2 + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + loop $repeat|0 + local.get $1 + local.get $2 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $1 + local.get $3 + i32.add + local.get $4 + i32.add + i32.load8_s offset=8 + local.get $1 + local.get $0 + i32.const 101 + call_indirect (type $FUNCSIG$viii) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 195 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 624 + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + call $~lib/typedarray/Int8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint8Array#forEach (; 196 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load offset=8 + local.set $3 + local.get $0 + i32.load + local.set $4 + local.get $0 + i32.load offset=4 + local.set $5 + loop $repeat|0 + block $break|0 + local.get $2 + local.get $3 + i32.ge_s + br_if $break|0 + i32.const 3 + global.set $~lib/argc + local.get $2 + local.get $4 + i32.add + local.get $5 + i32.add + i32.load8_u offset=8 + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$viii) + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 197 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 102 + call $~lib/typedarray/Uint8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 198 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $1 + i32.const 103 + call $~lib/typedarray/Uint8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 199 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + i32.const 65535 + i32.and + local.get $1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $0 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + i32.ne + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + local.get $1 + i32.ne + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.ne + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int16Array#forEach (; 200 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $2 + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + loop $repeat|0 + local.get $1 + local.get $2 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $1 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load16_s offset=8 + local.get $1 + local.get $0 + i32.const 104 + call_indirect (type $FUNCSIG$viii) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 201 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + call $~lib/typedarray/Int16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint16Array#forEach (; 202 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.set $2 + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + loop $repeat|0 + local.get $1 + local.get $2 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $1 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load16_u offset=8 + local.get $1 + local.get $0 + i32.const 105 + call_indirect (type $FUNCSIG$viii) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 203 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + call $~lib/typedarray/Uint16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 204 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $3 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + i32.load offset=8 + else + unreachable + end + local.get $0 + i32.ne + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + local.get $1 + i32.ne + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.ne + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int32Array#forEach (; 205 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $3 + local.get $0 + i32.load + local.set $4 + local.get $0 + i32.load offset=4 + local.set $5 + loop $repeat|0 + block $break|0 + local.get $2 + local.get $3 + i32.ge_s + br_if $break|0 + i32.const 3 + global.set $~lib/argc + local.get $2 + i32.const 2 + i32.shl + local.get $4 + i32.add + local.get $5 + i32.add + i32.load offset=8 + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$viii) + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 206 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 106 + call $~lib/typedarray/Int32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 207 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 107 + call $~lib/typedarray/Int32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 208 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $3 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + local.get $0 + i64.ne + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + local.get $1 + i32.ne + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.ne + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int64Array#forEach (; 209 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $3 + local.get $0 + i32.load + local.set $4 + local.get $0 + i32.load offset=4 + local.set $5 + loop $repeat|0 + block $break|0 + local.get $2 + local.get $3 + i32.ge_s + br_if $break|0 + i32.const 3 + global.set $~lib/argc + local.get $2 + i32.const 3 + i32.shl + local.get $4 + i32.add + local.get $5 + i32.add + i64.load offset=8 + local.get $2 + local.get $0 + local.get $1 + call_indirect (type $FUNCSIG$vjii) + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 210 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 108 + call $~lib/typedarray/Int64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 211 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 109 + call $~lib/typedarray/Int64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 212 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $3 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + i32.load offset=8 + else + unreachable + end + f32.convert_i32_s + f32.ne + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + local.get $1 + i32.ne + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.ne + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Float32Array#forEach (; 213 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + local.set $2 + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + loop $repeat|0 + local.get $1 + local.get $2 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + f32.load offset=8 + local.get $1 + local.get $0 + i32.const 110 + call_indirect (type $FUNCSIG$vfii) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 214 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + call $~lib/typedarray/Float32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 215 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $0 + local.get $1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $3 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + i32.load offset=8 + else + unreachable + end + f64.convert_i32_s + f64.ne + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + local.get $1 + i32.ne + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.ne + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Float64Array#forEach (; 216 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + local.set $2 + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + loop $repeat|0 + local.get $1 + local.get $2 + i32.lt_s + if + i32.const 3 + global.set $~lib/argc + local.get $1 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + f64.load offset=8 + local.get $1 + local.get $0 + i32.const 111 + call_indirect (type $FUNCSIG$vdii) + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end + end + ) + (func $std/typedarray/testArrayForEach (; 217 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.tee $1 + global.set $std/typedarray/forEachSelf + local.get $1 + i32.const 0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.load offset=8 + else + unreachable + end + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 1 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 4 + i32.add + i32.load offset=8 + else + unreachable + end + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + i32.const 2 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.load + local.tee $0 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 8 + i32.add + i32.load offset=8 + else + unreachable + end + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $1 + call $~lib/typedarray/Float64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.ne + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $start:std/typedarray (; 218 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 896 global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset @@ -9087,11 +10709,22 @@ call $std/typedarray/testArrayEvery call $std/typedarray/testArrayEvery call $std/typedarray/testArrayEvery + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach ) - (func $start (; 194 ;) (type $FUNCSIG$v) + (func $start (; 219 ;) (type $FUNCSIG$v) call $start:std/typedarray ) - (func $null (; 195 ;) (type $FUNCSIG$v) + (func $null (; 220 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/typedarray.ts b/tests/compiler/std/typedarray.ts index 4d1311a2..f2f43ce6 100644 --- a/tests/compiler/std/typedarray.ts +++ b/tests/compiler/std/typedarray.ts @@ -409,3 +409,35 @@ testArrayEvery(); testArrayEvery(); testArrayEvery(); testArrayEvery(); + +var forEachCallCount: i32 = 0; +var forEachSelf: usize; +var forEachValues: i32[] = [10, 12, 14]; +function testArrayForEach, T extends number>(): void { + forEachCallCount = 0; + var array = instantiate(3); + forEachSelf = changetype(array); + array[0] = forEachValues[0]; + array[1] = forEachValues[1]; + array[2] = forEachValues[2]; + array.forEach((value: T, index: i32, self: TArray): void => { + var matchedValue = forEachValues[index]; + assert(value == matchedValue, "forEach value mismatch"); + assert(index == forEachCallCount, "forEach index mismatch"); + assert(forEachSelf == changetype(self), "forEach self parameter mismatch"); + forEachCallCount++; + }); + assert(forEachCallCount == 3, "forEach call count mismatch"); +} + +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); +testArrayForEach(); diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index b0739316..cbef649d 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -28,6 +28,10 @@ (type $FUNCSIG$idii (func (param f64 i32 i32) (result i32))) (type $FUNCSIG$fff (func (param f32 f32) (result f32))) (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$vjii (func (param i64 i32 i32))) + (type $FUNCSIG$vfii (func (param f32 i32 i32))) + (type $FUNCSIG$vdii (func (param f64 i32 i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") @@ -61,8 +65,14 @@ (data (i32.const 576) " \02\00\00\03\00\00\00") (data (i32.const 584) "\14\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00") (data (i32.const 616) "H\02\00\00\05\00\00\00") - (table $0 101 funcref) - (elem (i32.const 0) $null $~lib/internal/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1) + (data (i32.const 624) "\0c\00\00\00\00\00\00\00\n\00\00\00\0c\00\00\00\0e\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 656) "p\02\00\00\03\00\00\00") + (data (i32.const 664) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 712) "\16\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00i\00n\00d\00e\00x\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 760) "\1f\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00s\00e\00l\00f\00 \00p\00a\00r\00a\00m\00e\00t\00e\00r\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 832) "\1b\00\00\00f\00o\00r\00E\00a\00c\00h\00 \00c\00a\00l\00l\00 \00c\00o\00u\00n\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (table $0 112 funcref) + (elem (i32.const 0) $null $~lib/internal/sort/COMPARATOR~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduce~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testReduceRight~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArrayMap~anonymous|0 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArraySome~anonymous|0 $std/typedarray/testArraySome~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayFindIndex~anonymous|0 $std/typedarray/testArrayFindIndex~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayEvery~anonymous|0 $std/typedarray/testArrayEvery~anonymous|1 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0 $std/typedarray/testArrayForEach~anonymous|0) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT i32 (i32.const 1)) @@ -90,7 +100,10 @@ (global $std/typedarray/multisubarr1 (mut i32) (i32.const 0)) (global $std/typedarray/multisubarr2 (mut i32) (i32.const 0)) (global $std/typedarray/multisubarr3 (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 624)) + (global $std/typedarray/forEachCallCount (mut i32) (i32.const 0)) + (global $std/typedarray/forEachSelf (mut i32) (i32.const 0)) + (global $std/typedarray/forEachValues (mut i32) (i32.const 656)) + (global $~lib/memory/HEAP_BASE i32 (i32.const 892)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) @@ -14474,7 +14487,1886 @@ unreachable end ) - (func $start:std/typedarray (; 301 ;) (type $FUNCSIG$v) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 301 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.get $3 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int8Array#forEach (; 302 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.16 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 0 + i32.shl + i32.add + local.get $10 + i32.add + i32.load8_s offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$viii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 303 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int8Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 101 + call $~lib/typedarray/Int8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 304 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + i32.const 255 + i32.and + local.get $3 + i32.const 255 + i32.and + i32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Uint8Array#forEach (; 305 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.14 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.19 (result i32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 0 + i32.shl + i32.add + local.get $10 + i32.add + i32.load8_u offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$viii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 306 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint8Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 102 + call $~lib/typedarray/Uint8Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 307 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + i32.const 255 + i32.and + local.get $3 + i32.const 255 + i32.and + i32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Uint8ClampedArray#forEach (; 308 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.15 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.20 (result i32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 0 + i32.shl + i32.add + local.get $10 + i32.add + i32.load8_u offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$viii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 309 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 103 + call $~lib/typedarray/Uint8ClampedArray#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 310 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + local.get $3 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int16Array#forEach (; 311 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 1 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $10 + i32.add + i32.load16_s offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$viii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 312 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int16Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 104 + call $~lib/typedarray/Int16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 313 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + i32.const 65535 + i32.and + local.get $3 + i32.const 65535 + i32.and + i32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Uint16Array#forEach (; 314 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 1 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 1 + i32.shl + i32.add + local.get $10 + i32.add + i32.load16_u offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$viii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 315 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint16Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 105 + call $~lib/typedarray/Uint16Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 316 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int32Array#forEach (; 317 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.15 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.add + i32.load offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$viii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 318 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int32Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 106 + call $~lib/typedarray/Int32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 319 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Uint32Array#forEach (; 320 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.add + i32.load offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$viii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 321 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint32Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 107 + call $~lib/typedarray/Uint32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 322 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i64.extend_i32_s + i64.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Int64Array#forEach (; 323 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i64) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 3 + i32.shl + i32.add + local.get $10 + i32.add + i64.load offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$vjii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 324 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Int64Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 108 + call $~lib/typedarray/Int64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 325 ;) (type $FUNCSIG$vjii) (param $0 i64) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + i64.extend_i32_s + i64.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Uint64Array#forEach (; 326 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i64) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 3 + i32.shl + i32.add + local.get $10 + i32.add + i64.load offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$vjii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 327 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Uint64Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 109 + call $~lib/typedarray/Uint64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 328 ;) (type $FUNCSIG$vfii) (param $0 f32) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + f32.convert_i32_s + f32.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Float32Array#forEach (; 329 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f32) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.add + f32.load offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$vfii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 330 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Float32Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 110 + call $~lib/typedarray/Float32Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayForEach~anonymous|0 (; 331 ;) (type $FUNCSIG$vdii) (param $0 f64) (param $1 i32) (param $2 i32) + (local $3 i32) + global.get $std/typedarray/forEachValues + local.get $1 + call $~lib/array/Array#__get + local.set $3 + local.get $0 + local.get $3 + f64.convert_i32_s + f64.eq + i32.eqz + if + i32.const 664 + i32.const 8 + i32.const 425 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $1 + global.get $std/typedarray/forEachCallCount + i32.eq + i32.eqz + if + i32.const 712 + i32.const 8 + i32.const 426 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachSelf + local.get $2 + i32.eq + i32.eqz + if + i32.const 760 + i32.const 8 + i32.const 427 + i32.const 4 + call $~lib/env/abort + unreachable + end + global.get $std/typedarray/forEachCallCount + i32.const 1 + i32.add + global.set $std/typedarray/forEachCallCount + ) + (func $~lib/typedarray/Float64Array#forEach (; 332 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) + local.get $2 + local.set $4 + local.get $4 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + local.set $4 + local.get $2 + i32.load + local.set $5 + local.get $2 + i32.load offset=4 + local.set $6 + block $break|0 + i32.const 0 + local.set $7 + loop $repeat|0 + local.get $7 + local.get $4 + i32.lt_s + i32.eqz + br_if $break|0 + block + i32.const 3 + global.set $~lib/argc + block $~lib/internal/arraybuffer/LOAD|inlined.22 (result f64) + local.get $5 + local.set $8 + local.get $7 + local.set $9 + local.get $6 + local.set $10 + local.get $8 + local.get $9 + i32.const 3 + i32.shl + i32.add + local.get $10 + i32.add + f64.load offset=8 + end + local.get $7 + local.get $2 + local.get $3 + call_indirect (type $FUNCSIG$vdii) + end + local.get $7 + i32.const 1 + i32.add + local.set $7 + br $repeat|0 + unreachable + end + unreachable + end + ) + (func $std/typedarray/testArrayForEach (; 333 ;) (type $FUNCSIG$v) + (local $0 i32) + i32.const 0 + global.set $std/typedarray/forEachCallCount + i32.const 0 + i32.const 3 + call $~lib/typedarray/Float64Array#constructor + local.set $0 + local.get $0 + global.set $std/typedarray/forEachSelf + local.get $0 + i32.const 0 + global.get $std/typedarray/forEachValues + i32.const 0 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + global.get $std/typedarray/forEachValues + i32.const 1 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 2 + global.get $std/typedarray/forEachValues + i32.const 2 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 111 + call $~lib/typedarray/Float64Array#forEach + global.get $std/typedarray/forEachCallCount + i32.const 3 + i32.eq + i32.eqz + if + i32.const 832 + i32.const 8 + i32.const 430 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $start:std/typedarray (; 334 ;) (type $FUNCSIG$v) (local $0 i32) global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32.const 1 @@ -15710,10 +17602,21 @@ call $std/typedarray/testArrayEvery call $std/typedarray/testArrayEvery call $std/typedarray/testArrayEvery + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayForEach ) - (func $start (; 302 ;) (type $FUNCSIG$v) + (func $start (; 335 ;) (type $FUNCSIG$v) call $start:std/typedarray ) - (func $null (; 303 ;) (type $FUNCSIG$v) + (func $null (; 336 ;) (type $FUNCSIG$v) ) )