From d4114150601d4a4074f63ca75cda692c2045f591 Mon Sep 17 00:00:00 2001 From: jtenner Date: Fri, 8 Mar 2019 12:48:06 -0500 Subject: [PATCH] Implement TypedArray#reverse (#532) --- std/assembly/index.d.ts | 2 + std/assembly/internal/typedarray.ts | 13 + std/assembly/typedarray.ts | 45 + tests/compiler/std/typedarray.optimized.wat | 2684 +++++++++++- tests/compiler/std/typedarray.ts | 43 +- tests/compiler/std/typedarray.untouched.wat | 4293 ++++++++++++++++++- 6 files changed, 6862 insertions(+), 218 deletions(-) diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index d103983f..fb9ffa4e 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1139,6 +1139,8 @@ declare abstract class TypedArray implements ArrayBufferView { 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; + /** The reverse() method reverses a typed array in place. The first typed array element becomes the last and the last becomes the first. This method has the same algorithm as Array.prototype.reverse(). */ + reverse(): this; } /** An array of twos-complement 8-bit signed integers. */ diff --git a/std/assembly/internal/typedarray.ts b/std/assembly/internal/typedarray.ts index 69d4d5b1..0fb265ae 100644 --- a/std/assembly/internal/typedarray.ts +++ b/std/assembly/internal/typedarray.ts @@ -244,3 +244,16 @@ export function FOREACH, T>( callbackfn(LOAD(buffer, i, byteOffset), i, array); } } + +@inline +export function REVERSE, T>(array: TArray): TArray { + var buffer = array.buffer; + var byteOffset = array.byteOffset; + + for (let front = 0, back = array.length - 1; front < back; ++front, --back) { + let temp = LOAD(buffer, front, byteOffset); + STORE(buffer, front, LOAD(buffer, back, byteOffset), byteOffset); + STORE(buffer, back, temp, byteOffset); + } + return array; +} diff --git a/std/assembly/typedarray.ts b/std/assembly/typedarray.ts index a894b66b..216a5a14 100644 --- a/std/assembly/typedarray.ts +++ b/std/assembly/typedarray.ts @@ -10,6 +10,7 @@ import { SOME, EVERY, FOREACH, + REVERSE, } from "./internal/typedarray"; import { @@ -68,6 +69,10 @@ export class Int8Array extends TypedArray { forEach(callbackfn: (value: i8, index: i32, self: Int8Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Uint8Array extends TypedArray { @@ -118,6 +123,10 @@ export class Uint8Array extends TypedArray { forEach(callbackfn: (value: u8, index: i32, self: Uint8Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Uint8ClampedArray extends Uint8Array { @@ -178,6 +187,10 @@ export class Uint8ClampedArray extends Uint8Array { forEach(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Int16Array extends TypedArray { @@ -228,6 +241,10 @@ export class Int16Array extends TypedArray { forEach(callbackfn: (value: i16, index: i32, self: Int16Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Uint16Array extends TypedArray { @@ -278,6 +295,10 @@ export class Uint16Array extends TypedArray { forEach(callbackfn: (value: u16, index: i32, self: Uint16Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Int32Array extends TypedArray { @@ -328,6 +349,10 @@ export class Int32Array extends TypedArray { forEach(callbackfn: (value: i32, index: i32, self: Int32Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Uint32Array extends TypedArray { @@ -378,6 +403,10 @@ export class Uint32Array extends TypedArray { forEach(callbackfn: (value: u32, index: i32, self: Uint32Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Int64Array extends TypedArray { @@ -428,6 +457,10 @@ export class Int64Array extends TypedArray { forEach(callbackfn: (value: i64, index: i32, self: Int64Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Uint64Array extends TypedArray { @@ -478,6 +511,10 @@ export class Uint64Array extends TypedArray { forEach(callbackfn: (value: u64, index: i32, self: Uint64Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Float32Array extends TypedArray { @@ -528,6 +565,10 @@ export class Float32Array extends TypedArray { forEach(callbackfn: (value: f32, index: i32, self: Float32Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } export class Float64Array extends TypedArray { @@ -578,4 +619,8 @@ export class Float64Array extends TypedArray { forEach(callbackfn: (value: f64, index: i32, self: Float64Array) => void): void { FOREACH(this, callbackfn); } + + reverse(): this { + return REVERSE(this); + } } diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 47c544fd..2aa793c4 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -65,12 +65,18 @@ (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") - (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") + (data (i32.const 624) "\0f\00\00\00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 664) "\14\00\00\00f\00a\00i\00l\00 \00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 712) "\0c\00\00\00\00\00\00\00\n\00\00\00\0c\00\00\00\0e") + (data (i32.const 744) "\c8\02\00\00\03") + (data (i32.const 752) "\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 800) "\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 848) "\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 920) "\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") + (data (i32.const 984) "$\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00\07\00\00\00\08\00\00\00\t") + (data (i32.const 1048) "\d8\03\00\00\t") + (data (i32.const 1056) "!\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h") + (data (i32.const 1128) "+\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\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)) @@ -89,7 +95,8 @@ (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)) + (global $std/typedarray/forEachValues (mut i32) (i32.const 744)) + (global $std/typedarray/testArrayReverseValues (mut i32) (i32.const 1048)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) @@ -1140,70 +1147,86 @@ i32.add i32.load offset=8 ) - (func $~lib/typedarray/Int32Array#subarray (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/typedarray/Int32Array#subarray (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - i32.const 1 + (local $4 i32) local.get $0 i32.load offset=8 i32.const 2 i32.shr_u - local.tee $2 - i32.const 1 - local.get $2 - i32.lt_s - select - local.set $3 + local.set $4 local.get $1 i32.const 0 i32.lt_s if (result i32) local.get $1 - local.get $2 + local.get $4 i32.add - local.tee $2 - local.get $3 - local.get $2 + local.tee $3 + i32.const 0 local.get $3 + i32.const 0 i32.gt_s select else local.get $1 - local.get $2 + local.get $4 local.get $1 - local.get $2 + local.get $4 i32.lt_s select - local.tee $2 - local.get $3 - local.get $2 - local.get $3 - i32.gt_s - select end local.set $1 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $2 + local.get $4 + i32.add + local.tee $3 + local.get $1 + local.get $3 + local.get $1 + i32.gt_s + select + else + local.get $2 + local.get $4 + local.get $2 + local.get $4 + i32.lt_s + select + local.tee $3 + local.get $1 + local.get $3 + local.get $1 + i32.gt_s + select + end + local.set $2 i32.const 12 call $~lib/allocator/arena/__memory_allocate - local.tee $2 + local.tee $3 local.get $0 i32.load i32.store - local.get $2 + local.get $3 local.get $0 i32.load offset=4 - local.get $3 + local.get $1 i32.const 2 i32.shl i32.add i32.store offset=4 + local.get $3 local.get $2 local.get $1 - local.get $3 i32.sub i32.const 2 i32.shl i32.store offset=8 - local.get $2 + local.get $3 ) (func $~lib/internal/typedarray/TypedArray#__set (; 17 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) local.get $1 @@ -1232,56 +1255,86 @@ local.get $2 f64.store offset=8 ) - (func $~lib/typedarray/Float64Array#subarray (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) + (func $~lib/typedarray/Float64Array#subarray (; 18 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - i32.const 2 + (local $4 i32) local.get $0 i32.load offset=8 i32.const 3 i32.shr_u - local.tee $1 - i32.const 2 + local.set $4 local.get $1 + i32.const 0 i32.lt_s - select - local.set $3 - i32.const 6 - local.get $1 - i32.const 6 - local.get $1 - i32.lt_s - select - local.tee $2 - local.get $3 - local.get $2 - local.get $3 - i32.gt_s - select + if (result i32) + local.get $1 + local.get $4 + i32.add + local.tee $3 + i32.const 0 + local.get $3 + i32.const 0 + i32.gt_s + select + else + local.get $1 + local.get $4 + local.get $1 + local.get $4 + i32.lt_s + select + end local.set $1 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $2 + local.get $4 + i32.add + local.tee $3 + local.get $1 + local.get $3 + local.get $1 + i32.gt_s + select + else + local.get $2 + local.get $4 + local.get $2 + local.get $4 + i32.lt_s + select + local.tee $3 + local.get $1 + local.get $3 + local.get $1 + i32.gt_s + select + end + local.set $2 i32.const 12 call $~lib/allocator/arena/__memory_allocate - local.tee $2 + local.tee $3 local.get $0 i32.load i32.store - local.get $2 + local.get $3 local.get $0 i32.load offset=4 - local.get $3 + local.get $1 i32.const 3 i32.shl i32.add i32.store offset=4 + local.get $3 local.get $2 local.get $1 - local.get $3 i32.sub i32.const 3 i32.shl i32.store offset=8 - local.get $2 + local.get $3 ) (func $~lib/internal/sort/insertionSort (; 19 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) @@ -2041,64 +2094,80 @@ local.get $3 call $~lib/typedarray/Int8Array#fill ) - (func $~lib/typedarray/Int8Array#subarray (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/typedarray/Int8Array#subarray (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) - i32.const 1 + (local $4 i32) local.get $0 i32.load offset=8 - local.tee $2 - i32.const 1 - local.get $2 - i32.lt_s - select - local.set $3 + local.set $4 local.get $1 i32.const 0 i32.lt_s if (result i32) local.get $1 - local.get $2 + local.get $4 i32.add - local.tee $2 - local.get $3 - local.get $2 + local.tee $3 + i32.const 0 local.get $3 + i32.const 0 i32.gt_s select else local.get $1 - local.get $2 + local.get $4 local.get $1 - local.get $2 + local.get $4 i32.lt_s select - local.tee $2 - local.get $3 - local.get $2 - local.get $3 - i32.gt_s - select end local.set $1 + local.get $2 + i32.const 0 + i32.lt_s + if (result i32) + local.get $2 + local.get $4 + i32.add + local.tee $3 + local.get $1 + local.get $3 + local.get $1 + i32.gt_s + select + else + local.get $2 + local.get $4 + local.get $2 + local.get $4 + i32.lt_s + select + local.tee $3 + local.get $1 + local.get $3 + local.get $1 + i32.gt_s + select + end + local.set $2 i32.const 12 call $~lib/allocator/arena/__memory_allocate - local.tee $2 + local.tee $3 local.get $0 i32.load i32.store - local.get $2 + local.get $3 + local.get $1 local.get $0 i32.load offset=4 - local.get $3 i32.add i32.store offset=4 + local.get $3 local.get $2 local.get $1 - local.get $3 i32.sub i32.store offset=8 - local.get $2 + local.get $3 ) (func $~lib/typedarray/Int32Array#fill (; 32 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) @@ -6057,7 +6126,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6070,7 +6139,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6150,7 +6219,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6163,7 +6232,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6193,7 +6262,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6206,7 +6275,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6296,7 +6365,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6309,7 +6378,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6392,7 +6461,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6405,7 +6474,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6493,7 +6562,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6506,7 +6575,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6536,7 +6605,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6549,7 +6618,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6637,7 +6706,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6650,7 +6719,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6680,7 +6749,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6693,7 +6762,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6781,7 +6850,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6794,7 +6863,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -6882,7 +6951,7 @@ i32.const 1 i32.ne if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -6895,7 +6964,7 @@ i32.const -1 i32.ne if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -8147,7 +8216,7 @@ i32.and i32.ne if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -8158,7 +8227,7 @@ local.get $1 i32.ne if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -8169,7 +8238,7 @@ local.get $2 i32.ne if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -8303,7 +8372,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -8429,7 +8498,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -8514,7 +8583,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -8548,7 +8617,7 @@ i32.and i32.ne if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -8559,7 +8628,7 @@ local.get $1 i32.ne if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -8570,7 +8639,7 @@ local.get $2 i32.ne if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -8707,7 +8776,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -8834,7 +8903,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -8864,7 +8933,7 @@ end i32.ne if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -8875,7 +8944,7 @@ local.get $1 i32.ne if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -8886,7 +8955,7 @@ local.get $2 i32.ne if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -9013,7 +9082,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -9092,7 +9161,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -9124,7 +9193,7 @@ local.get $0 i64.ne if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -9135,7 +9204,7 @@ local.get $1 i32.ne if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -9146,7 +9215,7 @@ local.get $2 i32.ne if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -9276,7 +9345,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -9358,7 +9427,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -9390,7 +9459,7 @@ f32.convert_i32_s f32.ne if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -9401,7 +9470,7 @@ local.get $1 i32.ne if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -9412,7 +9481,7 @@ local.get $2 i32.ne if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -9540,7 +9609,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -9572,7 +9641,7 @@ f64.convert_i32_s f64.ne if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -9583,7 +9652,7 @@ local.get $1 i32.ne if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -9594,7 +9663,7 @@ local.get $2 i32.ne if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -9722,7 +9791,7 @@ i32.const 3 i32.ne if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -9730,10 +9799,2328 @@ unreachable end ) - (func $start:std/typedarray (; 218 ;) (type $FUNCSIG$v) + (func $~lib/typedarray/Int8Array#reverse (; 218 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + local.get $3 + i32.add + local.get $4 + i32.add + i32.load8_s offset=8 + local.set $5 + local.get $1 + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + local.get $3 + i32.add + local.get $4 + i32.add + i32.load8_s offset=8 + i32.store8 offset=8 + local.get $2 + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + i32.store8 offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $std/typedarray/testArrayReverse (; 219 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) - i32.const 896 + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $2 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.set $3 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.set $4 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + 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 $4 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + 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 $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $3 + call $~lib/typedarray/Int8Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $2 + i32.load + local.tee $5 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + i32.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $4 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int8Array#subarray + call $~lib/typedarray/Int8Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 7 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 6 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 5 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint8Array#reverse (; 220 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + local.get $3 + i32.add + local.get $4 + i32.add + i32.load8_u offset=8 + local.set $5 + local.get $1 + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + local.get $3 + i32.add + local.get $4 + i32.add + i32.load8_u offset=8 + i32.store8 offset=8 + local.get $2 + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + i32.store8 offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $std/typedarray/testArrayReverse (; 221 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $2 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.set $3 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.set $4 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $4 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $3 + call $~lib/typedarray/Uint8Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $2 + i32.load + local.tee $5 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + i32.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $4 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int8Array#subarray + call $~lib/typedarray/Uint8Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 7 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 6 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 5 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $std/typedarray/testArrayReverse (; 222 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $2 + i32.const 9 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $3 + i32.const 9 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $4 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $4 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $3 + call $~lib/typedarray/Uint8Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $2 + i32.load + local.tee $5 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 255 + i32.and + i32.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $4 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int8Array#subarray + call $~lib/typedarray/Uint8Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 7 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 6 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 5 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Int16Array#reverse (; 223 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load16_s offset=8 + local.set $5 + local.get $1 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load16_s offset=8 + i32.store16 offset=8 + local.get $2 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + i32.store16 offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $~lib/typedarray/Int16Array#subarray (; 224 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + local.tee $1 + i32.const 4 + local.get $1 + i32.lt_s + select + local.set $3 + i32.const 8 + local.get $1 + i32.const 8 + local.get $1 + i32.lt_s + select + local.tee $2 + local.get $3 + local.get $2 + local.get $3 + i32.gt_s + select + local.set $1 + i32.const 12 + call $~lib/allocator/arena/__memory_allocate + local.tee $2 + local.get $0 + i32.load + i32.store + local.get $2 + local.get $0 + i32.load offset=4 + local.get $3 + i32.const 1 + i32.shl + i32.add + i32.store offset=4 + local.get $2 + local.get $1 + local.get $3 + i32.sub + i32.const 1 + i32.shl + i32.store offset=8 + local.get $2 + ) + (func $std/typedarray/testArrayReverse (; 225 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $2 + i32.const 9 + call $~lib/typedarray/Int16Array#constructor + local.set $3 + i32.const 9 + call $~lib/typedarray/Int16Array#constructor + local.set $4 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + 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 $4 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + 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 $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $3 + call $~lib/typedarray/Int16Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $2 + i32.load + local.tee $5 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + i32.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $4 + call $~lib/typedarray/Int16Array#subarray + call $~lib/typedarray/Int16Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 8 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 7 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 6 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 5 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint16Array#reverse (; 226 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load16_u offset=8 + local.set $5 + local.get $1 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load16_u offset=8 + i32.store16 offset=8 + local.get $2 + i32.const 1 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + i32.store16 offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $std/typedarray/testArrayReverse (; 227 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $2 + i32.const 9 + call $~lib/typedarray/Int16Array#constructor + local.set $3 + i32.const 9 + call $~lib/typedarray/Int16Array#constructor + local.set $4 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $4 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $3 + call $~lib/typedarray/Uint16Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $2 + i32.load + local.tee $5 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + i32.load offset=8 + else + unreachable + end + i32.const 65535 + i32.and + i32.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $4 + call $~lib/typedarray/Int16Array#subarray + call $~lib/typedarray/Uint16Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 8 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 7 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 6 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 5 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Int32Array#reverse (; 228 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load offset=8 + local.set $5 + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i32.load offset=8 + i32.store offset=8 + local.get $2 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + i32.store offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $std/typedarray/testArrayReverse (; 229 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $2 + i32.const 9 + call $~lib/typedarray/Int32Array#constructor + local.set $3 + i32.const 9 + call $~lib/typedarray/Int32Array#constructor + local.set $4 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $4 + local.get $0 + local.get $0 + local.get $2 + i32.load + local.tee $1 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $1 + i32.add + i32.load offset=8 + else + unreachable + end + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $3 + call $~lib/typedarray/Int32Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $3 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $2 + i32.load + local.tee $5 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + i32.load offset=8 + else + unreachable + end + i32.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $4 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int32Array#subarray + call $~lib/typedarray/Int32Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 8 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 7 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 6 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 5 + i32.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Int64Array#reverse (; 230 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i64) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i64.load offset=8 + local.set $5 + local.get $1 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + i64.load offset=8 + i64.store offset=8 + local.get $2 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + i64.store offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $std/typedarray/testArrayReverse (; 231 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $3 + i32.const 9 + call $~lib/typedarray/Int64Array#constructor + local.set $4 + i32.const 9 + call $~lib/typedarray/Int64Array#constructor + local.set $5 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $4 + local.get $0 + local.get $0 + local.tee $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $5 + local.get $1 + local.get $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $4 + call $~lib/typedarray/Int64Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $4 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + i64.extend_i32_s + i64.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $5 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Float64Array#subarray + call $~lib/typedarray/Int64Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 8 + i64.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 7 + i64.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 6 + i64.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 5 + i64.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Float32Array#reverse (; 232 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f32) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + f32.load offset=8 + local.set $5 + local.get $1 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + f32.load offset=8 + f32.store offset=8 + local.get $2 + i32.const 2 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + f32.store offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $std/typedarray/testArrayReverse (; 233 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $3 + i32.const 9 + call $~lib/typedarray/Int32Array#constructor + local.set $4 + i32.const 9 + call $~lib/typedarray/Int32Array#constructor + local.set $5 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $4 + local.get $0 + local.get $0 + local.tee $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $5 + local.get $1 + local.get $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $4 + call $~lib/typedarray/Float32Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $4 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + f32.convert_i32_s + f32.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $5 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int32Array#subarray + call $~lib/typedarray/Float32Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 8 + f32.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 7 + f32.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 6 + f32.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 5 + f32.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Float64Array#reverse (; 234 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f64) + local.get $0 + i32.load + local.set $3 + local.get $0 + i32.load offset=4 + local.set $4 + local.get $0 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.const 1 + i32.sub + local.set $2 + loop $repeat|0 + block $break|0 + local.get $1 + local.get $2 + i32.ge_s + br_if $break|0 + local.get $1 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + f64.load offset=8 + local.set $5 + local.get $1 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $2 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + f64.load offset=8 + f64.store offset=8 + local.get $2 + i32.const 3 + i32.shl + local.get $3 + i32.add + local.get $4 + i32.add + local.get $5 + f64.store offset=8 + local.get $1 + i32.const 1 + i32.add + local.set $1 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $repeat|0 + end + end + local.get $0 + ) + (func $std/typedarray/testArrayReverse (; 235 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $3 + i32.const 9 + call $~lib/typedarray/Int64Array#constructor + local.set $4 + i32.const 9 + call $~lib/typedarray/Int64Array#constructor + local.set $5 + loop $repeat|0 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $4 + local.get $0 + local.get $0 + local.tee $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $5 + local.get $1 + local.get $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $0 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|0 + end + end + local.get $4 + call $~lib/typedarray/Float64Array#reverse + drop + i32.const 0 + local.set $0 + loop $repeat|1 + local.get $0 + i32.const 9 + i32.lt_s + if + local.get $4 + local.get $0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 8 + local.get $0 + i32.sub + local.tee $1 + local.get $3 + i32.load + local.tee $2 + i32.load + i32.const 2 + i32.shr_u + i32.lt_u + if (result i32) + local.get $1 + i32.const 2 + i32.shl + local.get $2 + i32.add + i32.load offset=8 + else + unreachable + end + f64.convert_i32_s + f64.ne + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + else + local.get $0 + i32.const 1 + i32.add + local.set $0 + br $repeat|1 + end + unreachable + end + end + local.get $5 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Float64Array#subarray + call $~lib/typedarray/Float64Array#reverse + local.tee $0 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 8 + f64.ne + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 7 + f64.ne + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 6 + f64.ne + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 5 + f64.ne + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $start:std/typedarray (; 236 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + i32.const 1224 global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset @@ -9832,6 +12219,7 @@ unreachable end global.get $std/typedarray/arr + i32.const 1 i32.const 2 call $~lib/typedarray/Int32Array#subarray global.set $std/typedarray/arr @@ -9922,6 +12310,8 @@ f64.const 8 call $~lib/internal/typedarray/TypedArray#__set global.get $std/typedarray/af64 + i32.const 2 + i32.const 6 call $~lib/typedarray/Float64Array#subarray global.set $std/typedarray/af64 global.get $std/typedarray/af64 @@ -10196,6 +12586,7 @@ unreachable end global.get $std/typedarray/arr8 + i32.const 1 i32.const 4 call $~lib/typedarray/Int8Array#subarray global.set $std/typedarray/sub8 @@ -10376,6 +12767,7 @@ unreachable end global.get $std/typedarray/arr32 + i32.const 1 i32.const 4 call $~lib/typedarray/Int32Array#subarray global.set $std/typedarray/sub32 @@ -10479,6 +12871,7 @@ i32.const 6 call $~lib/internal/typedarray/TypedArray#__set global.get $std/typedarray/multisubarr + i32.const 1 i32.const 6 call $~lib/typedarray/Int8Array#subarray global.set $std/typedarray/multisubarr1 @@ -10534,6 +12927,7 @@ unreachable end global.get $std/typedarray/multisubarr1 + i32.const 1 i32.const 5 call $~lib/typedarray/Int8Array#subarray global.set $std/typedarray/multisubarr2 @@ -10589,6 +12983,7 @@ unreachable end global.get $std/typedarray/multisubarr2 + i32.const 1 i32.const 4 call $~lib/typedarray/Int8Array#subarray global.set $std/typedarray/multisubarr3 @@ -10720,11 +13115,22 @@ call $std/typedarray/testArrayForEach call $std/typedarray/testArrayForEach call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse ) - (func $start (; 219 ;) (type $FUNCSIG$v) + (func $start (; 237 ;) (type $FUNCSIG$v) call $start:std/typedarray ) - (func $null (; 220 ;) (type $FUNCSIG$v) + (func $null (; 238 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/typedarray.ts b/tests/compiler/std/typedarray.ts index f2f43ce6..743198c1 100644 --- a/tests/compiler/std/typedarray.ts +++ b/tests/compiler/std/typedarray.ts @@ -362,10 +362,10 @@ function testArrayFindIndex, T extends number>() // testIndex++; return value == 2; }); - assert(result == 1); + assert(result == 1, "result mismatch"); var failResult = source.findIndex((value: T, index: i32, self: ArrayType): bool => value == 4); - assert(failResult == -1); + assert(failResult == -1, "fail result mismatch"); } testArrayFindIndex(); @@ -441,3 +441,42 @@ testArrayForEach(); testArrayForEach(); testArrayForEach(); testArrayForEach(); + + +var testArrayReverseValues: i32[] = [1, 2, 3, 4, 5, 6, 7, 8, 9]; +function testArrayReverse, T extends number>(): void { + var values = testArrayReverseValues; + var array = instantiate(9); + var arrayWithOffset = instantiate(9); + var i: i32 = 0; + + for (i = 0; i < 9; i++) { + array[i] = values[i]; + arrayWithOffset[i] = values[i]; + } + + array.reverse(); + + for (i = 0; i < 9; i++) { + assert(array[i] == values[8 - i], "TypedArray reverse value mismatch"); + } + + var reversedSlice = arrayWithOffset.subarray(4, 8).reverse(); + + assert(reversedSlice[0] == 8, "TypedArray reverse with byteOffset mismatch"); + assert(reversedSlice[1] == 7, "TypedArray reverse with byteOffset mismatch"); + assert(reversedSlice[2] == 6, "TypedArray reverse with byteOffset mismatch"); + assert(reversedSlice[3] == 5, "TypedArray reverse with byteOffset mismatch"); +} + +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); +testArrayReverse(); diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index cbef649d..3f59da86 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -65,12 +65,18 @@ (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") - (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") + (data (i32.const 624) "\0f\00\00\00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 664) "\14\00\00\00f\00a\00i\00l\00 \00r\00e\00s\00u\00l\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 712) "\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 744) "\c8\02\00\00\03\00\00\00") + (data (i32.const 752) "\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 800) "\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 848) "\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 920) "\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") + (data (i32.const 984) "$\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00\07\00\00\00\08\00\00\00\t\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 1048) "\d8\03\00\00\t\00\00\00") + (data (i32.const 1056) "!\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") + (data (i32.const 1128) "+\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\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)) @@ -102,8 +108,9 @@ (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)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 892)) + (global $std/typedarray/forEachValues (mut i32) (i32.const 744)) + (global $std/typedarray/testArrayReverseValues (mut i32) (i32.const 1048)) + (global $~lib/memory/HEAP_BASE i32 (i32.const 1220)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) @@ -10767,7 +10774,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -10783,7 +10790,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -10915,7 +10922,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -10931,7 +10938,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -11063,7 +11070,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -11079,7 +11086,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -11215,7 +11222,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -11231,7 +11238,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -11363,7 +11370,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -11379,7 +11386,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -11507,7 +11514,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -11523,7 +11530,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -11651,7 +11658,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -11667,7 +11674,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -11795,7 +11802,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -11811,7 +11818,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -11939,7 +11946,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -11955,7 +11962,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -12083,7 +12090,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -12099,7 +12106,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -12227,7 +12234,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 624 i32.const 8 i32.const 365 i32.const 2 @@ -12243,7 +12250,7 @@ i32.eq i32.eqz if - i32.const 0 + i32.const 664 i32.const 8 i32.const 368 i32.const 2 @@ -14506,7 +14513,7 @@ i32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -14518,7 +14525,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -14530,7 +14537,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -14662,7 +14669,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -14685,7 +14692,7 @@ i32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -14697,7 +14704,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -14709,7 +14716,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -14835,7 +14842,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -14858,7 +14865,7 @@ i32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -14870,7 +14877,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -14882,7 +14889,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -15008,7 +15015,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -15035,7 +15042,7 @@ i32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -15047,7 +15054,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -15059,7 +15066,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -15191,7 +15198,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -15214,7 +15221,7 @@ i32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -15226,7 +15233,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -15238,7 +15245,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -15364,7 +15371,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -15383,7 +15390,7 @@ i32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -15395,7 +15402,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -15407,7 +15414,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -15527,7 +15534,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -15546,7 +15553,7 @@ i32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -15558,7 +15565,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -15570,7 +15577,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -15690,7 +15697,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -15710,7 +15717,7 @@ i64.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -15722,7 +15729,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -15734,7 +15741,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -15857,7 +15864,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -15877,7 +15884,7 @@ i64.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -15889,7 +15896,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -15901,7 +15908,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -16024,7 +16031,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -16044,7 +16051,7 @@ f32.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -16056,7 +16063,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -16068,7 +16075,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -16191,7 +16198,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -16211,7 +16218,7 @@ f64.eq i32.eqz if - i32.const 664 + i32.const 752 i32.const 8 i32.const 425 i32.const 4 @@ -16223,7 +16230,7 @@ i32.eq i32.eqz if - i32.const 712 + i32.const 800 i32.const 8 i32.const 426 i32.const 4 @@ -16235,7 +16242,7 @@ i32.eq i32.eqz if - i32.const 760 + i32.const 848 i32.const 8 i32.const 427 i32.const 4 @@ -16358,7 +16365,7 @@ i32.eq i32.eqz if - i32.const 832 + i32.const 920 i32.const 8 i32.const 430 i32.const 2 @@ -16366,7 +16373,4128 @@ unreachable end ) - (func $start:std/typedarray (; 334 ;) (type $FUNCSIG$v) + (func $~lib/typedarray/Int8Array#reverse (; 334 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.17 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + local.get $8 + i32.add + i32.load8_s offset=8 + end + local.set $8 + block $~lib/internal/arraybuffer/STORE|inlined.0 + local.get $2 + local.set $7 + local.get $4 + local.set $6 + block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) + local.get $2 + local.set $9 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $9 + local.get $10 + i32.const 0 + i32.shl + i32.add + local.get $11 + i32.add + i32.load8_s offset=8 + end + local.set $11 + local.get $3 + local.set $10 + local.get $7 + local.get $6 + i32.const 0 + i32.shl + i32.add + local.get $10 + i32.add + local.get $11 + i32.store8 offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.1 + local.get $2 + local.set $10 + local.get $5 + local.set $11 + local.get $8 + local.set $6 + local.get $3 + local.set $7 + local.get $10 + local.get $11 + i32.const 0 + i32.shl + i32.add + local.get $7 + i32.add + local.get $6 + i32.store8 offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $std/typedarray/testArrayReverse (; 335 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int8Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Int8Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int8Array#subarray + call $~lib/typedarray/Int8Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 8 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 7 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 6 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + i32.const 5 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint8Array#reverse (; 336 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.16 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.21 (result i32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + local.get $8 + i32.add + i32.load8_u offset=8 + end + local.set $8 + block $~lib/internal/arraybuffer/STORE|inlined.0 + local.get $2 + local.set $7 + local.get $4 + local.set $6 + block $~lib/internal/arraybuffer/LOAD|inlined.22 (result i32) + local.get $2 + local.set $9 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $9 + local.get $10 + i32.const 0 + i32.shl + i32.add + local.get $11 + i32.add + i32.load8_u offset=8 + end + local.set $11 + local.get $3 + local.set $10 + local.get $7 + local.get $6 + i32.const 0 + i32.shl + i32.add + local.get $10 + i32.add + local.get $11 + i32.store8 offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.1 + local.get $2 + local.set $10 + local.get $5 + local.set $11 + local.get $8 + local.set $6 + local.get $3 + local.set $7 + local.get $10 + local.get $11 + i32.const 0 + i32.shl + i32.add + local.get $7 + i32.add + local.get $6 + i32.store8 offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Uint8Array#subarray (; 337 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.17 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.5 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.5 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 0 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 0 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 338 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint8Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint8Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Uint8Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i32.const 255 + i32.and + i32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Uint8Array#subarray + call $~lib/typedarray/Uint8Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 7 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 6 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 5 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint8ClampedArray#reverse (; 339 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.18 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.23 (result i32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 0 + i32.shl + i32.add + local.get $8 + i32.add + i32.load8_u offset=8 + end + local.set $8 + block $~lib/internal/arraybuffer/STORE|inlined.2 + local.get $2 + local.set $7 + local.get $4 + local.set $6 + block $~lib/internal/arraybuffer/LOAD|inlined.24 (result i32) + local.get $2 + local.set $9 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $9 + local.get $10 + i32.const 0 + i32.shl + i32.add + local.get $11 + i32.add + i32.load8_u offset=8 + end + local.set $11 + local.get $3 + local.set $10 + local.get $7 + local.get $6 + i32.const 0 + i32.shl + i32.add + local.get $10 + i32.add + local.get $11 + i32.store8 offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.3 + local.get $2 + local.set $10 + local.get $5 + local.set $11 + local.get $8 + local.set $6 + local.get $3 + local.set $7 + local.get $10 + local.get $11 + i32.const 0 + i32.shl + i32.add + local.get $7 + i32.add + local.get $6 + i32.store8 offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Uint8ClampedArray#subarray (; 340 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.19 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 0 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.6 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.6 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 0 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 0 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 341 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint8ClampedArray#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 255 + i32.and + call $~lib/typedarray/Uint8ClampedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Uint8ClampedArray#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i32.const 255 + i32.and + i32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Uint8ClampedArray#subarray + call $~lib/typedarray/Uint8ClampedArray#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 8 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 7 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 6 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 5 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Int16Array#reverse (; 342 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 1 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 1 + i32.shl + i32.add + local.get $8 + i32.add + i32.load16_s offset=8 + end + local.set $8 + block $~lib/internal/arraybuffer/STORE|inlined.0 + local.get $2 + local.set $7 + local.get $4 + local.set $6 + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) + local.get $2 + local.set $9 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $9 + local.get $10 + i32.const 1 + i32.shl + i32.add + local.get $11 + i32.add + i32.load16_s offset=8 + end + local.set $11 + local.get $3 + local.set $10 + local.get $7 + local.get $6 + i32.const 1 + i32.shl + i32.add + local.get $10 + i32.add + local.get $11 + i32.store16 offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.1 + local.get $2 + local.set $10 + local.get $5 + local.set $11 + local.get $8 + local.set $6 + local.get $3 + local.set $7 + local.get $10 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $7 + i32.add + local.get $6 + i32.store16 offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Int16Array#subarray (; 343 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 1 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.7 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.7 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 1 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 1 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 344 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int16Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int16Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Int16Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int16Array#subarray + call $~lib/typedarray/Int16Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 8 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 7 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 6 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 5 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint16Array#reverse (; 345 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 1 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 1 + i32.shl + i32.add + local.get $8 + i32.add + i32.load16_u offset=8 + end + local.set $8 + block $~lib/internal/arraybuffer/STORE|inlined.0 + local.get $2 + local.set $7 + local.get $4 + local.set $6 + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) + local.get $2 + local.set $9 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $9 + local.get $10 + i32.const 1 + i32.shl + i32.add + local.get $11 + i32.add + i32.load16_u offset=8 + end + local.set $11 + local.get $3 + local.set $10 + local.get $7 + local.get $6 + i32.const 1 + i32.shl + i32.add + local.get $10 + i32.add + local.get $11 + i32.store16 offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.1 + local.get $2 + local.set $10 + local.get $5 + local.set $11 + local.get $8 + local.set $6 + local.get $3 + local.set $7 + local.get $10 + local.get $11 + i32.const 1 + i32.shl + i32.add + local.get $7 + i32.add + local.get $6 + i32.store16 offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Uint16Array#subarray (; 346 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 1 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.8 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.8 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 1 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 1 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 347 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint16Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint16Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i32.const 65535 + i32.and + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Uint16Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i32.const 65535 + i32.and + i32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Uint16Array#subarray + call $~lib/typedarray/Uint16Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 8 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 7 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 6 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 65535 + i32.and + i32.const 5 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Int32Array#reverse (; 348 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.16 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.add + i32.load offset=8 + end + local.set $8 + block $~lib/internal/arraybuffer/STORE|inlined.3 + local.get $2 + local.set $7 + local.get $4 + local.set $6 + block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) + local.get $2 + local.set $9 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $9 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $11 + i32.add + i32.load offset=8 + end + local.set $11 + local.get $3 + local.set $10 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.add + local.get $11 + i32.store offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.4 + local.get $2 + local.set $10 + local.get $5 + local.set $11 + local.get $8 + local.set $6 + local.get $3 + local.set $7 + local.get $10 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.add + local.get $6 + i32.store offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $std/typedarray/testArrayReverse (; 349 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int32Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int32Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Int32Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int32Array#subarray + call $~lib/typedarray/Int32Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 8 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 7 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 6 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 5 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint32Array#reverse (; 350 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.add + i32.load offset=8 + end + local.set $8 + block $~lib/internal/arraybuffer/STORE|inlined.2 + local.get $2 + local.set $7 + local.get $4 + local.set $6 + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) + local.get $2 + local.set $9 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $9 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $11 + i32.add + i32.load offset=8 + end + local.set $11 + local.get $3 + local.set $10 + local.get $7 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.add + local.get $11 + i32.store offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.3 + local.get $2 + local.set $10 + local.get $5 + local.set $11 + local.get $8 + local.set $6 + local.get $3 + local.set $7 + local.get $10 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.add + local.get $6 + i32.store offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Uint32Array#subarray (; 351 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.9 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.9 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 2 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 352 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint32Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint32Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Uint32Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Uint32Array#subarray + call $~lib/typedarray/Uint32Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 8 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 7 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 6 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 5 + i32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Int64Array#reverse (; 353 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i64) + (local $10 i32) + (local $11 i32) + (local $12 i64) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i64) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $8 + i32.add + i64.load offset=8 + end + local.set $9 + block $~lib/internal/arraybuffer/STORE|inlined.2 + local.get $2 + local.set $8 + local.get $4 + local.set $7 + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i64) + local.get $2 + local.set $6 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $6 + local.get $10 + i32.const 3 + i32.shl + i32.add + local.get $11 + i32.add + i64.load offset=8 + end + local.set $12 + local.get $3 + local.set $11 + local.get $8 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $11 + i32.add + local.get $12 + i64.store offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.3 + local.get $2 + local.set $11 + local.get $5 + local.set $7 + local.get $9 + local.set $12 + local.get $3 + local.set $8 + local.get $11 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $8 + i32.add + local.get $12 + i64.store offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Int64Array#subarray (; 354 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.10 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.10 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 3 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 3 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 355 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int64Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Int64Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Int64Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i64.extend_i32_s + i64.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Int64Array#subarray + call $~lib/typedarray/Int64Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 8 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 7 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 6 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 5 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Uint64Array#reverse (; 356 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i64) + (local $10 i32) + (local $11 i32) + (local $12 i64) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i64) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $8 + i32.add + i64.load offset=8 + end + local.set $9 + block $~lib/internal/arraybuffer/STORE|inlined.2 + local.get $2 + local.set $8 + local.get $4 + local.set $7 + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i64) + local.get $2 + local.set $6 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $6 + local.get $10 + i32.const 3 + i32.shl + i32.add + local.get $11 + i32.add + i64.load offset=8 + end + local.set $12 + local.get $3 + local.set $11 + local.get $8 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $11 + i32.add + local.get $12 + i64.store offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.3 + local.get $2 + local.set $11 + local.get $5 + local.set $7 + local.get $9 + local.set $12 + local.get $3 + local.set $8 + local.get $11 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $8 + i32.add + local.get $12 + i64.store offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Uint64Array#subarray (; 357 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.11 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.11 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 3 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 3 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 358 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint64Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Uint64Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + i64.extend_i32_s + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Uint64Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + i64.extend_i32_s + i64.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Uint64Array#subarray + call $~lib/typedarray/Uint64Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 8 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 7 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 6 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + i64.const 5 + i64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Float32Array#reverse (; 359 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 f32) + (local $10 i32) + (local $11 i32) + (local $12 f32) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f32) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.add + f32.load offset=8 + end + local.set $9 + block $~lib/internal/arraybuffer/STORE|inlined.2 + local.get $2 + local.set $8 + local.get $4 + local.set $7 + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f32) + local.get $2 + local.set $6 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $6 + local.get $10 + i32.const 2 + i32.shl + i32.add + local.get $11 + i32.add + f32.load offset=8 + end + local.set $12 + local.get $3 + local.set $11 + local.get $8 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $11 + i32.add + local.get $12 + f32.store offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.3 + local.get $2 + local.set $11 + local.get $5 + local.set $7 + local.get $9 + local.set $12 + local.get $3 + local.set $8 + local.get $11 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.add + local.get $12 + f32.store offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $~lib/typedarray/Float32Array#subarray (; 360 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) + local.get $3 + local.set $6 + local.get $6 + i32.load offset=8 + i32.const 2 + i32.shr_u + end + local.set $6 + local.get $4 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $4 + i32.add + local.tee $7 + i32.const 0 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $4 + else + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.set $4 + end + local.get $5 + i32.const 0 + i32.lt_s + if + local.get $6 + local.get $5 + i32.add + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + else + local.get $5 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + local.get $8 + i32.lt_s + select + local.tee $7 + local.get $4 + local.tee $8 + local.get $7 + local.get $8 + i32.gt_s + select + local.set $5 + end + block $~lib/memory/memory.allocate|inlined.12 (result i32) + i32.const 12 + local.set $7 + local.get $7 + call $~lib/allocator/arena/__memory_allocate + br $~lib/memory/memory.allocate|inlined.12 + end + local.set $7 + local.get $7 + local.get $3 + i32.load + i32.store + local.get $7 + local.get $3 + i32.load offset=4 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.store offset=4 + local.get $7 + local.get $5 + local.get $4 + i32.sub + i32.const 2 + i32.shl + i32.store offset=8 + local.get $7 + ) + (func $std/typedarray/testArrayReverse (; 361 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Float32Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Float32Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + f32.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Float32Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + f32.convert_i32_s + f32.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Float32Array#subarray + call $~lib/typedarray/Float32Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 8 + f32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 7 + f32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 6 + f32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + f32.const 5 + f32.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/typedarray/Float64Array#reverse (; 362 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 f64) + (local $10 i32) + (local $11 i32) + (local $12 f64) + local.get $0 + local.set $1 + local.get $1 + i32.load + local.set $2 + local.get $1 + i32.load offset=4 + local.set $3 + block $break|0 + block + i32.const 0 + local.set $4 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) + local.get $1 + local.set $5 + local.get $5 + i32.load offset=8 + i32.const 3 + i32.shr_u + end + i32.const 1 + i32.sub + local.set $5 + end + loop $repeat|0 + local.get $4 + local.get $5 + i32.lt_s + i32.eqz + br_if $break|0 + block + block $~lib/internal/arraybuffer/LOAD|inlined.23 (result f64) + local.get $2 + local.set $6 + local.get $4 + local.set $7 + local.get $3 + local.set $8 + local.get $6 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $8 + i32.add + f64.load offset=8 + end + local.set $9 + block $~lib/internal/arraybuffer/STORE|inlined.14 + local.get $2 + local.set $8 + local.get $4 + local.set $7 + block $~lib/internal/arraybuffer/LOAD|inlined.24 (result f64) + local.get $2 + local.set $6 + local.get $5 + local.set $10 + local.get $3 + local.set $11 + local.get $6 + local.get $10 + i32.const 3 + i32.shl + i32.add + local.get $11 + i32.add + f64.load offset=8 + end + local.set $12 + local.get $3 + local.set $11 + local.get $8 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $11 + i32.add + local.get $12 + f64.store offset=8 + end + block $~lib/internal/arraybuffer/STORE|inlined.15 + local.get $2 + local.set $11 + local.get $5 + local.set $7 + local.get $9 + local.set $12 + local.get $3 + local.set $8 + local.get $11 + local.get $7 + i32.const 3 + i32.shl + i32.add + local.get $8 + i32.add + local.get $12 + f64.store offset=8 + end + end + block + local.get $4 + i32.const 1 + i32.add + local.set $4 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + ) + (func $std/typedarray/testArrayReverse (; 363 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + global.get $std/typedarray/testArrayReverseValues + local.set $0 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Float64Array#constructor + local.set $1 + i32.const 0 + i32.const 9 + call $~lib/typedarray/Float64Array#constructor + local.set $2 + i32.const 0 + local.set $3 + block $break|0 + i32.const 0 + local.set $3 + loop $repeat|0 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|0 + block + local.get $1 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + local.get $2 + local.get $3 + local.get $0 + local.get $3 + call $~lib/array/Array#__get + f64.convert_i32_s + call $~lib/internal/typedarray/TypedArray#__set + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|0 + unreachable + end + unreachable + end + local.get $1 + call $~lib/typedarray/Float64Array#reverse + drop + block $break|1 + i32.const 0 + local.set $3 + loop $repeat|1 + local.get $3 + i32.const 9 + i32.lt_s + i32.eqz + br_if $break|1 + local.get $1 + local.get $3 + call $~lib/internal/typedarray/TypedArray#__get + local.get $0 + i32.const 8 + local.get $3 + i32.sub + call $~lib/array/Array#__get + f64.convert_i32_s + f64.eq + i32.eqz + if + i32.const 1056 + i32.const 8 + i32.const 461 + i32.const 4 + call $~lib/env/abort + unreachable + end + local.get $3 + i32.const 1 + i32.add + local.set $3 + br $repeat|1 + unreachable + end + unreachable + end + local.get $2 + i32.const 4 + i32.const 8 + call $~lib/typedarray/Float64Array#subarray + call $~lib/typedarray/Float64Array#reverse + local.set $4 + local.get $4 + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 8 + f64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 466 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 7 + f64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 467 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 6 + f64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 468 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $4 + i32.const 3 + call $~lib/internal/typedarray/TypedArray#__get + f64.const 5 + f64.eq + i32.eqz + if + i32.const 1128 + i32.const 8 + i32.const 469 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $start:std/typedarray (; 364 ;) (type $FUNCSIG$v) (local $0 i32) global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32.const 1 @@ -17613,10 +21741,21 @@ call $std/typedarray/testArrayForEach call $std/typedarray/testArrayForEach call $std/typedarray/testArrayForEach + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse + call $std/typedarray/testArrayReverse ) - (func $start (; 335 ;) (type $FUNCSIG$v) + (func $start (; 365 ;) (type $FUNCSIG$v) call $start:std/typedarray ) - (func $null (; 336 ;) (type $FUNCSIG$v) + (func $null (; 366 ;) (type $FUNCSIG$v) ) )