diff --git a/std/assembly/array.ts b/std/assembly/array.ts index 51fa1862..216081f6 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -32,6 +32,7 @@ export class Array { ); } + @inline get length(): i32 { return this.length_; } @@ -324,12 +325,15 @@ export class Array { if (isReference()) { // TODO replace this to faster stable sort (TimSort) when it implemented - return changetype(insertionSort(this, comparator)); + insertionSort(buffer, 0, length, comparator); + return this; } else { - return changetype(length < 256 - ? insertionSort(this, comparator) - : weakHeapSort(this, comparator) - ); + if (length < 256) { + insertionSort(buffer, 0, length, comparator); + } else { + weakHeapSort(buffer, 0, length, comparator); + } + return this; } } diff --git a/std/assembly/internal/array.ts b/std/assembly/internal/array.ts index 7c30f799..846b759a 100644 --- a/std/assembly/internal/array.ts +++ b/std/assembly/internal/array.ts @@ -1,75 +1,120 @@ -import { loadUnsafe, storeUnsafe } from "./arraybuffer"; -import { Array } from "../array"; +import { + loadUnsafeWithOffset, + storeUnsafeWithOffset +} from "./arraybuffer"; +import { + compareUnsafe, +} from "./string"; + +/** Obtains the default comparator for the specified type. */ +@inline export function defaultComparator(): (a: T, b: T) => i32 { - return function compare(a: T, b: T): i32 { - return ((a > b) - (a < b)); - }; + if (isInteger()) { + if (isSigned() && sizeof() <= 4) { + return (a: T, b: T): i32 => ((a - b)); + } else { + return (a: T, b: T): i32 => ((a > b) - (a < b)); + } + } else if (isFloat()) { + if (sizeof() == 4) { + return (a: T, b: T): i32 => { + var ia = reinterpret(a); + var ib = reinterpret(b); + ia ^= (ia >> 31) >>> 1; + ib ^= (ib >> 31) >>> 1; + return (ia > ib) - (ia < ib); + }; + } else { + return (a: T, b: T): i32 => { + var ia = reinterpret(a); + var ib = reinterpret(b); + ia ^= (ia >> 63) >>> 1; + ib ^= (ib >> 63) >>> 1; + return (ia > ib) - (ia < ib); + }; + } + } else if (isString()) { + return (a: T, b: T): i32 => { + var sa = a, sb = b; + return compareUnsafe(sa, 0, sb, 0, min(sa.length, sb.length)); + }; + } else { + return (a: T, b: T): i32 => ((a > b) - (a < b)); + } } -export function insertionSort(arr: Array, comparator: (a: T, b: T) => i32): Array { - var buffer = arr.buffer_; - for (let i: i32 = 0, length: i32 = arr.length; i < length; i++) { - let a = loadUnsafe(buffer, i); // a = arr[i] +/** Sorts an Array with the 'Insertion Sort' algorithm. */ +export function insertionSort( + buffer: ArrayBuffer, + byteOffset: i32, + length: i32, + comparator: (a: T, b: T) => i32 +): void { + for (let i = 0; i < length; i++) { + let a = loadUnsafeWithOffset(buffer, i, byteOffset); // a = arr[i] let j = i - 1; while (j >= 0) { - let b = loadUnsafe(buffer, j); // b = arr[j] + let b = loadUnsafeWithOffset(buffer, j, byteOffset); // b = arr[j] if (comparator(a, b) < 0) { - storeUnsafe(buffer, j-- + 1, b); // arr[j + 1] = b + storeUnsafeWithOffset(buffer, j-- + 1, b, byteOffset); // arr[j + 1] = b } else break; } - storeUnsafe(buffer, j + 1, a); // arr[j + 1] = a + storeUnsafeWithOffset(buffer, j + 1, a, byteOffset); // arr[j + 1] = a } - return arr; } -export function weakHeapSort(arr: Array, comparator: (a: T, b: T) => i32): Array { +/** Sorts an Array with the 'Weak Heap Sort' algorithm. */ +export function weakHeapSort( + buffer: ArrayBuffer, + byteOffset: i32, + length: i32, + comparator: (a: T, b: T) => i32 +): void { const shift32 = alignof(); - var length = arr.length; var bitsetSize = (length + 31) >> 5 << shift32; var bitset = memory.allocate(bitsetSize); // indexed in 32-bit chunks below memory.fill(bitset, 0, bitsetSize); // see: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.1863&rep=rep1&type=pdf - var buffer = arr.buffer_; for (let i = length - 1; i > 0; i--) { let j = i; while ((j & 1) == (load(bitset + (j >> 6 << shift32)) >> (j >> 1 & 31) & 1)) j >>= 1; let p = j >> 1; - let a = loadUnsafe(buffer, p); // a = arr[p] - let b = loadUnsafe(buffer, i); // b = arr[i] + let a = loadUnsafeWithOffset(buffer, p, byteOffset); // a = arr[p] + let b = loadUnsafeWithOffset(buffer, i, byteOffset); // b = arr[i] if (comparator(a, b) < 0) { store( bitset + (i >> 5 << shift32), load(bitset + (i >> 5 << shift32)) ^ (1 << (i & 31)) ); - storeUnsafe(buffer, i, a); // arr[i] = a - storeUnsafe(buffer, p, b); // arr[p] = b + storeUnsafeWithOffset(buffer, i, a, byteOffset); // arr[i] = a + storeUnsafeWithOffset(buffer, p, b, byteOffset); // arr[p] = b } } for (let i = length - 1; i >= 2; i--) { - let a = loadUnsafe(buffer, 0); // a = arr[0] - storeUnsafe(buffer, 0, loadUnsafe(buffer, i)); // arr[0] = arr[i] - storeUnsafe(buffer, i, a); // arr[i] = a + let a = loadUnsafeWithOffset(buffer, 0, byteOffset); + storeUnsafeWithOffset(buffer, 0, loadUnsafeWithOffset(buffer, i, byteOffset), byteOffset); + storeUnsafeWithOffset(buffer, i, a, byteOffset); let x = 1, y: i32; while ((y = (x << 1) + ((load(bitset + (x >> 5 << shift32)) >> (x & 31)) & 1)) < i) x = y; while (x > 0) { - a = loadUnsafe(buffer, 0); // a = arr[0] - let b = loadUnsafe(buffer, x); // b = arr[x] + a = loadUnsafeWithOffset(buffer, 0, byteOffset); // a = arr[0] + let b = loadUnsafeWithOffset(buffer, x, byteOffset); // b = arr[x] if (comparator(a, b) < 0) { store( bitset + (x >> 5 << shift32), load(bitset + (x >> 5 << shift32)) ^ (1 << (x & 31)) ); - storeUnsafe(buffer, x, a); // arr[x] = a - storeUnsafe(buffer, 0, b); // arr[0] = b + storeUnsafeWithOffset(buffer, x, a, byteOffset); // arr[x] = a + storeUnsafeWithOffset(buffer, 0, b, byteOffset); // arr[0] = b } x >>= 1; } @@ -77,8 +122,7 @@ export function weakHeapSort(arr: Array, comparator: (a: T, b: T) => i32): memory.free(bitset); - var t = loadUnsafe(buffer, 1); // t = arr[1] - storeUnsafe(buffer, 1, loadUnsafe(buffer, 0)); // arr[1] = arr[0] - storeUnsafe(buffer, 0, t); // arr[0] = t - return arr; + var t = loadUnsafeWithOffset(buffer, 1, byteOffset); // t = arr[1] + storeUnsafeWithOffset(buffer, 1, loadUnsafeWithOffset(buffer, 0, byteOffset), byteOffset); + storeUnsafeWithOffset(buffer, 0, t, byteOffset); // arr[0] = t } diff --git a/std/assembly/internal/typedarray.ts b/std/assembly/internal/typedarray.ts index 1a40a4ff..0cb51cb7 100644 --- a/std/assembly/internal/typedarray.ts +++ b/std/assembly/internal/typedarray.ts @@ -6,6 +6,12 @@ import { storeUnsafeWithOffset } from "./arraybuffer"; +import { + insertionSort, + weakHeapSort, + defaultComparator +} from "./array"; + /** Typed array base class. Not a global object. */ export abstract class TypedArray { @@ -70,4 +76,33 @@ export abstract class TypedArray { store(slice, end << alignof(), offsetof("byteLength")); return changetype(slice); } + + sort(comparator: (a: T, b: T) => i32 = defaultComparator()): this { + var byteOffset = this.byteOffset; + var length = this.length; + if (length <= 1) return this; + var buffer = this.buffer; + if (length == 2) { + let a = loadUnsafeWithOffset(buffer, 1, byteOffset); + let b = loadUnsafeWithOffset(buffer, 0, byteOffset); + if (comparator(a, b) < 0) { + storeUnsafeWithOffset(buffer, 1, b, byteOffset); + storeUnsafeWithOffset(buffer, 0, a, byteOffset); + } + return this; + } + + if (isReference()) { + // TODO replace this to faster stable sort (TimSort) when it implemented + insertionSort(buffer, byteOffset, length, comparator); + return this; + } else { + if (length < 256) { + insertionSort(buffer, byteOffset, length, comparator); + } else { + weakHeapSort(buffer, byteOffset, length, comparator); + } + return this; + } + } } diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 5c1d687c..5bcadd76 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1,7 +1,7 @@ (module - (type $ii (func (param i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) (type $iii (func (param i32 i32) (result i32))) + (type $ii (func (param i32) (result i32))) (type $iiiv (func (param i32 i32 i32))) (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) @@ -24,12 +24,7 @@ (data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $~lib/array/Array#get:length (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 2 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 1 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (tee_local $0 (if (result i32) (i32.lt_u @@ -52,7 +47,7 @@ ) ) ) - (func $~lib/array/Array#__get (; 3 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 2 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (tee_local $0 (if (result i32) (i32.lt_u @@ -81,7 +76,7 @@ ) ) ) - (func $~lib/internal/arraybuffer/computeSize (; 4 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (i32.shl (i32.const 1) (i32.sub @@ -95,7 +90,7 @@ ) ) ) - (func $~lib/allocator/arena/__memory_allocate (; 5 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -180,7 +175,7 @@ ) (get_local $1) ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (if (i32.gt_u @@ -209,12 +204,12 @@ ) (get_local $1) ) - (func $~lib/memory/memory.allocate (; 7 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/memory/memory.allocate (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (call $~lib/allocator/arena/__memory_allocate (get_local $0) ) ) - (func $~lib/internal/memory/memset (; 8 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memset (; 7 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i64) (if @@ -544,7 +539,7 @@ ) ) ) - (func $~lib/array/Array#constructor (; 9 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 8 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (if (i32.gt_u @@ -603,7 +598,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#__unchecked_set (; 10 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__unchecked_set (; 9 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (i32.store8 offset=8 (i32.add (i32.load @@ -614,7 +609,7 @@ (get_local $2) ) ) - (func $~lib/array/Array#constructor (; 11 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 10 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (if @@ -679,7 +674,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#__unchecked_set (; 12 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__unchecked_set (; 11 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (i32.store offset=8 (i32.add (i32.load @@ -693,7 +688,7 @@ (get_local $2) ) ) - (func $start (; 13 ;) (; has Stack IR ;) (type $v) + (func $start (; 12 ;) (; has Stack IR ;) (type $v) (local $0 i32) (set_global $~lib/allocator/arena/startOffset (i32.const 232) @@ -703,8 +698,8 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length - (i32.const 24) + (i32.load + (i32.const 28) ) (i32.const 3) ) @@ -780,8 +775,8 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length - (i32.const 112) + (i32.load + (i32.const 116) ) (i32.const 3) ) @@ -847,7 +842,7 @@ ) ) (if - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array-literal/emptyArrayI32) ) (block @@ -897,7 +892,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array-literal/dynamicArrayI8) ) (i32.const 3) @@ -1012,7 +1007,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array-literal/dynamicArrayI32) ) (i32.const 3) diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 5ebe7938..6cfdf25b 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -1,7 +1,7 @@ (module - (type $ii (func (param i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) (type $iii (func (param i32 i32) (result i32))) + (type $ii (func (param i32) (result i32))) (type $iiiv (func (param i32 i32 i32))) (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) @@ -32,12 +32,7 @@ (data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $~lib/array/Array#get:length (; 1 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (set_local $2 (i32.load @@ -68,12 +63,7 @@ (unreachable) ) ) - (func $~lib/array/Array#get:length (; 3 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (set_local $2 (i32.load @@ -104,7 +94,7 @@ (unreachable) ) ) - (func $~lib/internal/arraybuffer/computeSize (; 5 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (type $ii) (param $0 i32) (result i32) (i32.shl (i32.const 1) (i32.sub @@ -121,7 +111,7 @@ ) ) ) - (func $~lib/allocator/arena/__memory_allocate (; 6 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -232,7 +222,7 @@ ) (get_local $1) ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 7 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (if @@ -272,14 +262,14 @@ ) (get_local $1) ) - (func $~lib/memory/memory.allocate (; 8 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/memory/memory.allocate (; 6 ;) (type $ii) (param $0 i32) (result i32) (return (call $~lib/allocator/arena/__memory_allocate (get_local $0) ) ) ) - (func $~lib/internal/memory/memset (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memset (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) @@ -631,7 +621,7 @@ ) ) ) - (func $~lib/array/Array#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -711,7 +701,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#__unchecked_set (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__unchecked_set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (block $~lib/internal/arraybuffer/storeUnsafe|inlined.0 (set_local $3 @@ -731,7 +721,7 @@ ) ) ) - (func $~lib/array/Array#constructor (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -811,7 +801,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#__unchecked_set (; 13 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__unchecked_set (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (block $~lib/internal/arraybuffer/storeUnsafe|inlined.0 (set_local $3 @@ -831,7 +821,7 @@ ) ) ) - (func $start (; 14 ;) (type $v) + (func $start (; 12 ;) (type $v) (local $0 i32) (set_global $~lib/allocator/arena/startOffset (i32.and @@ -851,8 +841,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array-literal/staticArrayI8) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/array-literal/staticArrayI8) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 3) ) @@ -948,8 +943,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array-literal/staticArrayI32) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/array-literal/staticArrayI32) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 3) ) @@ -1027,8 +1027,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array-literal/emptyArrayI32) + (block $~lib/array/Array#get:length|inlined.1 (result i32) + (set_local $0 + (get_global $std/array-literal/emptyArrayI32) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 0) ) @@ -1088,8 +1093,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array-literal/dynamicArrayI8) + (block $~lib/array/Array#get:length|inlined.1 (result i32) + (set_local $0 + (get_global $std/array-literal/dynamicArrayI8) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 3) ) @@ -1230,8 +1240,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array-literal/dynamicArrayI32) + (block $~lib/array/Array#get:length|inlined.2 (result i32) + (set_local $0 + (get_global $std/array-literal/dynamicArrayI32) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 3) ) diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 3314f879..5c03db5f 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -11,8 +11,12 @@ (type $F (func (result f64))) (type $Iv (func (param i64))) (type $II (func (param i64) (result i64))) + (type $ffi (func (param f32 f32) (result i32))) (type $iv (func (param i32))) - (type $i (func (result i32))) + (type $fi (func (param f32) (result i32))) + (type $FFi (func (param f64 f64) (result i32))) + (type $iiF (func (param i32 i32) (result f64))) + (type $Fi (func (param f64) (result i32))) (type $iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $iiiiiv (func (param i32 i32 i32 i32 i32))) (type $v (func)) @@ -32,11 +36,15 @@ (global $~lib/math/random_seeded (mut i32) (i32.const 0)) (global $~lib/math/random_state0 (mut i64) (i64.const 0)) (global $~lib/math/random_state1 (mut i64) (i64.const 0)) - (global $std/array/reversed0 (mut i32) (i32.const 352)) - (global $std/array/reversed1 (mut i32) (i32.const 376)) - (global $std/array/reversed2 (mut i32) (i32.const 400)) - (global $std/array/reversed4 (mut i32) (i32.const 440)) - (global $std/array/expected4 (mut i32) (i32.const 480)) + (global $std/array/f32ArrayTyped (mut i32) (i32.const 408)) + (global $std/array/f64ArrayTyped (mut i32) (i32.const 616)) + (global $std/array/i32ArrayTyped (mut i32) (i32.const 792)) + (global $std/array/u32ArrayTyped (mut i32) (i32.const 872)) + (global $std/array/reversed0 (mut i32) (i32.const 928)) + (global $std/array/reversed1 (mut i32) (i32.const 952)) + (global $std/array/reversed2 (mut i32) (i32.const 976)) + (global $std/array/reversed4 (mut i32) (i32.const 1016)) + (global $std/array/expected4 (mut i32) (i32.const 1056)) (global $std/array/reversed64 (mut i32) (i32.const 0)) (global $std/array/reversed128 (mut i32) (i32.const 0)) (global $std/array/reversed1024 (mut i32) (i32.const 0)) @@ -46,42 +54,65 @@ (global $std/array/randomized257 (mut i32) (i32.const 0)) (global $std/array/reversedNested512 (mut i32) (i32.const 0)) (global $std/array/reversedElements512 (mut i32) (i32.const 0)) - (global $std/array/randomStringsActual (mut i32) (i32.const 640)) - (global $std/array/randomStringsExpected (mut i32) (i32.const 712)) + (global $std/array/randomStringsActual (mut i32) (i32.const 1216)) + (global $std/array/randomStringsExpected (mut i32) (i32.const 1288)) (global $std/array/randomStrings400 (mut i32) (i32.const 0)) - (table 51 51 anyfunc) - (elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|2 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|16 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|28 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|28 $start~anonymous|34 $start~anonymous|28 $start~anonymous|28 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|28 $start~anonymous|34 $~lib/internal/array/defaultComparator~compare|42 $start~anonymous|43 $start~anonymous|44 $start~anonymous|43 $start~anonymous|44 $start~anonymous|47 $start~anonymous|48 $start~anonymous|49 $start~anonymous|49) + (table 55 55 anyfunc) + (elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|2 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|16 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|28 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|28 $start~anonymous|34 $start~anonymous|28 $start~anonymous|28 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|28 $start~anonymous|34 $~lib/array/Array#sort|trampoline~anonymous|42 $~lib/array/Array#sort|trampoline~anonymous|43 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|44 $start~anonymous|48 $~lib/array/Array#sort|trampoline~anonymous|44 $start~anonymous|48 $start~anonymous|51 $start~anonymous|52 $start~anonymous|53 $start~anonymous|53) (memory $0 1) (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") (data (i32.const 104) "\0c\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 136) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") (data (i32.const 168) "V\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\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 352) "X\01") - (data (i32.const 360) "\04\00\00\00\00\00\00\00\01") - (data (i32.const 376) "h\01\00\00\01") - (data (i32.const 384) "\08\00\00\00\00\00\00\00\02\00\00\00\01") - (data (i32.const 400) "\80\01\00\00\02") - (data (i32.const 408) "\10\00\00\00\00\00\00\00\03\00\00\00\02\00\00\00\01") - (data (i32.const 440) "\98\01\00\00\04") - (data (i32.const 448) "\10") - (data (i32.const 460) "\01\00\00\00\02\00\00\00\03") - (data (i32.const 480) "\c0\01\00\00\04") - (data (i32.const 488) "\04\00\00\00\00\00\00\00\01") - (data (i32.const 504) "\e8\01\00\00\01") - (data (i32.const 512) "\08\00\00\00\00\00\00\00\01\00\00\00\02") - (data (i32.const 529) "\02\00\00\02") - (data (i32.const 536) "\01\00\00\00a") - (data (i32.const 544) "\01\00\00\00b") - (data (i32.const 552) "\02\00\00\00a\00b") - (data (i32.const 560) "\02\00\00\00b\00a") - (data (i32.const 576) "\1c\00\00\00\00\00\00\00\18\02\00\00 \02\00\00\18\02\00\00(\02\00\000\02\00\008\02") - (data (i32.const 640) "@\02\00\00\07") - (data (i32.const 648) "\1c\00\00\00\00\00\00\008\02\00\00\18\02\00\00\18\02\00\00(\02\00\00 \02\00\000\02") - (data (i32.const 712) "\88\02\00\00\07") - (data (i32.const 720) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 752) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") - (data (i32.const 808) "\04\00\00\00n\00u\00l\00l") + (data (i32.const 344) " ") + (data (i32.const 354) "\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") + (data (i32.const 408) "X\01\00\00\08") + (data (i32.const 416) " ") + (data (i32.const 426) "\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") + (data (i32.const 480) "\a0\01\00\00\08") + (data (i32.const 488) "@") + (data (i32.const 502) "\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?") + (data (i32.const 542) "\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") + (data (i32.const 616) "\e8\01\00\00\08") + (data (i32.const 624) "@") + (data (i32.const 638) "\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf") + (data (i32.const 670) "\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") + (data (i32.const 752) "p\02\00\00\08") + (data (i32.const 760) "\14\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02") + (data (i32.const 792) "\f8\02\00\00\05") + (data (i32.const 800) "\14\00\00\00\00\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02") + (data (i32.const 832) " \03\00\00\05") + (data (i32.const 840) "\14\00\00\00\00\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02") + (data (i32.const 872) "H\03\00\00\05") + (data (i32.const 880) "\14") + (data (i32.const 892) "\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 912) "p\03\00\00\05") + (data (i32.const 928) "\98\03") + (data (i32.const 936) "\04\00\00\00\00\00\00\00\01") + (data (i32.const 952) "\a8\03\00\00\01") + (data (i32.const 960) "\08\00\00\00\00\00\00\00\02\00\00\00\01") + (data (i32.const 976) "\c0\03\00\00\02") + (data (i32.const 984) "\10\00\00\00\00\00\00\00\03\00\00\00\02\00\00\00\01") + (data (i32.const 1016) "\d8\03\00\00\04") + (data (i32.const 1024) "\10") + (data (i32.const 1036) "\01\00\00\00\02\00\00\00\03") + (data (i32.const 1057) "\04\00\00\04") + (data (i32.const 1064) "\04\00\00\00\00\00\00\00\01") + (data (i32.const 1080) "(\04\00\00\01") + (data (i32.const 1088) "\08\00\00\00\00\00\00\00\01\00\00\00\02") + (data (i32.const 1104) "@\04\00\00\02") + (data (i32.const 1112) "\01\00\00\00a") + (data (i32.const 1120) "\01\00\00\00b") + (data (i32.const 1128) "\02\00\00\00a\00b") + (data (i32.const 1136) "\02\00\00\00b\00a") + (data (i32.const 1152) "\1c\00\00\00\00\00\00\00X\04\00\00`\04\00\00X\04\00\00h\04\00\00p\04\00\00x\04") + (data (i32.const 1216) "\80\04\00\00\07") + (data (i32.const 1224) "\1c\00\00\00\00\00\00\00x\04\00\00X\04\00\00X\04\00\00h\04\00\00`\04\00\00p\04") + (data (i32.const 1288) "\c8\04\00\00\07") + (data (i32.const 1296) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") + (data (i32.const 1328) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s") + (data (i32.const 1384) "\04\00\00\00n\00u\00l\00l") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) @@ -613,12 +644,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#get:length (; 8 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $std/array/internalCapacity (; 9 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/internalCapacity (; 8 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (i32.shr_s (i32.load (i32.load @@ -628,7 +654,7 @@ (i32.const 2) ) ) - (func $~lib/internal/memory/memcpy (; 10 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memcpy (; 9 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2014,7 +2040,7 @@ ) ) ) - (func $~lib/internal/memory/memmove (; 11 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memmove (; 10 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (if @@ -2306,7 +2332,7 @@ ) ) ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 12 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/arraybuffer/reallocateUnsafe (; 11 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (if @@ -2430,7 +2456,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#push (; 13 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#push (; 12 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2468,7 +2494,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 145) + (i32.const 146) (i32.const 42) ) (unreachable) @@ -2504,7 +2530,7 @@ ) (get_local $3) ) - (func $~lib/array/Array#__get (; 14 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 13 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (tee_local $0 (if (result i32) (i32.lt_u @@ -2533,7 +2559,7 @@ ) ) ) - (func $~lib/array/Array#pop (; 15 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/array/Array#pop (; 14 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (if @@ -2549,7 +2575,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 157) + (i32.const 158) (i32.const 20) ) (unreachable) @@ -2579,7 +2605,7 @@ ) (get_local $2) ) - (func $~lib/array/Array#unshift (; 16 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#unshift (; 15 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2620,7 +2646,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 247) + (i32.const 248) (i32.const 42) ) (unreachable) @@ -2675,7 +2701,7 @@ ) (get_local $3) ) - (func $~lib/array/Array#shift (; 17 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/array/Array#shift (; 16 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2692,7 +2718,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 218) + (i32.const 219) (i32.const 20) ) (unreachable) @@ -2742,7 +2768,7 @@ ) (get_local $3) ) - (func $~lib/array/Array#reverse (; 18 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/array/Array#reverse (; 17 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2824,7 +2850,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#indexOf (; 19 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#indexOf (; 18 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (if @@ -2914,7 +2940,7 @@ ) (i32.const -1) ) - (func $~lib/array/Array#includes (; 20 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 19 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (if @@ -3004,7 +3030,7 @@ ) (i32.const 0) ) - (func $~lib/array/Array#splice (; 21 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#splice (; 20 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (if @@ -3102,7 +3128,7 @@ ) ) ) - (func $~lib/array/Array#__set (; 22 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 21 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (if @@ -3129,7 +3155,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -3169,12 +3195,12 @@ (get_local $2) ) ) - (func $start~anonymous|0 (; 23 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|0 (; 22 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eqz (get_local $0) ) ) - (func $~lib/array/Array#findIndex (; 24 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#findIndex (; 23 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3250,19 +3276,19 @@ ) (i32.const -1) ) - (func $start~anonymous|1 (; 25 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|1 (; 24 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 1) ) ) - (func $start~anonymous|2 (; 26 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|2 (; 25 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 100) ) ) - (func $start~anonymous|3 (; 27 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|3 (; 26 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3274,7 +3300,7 @@ (i32.const 100) ) ) - (func $start~anonymous|5 (; 28 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|5 (; 27 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3285,13 +3311,13 @@ (i32.const 100) ) ) - (func $start~anonymous|6 (; 29 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|6 (; 28 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 0) ) ) - (func $~lib/array/Array#every (; 30 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#every (; 29 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3367,13 +3393,13 @@ ) (i32.const 1) ) - (func $start~anonymous|7 (; 31 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|7 (; 30 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const 0) ) ) - (func $start~anonymous|8 (; 32 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|8 (; 31 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3385,13 +3411,13 @@ (i32.const 10) ) ) - (func $start~anonymous|9 (; 33 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|9 (; 32 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.lt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|10 (; 34 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|10 (; 33 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3402,13 +3428,13 @@ (i32.const 3) ) ) - (func $start~anonymous|11 (; 35 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|11 (; 34 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 3) ) ) - (func $~lib/array/Array#some (; 36 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#some (; 35 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3484,13 +3510,13 @@ ) (i32.const 0) ) - (func $start~anonymous|12 (; 37 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|12 (; 36 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const -1) ) ) - (func $start~anonymous|13 (; 38 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|13 (; 37 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3502,13 +3528,13 @@ (i32.const 10) ) ) - (func $start~anonymous|14 (; 39 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|14 (; 38 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.gt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|15 (; 40 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|15 (; 39 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3519,7 +3545,7 @@ (i32.const 3) ) ) - (func $start~anonymous|16 (; 41 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|16 (; 40 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -3527,7 +3553,7 @@ ) ) ) - (func $~lib/array/Array#forEach (; 42 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#forEach (; 41 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3592,7 +3618,7 @@ ) ) ) - (func $start~anonymous|17 (; 43 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|17 (; 42 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3606,7 +3632,7 @@ ) ) ) - (func $start~anonymous|19 (; 44 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|19 (; 43 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3619,12 +3645,12 @@ ) ) ) - (func $start~anonymous|20 (; 45 ;) (; has Stack IR ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start~anonymous|20 (; 44 ;) (; has Stack IR ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) (f32.convert_s/i32 (get_local $0) ) ) - (func $~lib/array/Array#map (; 46 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 45 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3710,7 +3736,7 @@ ) (get_local $6) ) - (func $~lib/array/Array#__get (; 47 ;) (; has Stack IR ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__get (; 46 ;) (; has Stack IR ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (if (result f32) (i32.lt_u (get_local $1) @@ -3737,7 +3763,7 @@ (unreachable) ) ) - (func $start~anonymous|21 (; 48 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|21 (; 47 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3752,7 +3778,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#map (; 49 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 48 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3838,7 +3864,7 @@ ) (get_local $6) ) - (func $start~anonymous|22 (; 50 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|22 (; 49 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -3847,7 +3873,7 @@ ) (get_local $0) ) - (func $start~anonymous|23 (; 51 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|23 (; 50 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -3861,13 +3887,13 @@ ) (get_local $0) ) - (func $start~anonymous|24 (; 52 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|24 (; 51 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 2) ) ) - (func $~lib/array/Array#filter (; 53 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 52 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3954,7 +3980,7 @@ ) (get_local $4) ) - (func $start~anonymous|25 (; 54 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|25 (; 53 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -3972,7 +3998,7 @@ (i32.const 2) ) ) - (func $start~anonymous|26 (; 55 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|26 (; 54 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -3984,7 +4010,7 @@ (i32.const 2) ) ) - (func $start~anonymous|27 (; 56 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|27 (; 55 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4001,13 +4027,13 @@ (i32.const 2) ) ) - (func $start~anonymous|28 (; 57 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|28 (; 56 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $~lib/array/Array#reduce (; 58 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 57 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4076,7 +4102,7 @@ ) (get_local $2) ) - (func $start~anonymous|30 (; 59 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|30 (; 58 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -4089,7 +4115,7 @@ ) ) ) - (func $start~anonymous|31 (; 60 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|31 (; 59 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -4102,7 +4128,7 @@ ) ) ) - (func $start~anonymous|32 (; 61 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|32 (; 60 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $3) @@ -4114,7 +4140,7 @@ (get_local $1) ) ) - (func $start~anonymous|34 (; 62 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|34 (; 61 ;) (; has Stack IR ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $3) @@ -4125,7 +4151,7 @@ (get_local $1) ) ) - (func $~lib/array/Array#reduceRight (; 63 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 62 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (set_local $4 @@ -4180,7 +4206,7 @@ ) (get_local $2) ) - (func $~lib/math/murmurHash3 (; 64 ;) (; has Stack IR ;) (type $II) (param $0 i64) (result i64) + (func $~lib/math/murmurHash3 (; 63 ;) (; has Stack IR ;) (type $II) (param $0 i64) (result i64) (i64.xor (tee_local $0 (i64.mul @@ -4211,7 +4237,7 @@ ) ) ) - (func $~lib/math/NativeMath.seedRandom (; 65 ;) (; has Stack IR ;) (type $Iv) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 64 ;) (; has Stack IR ;) (type $Iv) (param $0 i64) (if (i64.eqz (get_local $0) @@ -4240,218 +4266,37 @@ ) ) ) - (func $std/array/createReverseOrderedArray (; 66 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (set_local $1 - (call $~lib/array/Array#constructor - (i32.const 0) - (get_local $0) - ) - ) - (block $break|0 - (set_local $0 - (i32.const 0) - ) - (loop $repeat|0 - (br_if $break|0 - (i32.ge_s - (get_local $0) - (call $~lib/array/Array#get:length - (get_local $1) - ) - ) - ) - (call $~lib/array/Array#__set - (get_local $1) - (get_local $0) - (i32.sub - (i32.sub - (call $~lib/array/Array#get:length - (get_local $1) - ) - (i32.const 1) - ) - (get_local $0) - ) - ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) - ) - (br $repeat|0) - ) - ) - (get_local $1) - ) - (func $~lib/math/NativeMath.random (; 67 ;) (; has Stack IR ;) (type $F) (result f64) - (local $0 i64) - (local $1 i64) - (if - (i32.eqz - (get_global $~lib/math/random_seeded) - ) - (block - (call $~lib/env/abort - (i32.const 0) - (i32.const 136) - (i32.const 1007) - (i32.const 24) - ) - (unreachable) - ) - ) - (set_local $0 - (get_global $~lib/math/random_state0) - ) - (set_global $~lib/math/random_state0 - (tee_local $1 - (get_global $~lib/math/random_state1) - ) - ) - (set_global $~lib/math/random_state1 - (tee_local $0 - (i64.xor - (i64.xor - (i64.xor - (tee_local $0 - (i64.xor - (get_local $0) - (i64.shl - (get_local $0) - (i64.const 23) - ) - ) - ) - (i64.shr_u - (get_local $0) - (i64.const 17) - ) - ) - (get_local $1) - ) - (i64.shr_u - (get_local $1) - (i64.const 26) - ) - ) - ) - ) - (f64.sub - (f64.reinterpret/i64 - (i64.or - (i64.and - (i64.add - (get_local $1) - (get_local $0) - ) - (i64.const 4503599627370495) - ) - (i64.const 4607182418800017408) - ) - ) - (f64.const 1) - ) - ) - (func $std/array/createRandomOrderedArray (; 68 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (set_local $0 - (call $~lib/array/Array#constructor - (i32.const 0) - (get_local $0) - ) - ) - (block $break|0 - (loop $repeat|0 - (br_if $break|0 - (i32.ge_s - (get_local $1) - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) - ) - (call $~lib/array/Array#__set - (get_local $0) - (get_local $1) - (i32.trunc_s/f64 - (f64.mul - (call $~lib/math/NativeMath.random) - (f64.convert_s/i32 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) - ) - ) - ) - (set_local $1 - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (br $repeat|0) - ) - ) - (get_local $0) - ) - (func $~lib/internal/array/defaultComparator~compare|42 (; 69 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (i32.sub - (i32.gt_s - (get_local $0) - (get_local $1) - ) - (i32.lt_s - (get_local $0) - (get_local $1) - ) - ) - ) - (func $~lib/internal/array/defaultComparator (; 70 ;) (; has Stack IR ;) (type $i) (result i32) - (i32.const 42) - ) - (func $~lib/internal/array/insertionSort (; 71 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/internal/array/insertionSort (; 65 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) + (local $6 f32) + (local $7 f32) (local $8 i32) - (set_local $4 - (i32.load - (get_local $0) - ) - ) (block $break|0 - (set_local $7 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) (loop $repeat|0 (br_if $break|0 (i32.ge_s + (get_local $4) (get_local $2) - (get_local $7) ) ) (set_local $6 - (i32.load offset=8 + (f32.load offset=8 (i32.add - (get_local $4) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $2) + (get_local $4) (i32.const 2) ) ) ) ) - (set_local $3 + (set_local $5 (i32.sub - (get_local $2) + (get_local $4) (i32.const 1) ) ) @@ -4459,16 +4304,19 @@ (loop $continue|1 (if (i32.ge_s - (get_local $3) + (get_local $5) (i32.const 0) ) (block - (set_local $5 - (i32.load offset=8 + (set_local $7 + (f32.load offset=8 (i32.add - (get_local $4) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $5) (i32.const 2) ) ) @@ -4479,48 +4327,52 @@ ) (br_if $break|1 (i32.ge_s - (call_indirect (type $iii) + (call_indirect (type $ffi) (get_local $6) - (tee_local $8 - (get_local $5) - ) - (get_local $1) + (get_local $7) + (get_local $3) ) (i32.const 0) ) ) - (set_local $3 + (set_local $5 (i32.sub - (tee_local $5 - (get_local $3) + (tee_local $8 + (get_local $5) ) (i32.const 1) ) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $4) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (i32.add - (get_local $5) + (get_local $8) (i32.const 1) ) (i32.const 2) ) ) - (get_local $8) + (get_local $7) ) (br $continue|1) ) ) ) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $4) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (i32.add - (get_local $3) + (get_local $5) (i32.const 1) ) (i32.const 2) @@ -4528,41 +4380,34 @@ ) (get_local $6) ) - (set_local $2 + (set_local $4 (i32.add - (get_local $2) + (get_local $4) (i32.const 1) ) ) (br $repeat|0) ) ) - (get_local $0) ) - (func $~lib/allocator/arena/__memory_free (; 72 ;) (; has Stack IR ;) (type $iv) (param $0 i32) + (func $~lib/allocator/arena/__memory_free (; 66 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (nop) ) - (func $~lib/internal/array/weakHeapSort (; 73 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/internal/array/weakHeapSort (; 67 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) + (local $7 f32) (local $8 i32) - (local $9 i32) + (local $9 f32) (call $~lib/internal/memory/memset - (tee_local $7 + (tee_local $8 (call $~lib/allocator/arena/__memory_allocate (tee_local $6 (i32.shl (i32.shr_s (i32.add - (tee_local $8 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) + (get_local $2) (i32.const 31) ) (i32.const 5) @@ -4575,43 +4420,38 @@ (i32.const 0) (get_local $6) ) - (set_local $2 - (i32.load - (get_local $0) - ) - ) (block $break|0 - (set_local $3 + (set_local $4 (i32.sub - (get_local $8) + (get_local $2) (i32.const 1) ) ) (loop $repeat|0 (br_if $break|0 (i32.le_s - (get_local $3) + (get_local $4) (i32.const 0) ) ) - (set_local $4 - (get_local $3) + (set_local $6 + (get_local $4) ) (loop $continue|1 (if (i32.eq (i32.and - (get_local $4) + (get_local $6) (i32.const 1) ) (i32.and (i32.shr_u (i32.load (i32.add - (get_local $7) + (get_local $8) (i32.shl (i32.shr_s - (get_local $4) + (get_local $6) (i32.const 6) ) (i32.const 2) @@ -4620,7 +4460,7 @@ ) (i32.and (i32.shr_s - (get_local $4) + (get_local $6) (i32.const 1) ) (i32.const 31) @@ -4630,9 +4470,9 @@ ) ) (block - (set_local $4 + (set_local $6 (i32.shr_s - (get_local $4) + (get_local $6) (i32.const 1) ) ) @@ -4640,14 +4480,17 @@ ) ) ) - (set_local $4 - (i32.load offset=8 + (set_local $9 + (f32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (tee_local $5 (i32.shr_s - (get_local $4) + (get_local $6) (i32.const 1) ) ) @@ -4656,12 +4499,15 @@ ) ) ) - (set_local $6 - (i32.load offset=8 + (set_local $7 + (f32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) @@ -4672,21 +4518,21 @@ ) (if (i32.lt_s - (call_indirect (type $iii) - (get_local $4) - (get_local $6) - (get_local $1) + (call_indirect (type $ffi) + (get_local $9) + (get_local $7) + (get_local $3) ) (i32.const 0) ) (block (i32.store - (tee_local $9 + (tee_local $6 (i32.add - (get_local $7) + (get_local $8) (i32.shl (i32.shr_s - (get_local $3) + (get_local $4) (i32.const 5) ) (i32.const 2) @@ -4695,42 +4541,48 @@ ) (i32.xor (i32.load - (get_local $9) + (get_local $6) ) (i32.shl (i32.const 1) (i32.and - (get_local $3) + (get_local $4) (i32.const 31) ) ) ) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) - (get_local $4) + (get_local $9) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $5) (i32.const 2) ) ) - (get_local $6) + (get_local $7) ) ) ) - (set_local $3 + (set_local $4 (i32.sub - (get_local $3) + (get_local $4) (i32.const 1) ) ) @@ -4738,45 +4590,57 @@ ) ) (block $break|2 - (set_local $3 + (set_local $4 (i32.sub - (get_local $8) + (get_local $2) (i32.const 1) ) ) (loop $repeat|2 (br_if $break|2 (i32.lt_s - (get_local $3) + (get_local $4) (i32.const 2) ) ) - (set_local $6 - (i32.load offset=8 - (get_local $2) + (set_local $7 + (f32.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) ) ) - (i32.store offset=8 - (get_local $2) - (i32.load offset=8 + (f32.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (f32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) ) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) - (get_local $6) + (get_local $7) ) (set_local $5 (i32.const 1) @@ -4784,7 +4648,7 @@ (loop $continue|3 (if (i32.lt_s - (tee_local $4 + (tee_local $6 (i32.add (i32.shl (get_local $5) @@ -4794,7 +4658,7 @@ (i32.shr_u (i32.load (i32.add - (get_local $7) + (get_local $8) (i32.shl (i32.shr_s (get_local $5) @@ -4813,11 +4677,11 @@ ) ) ) - (get_local $3) + (get_local $4) ) (block (set_local $5 - (get_local $4) + (get_local $6) ) (br $continue|3) ) @@ -4830,15 +4694,21 @@ (i32.const 0) ) (block - (set_local $6 - (i32.load offset=8 - (get_local $2) + (set_local $7 + (f32.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) ) ) - (set_local $4 - (i32.load offset=8 + (set_local $9 + (f32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $5) (i32.const 2) @@ -4851,18 +4721,18 @@ ) (if (i32.lt_s - (call_indirect (type $iii) - (get_local $6) - (get_local $4) - (get_local $1) + (call_indirect (type $ffi) + (get_local $7) + (get_local $9) + (get_local $3) ) (i32.const 0) ) (block (i32.store - (tee_local $8 + (tee_local $2 (i32.add - (get_local $7) + (get_local $8) (i32.shl (i32.shr_s (get_local $5) @@ -4874,7 +4744,7 @@ ) (i32.xor (i32.load - (get_local $8) + (get_local $2) ) (i32.shl (i32.const 1) @@ -4885,19 +4755,25 @@ ) ) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $5) (i32.const 2) ) ) - (get_local $6) + (get_local $7) ) - (i32.store offset=8 - (get_local $2) - (get_local $4) + (f32.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (get_local $9) ) ) ) @@ -4911,9 +4787,9 @@ ) ) ) - (set_local $3 + (set_local $4 (i32.sub - (get_local $3) + (get_local $4) (i32.const 1) ) ) @@ -4921,32 +4797,1738 @@ ) ) (call $~lib/allocator/arena/__memory_free + (get_local $8) + ) + (set_local $7 + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.const 4) + ) + ) + ) + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.const 4) + ) + (f32.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (f32.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) (get_local $7) ) - (set_local $1 + ) + (func $~lib/array/Array#sort (; 68 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 f32) + (local $5 f32) + (if + (i32.eqz + (get_local $1) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 311) + (i32.const 4) + ) + (unreachable) + ) + ) + (if + (i32.le_s + (tee_local $3 + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 1) + ) + (return + (get_local $0) + ) + ) + (set_local $2 + (i32.load + (get_local $0) + ) + ) + (if + (i32.eq + (get_local $3) + (i32.const 2) + ) + (block + (set_local $4 + (f32.load offset=8 + (i32.add + (get_local $2) + (i32.const 4) + ) + ) + ) + (set_local $5 + (f32.load offset=8 + (get_local $2) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $ffi) + (get_local $4) + (get_local $5) + (get_local $1) + ) + (i32.const 0) + ) + (block + (f32.store offset=8 + (i32.add + (get_local $2) + (i32.const 4) + ) + (get_local $5) + ) + (f32.store offset=8 + (get_local $2) + (get_local $4) + ) + ) + ) + (return + (get_local $0) + ) + ) + ) + (if + (i32.lt_s + (get_local $3) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $2) + (i32.const 0) + (get_local $3) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $2) + (i32.const 0) + (get_local $3) + (get_local $1) + ) + ) + (get_local $0) + ) + (func $~lib/array/Array#sort|trampoline~anonymous|42 (; 69 ;) (; has Stack IR ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) + (local $2 i32) + (local $3 i32) + (i32.sub + (i32.gt_s + (tee_local $2 + (i32.xor + (tee_local $2 + (i32.reinterpret/f32 + (get_local $0) + ) + ) + (i32.shr_u + (i32.shr_s + (get_local $2) + (i32.const 31) + ) + (i32.const 1) + ) + ) + ) + (tee_local $3 + (i32.xor + (tee_local $3 + (i32.reinterpret/f32 + (get_local $1) + ) + ) + (i32.shr_u + (i32.shr_s + (get_local $3) + (i32.const 31) + ) + (i32.const 1) + ) + ) + ) + ) + (i32.lt_s + (get_local $2) + (get_local $3) + ) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 70 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (i32.const 42) + ) + ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/builtins/isNaN (; 71 ;) (; has Stack IR ;) (type $fi) (param $0 f32) (result i32) + (f32.ne + (get_local $0) + (get_local $0) + ) + ) + (func $std/array/isArraysEqual (; 72 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (if + (i32.eqz + (get_local $2) + ) + (block + (if + (i32.ne + (i32.load offset=4 + (get_local $0) + ) + (i32.load offset=4 + (get_local $1) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + (block $break|0 + (loop $repeat|0 + (block $continue|0 + (br_if $break|0 + (i32.ge_s + (get_local $3) + (get_local $2) + ) + ) + (if + (tee_local $4 + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + ) + (set_local $4 + (i32.eq + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + ) + ) + ) + (br_if $continue|0 + (get_local $4) + ) + (if + (f32.ne + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + (return + (i32.const 0) + ) + ) + ) + (set_local $3 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (i32.const 1) + ) + (func $~lib/internal/array/insertionSort (; 73 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 f64) + (local $7 f64) + (local $8 i32) + (block $break|0 + (loop $repeat|0 + (br_if $break|0 + (i32.ge_s + (get_local $4) + (get_local $2) + ) + ) + (set_local $6 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + (set_local $5 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_s + (get_local $5) + (i32.const 0) + ) + (block + (set_local $7 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (br_if $break|1 + (i32.ge_s + (call_indirect (type $FFi) + (get_local $6) + (get_local $7) + (get_local $3) + ) + (i32.const 0) + ) + ) + (set_local $5 + (i32.sub + (tee_local $8 + (get_local $5) + ) + (i32.const 1) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (i32.add + (get_local $8) + (i32.const 1) + ) + (i32.const 3) + ) + ) + (get_local $7) + ) + (br $continue|1) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (i32.add + (get_local $5) + (i32.const 1) + ) + (i32.const 3) + ) + ) + (get_local $6) + ) + (set_local $4 + (i32.add + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + (func $~lib/internal/array/weakHeapSort (; 74 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f64) + (local $8 i32) + (local $9 f64) + (call $~lib/internal/memory/memset + (tee_local $8 + (call $~lib/allocator/arena/__memory_allocate + (tee_local $6 + (i32.shl + (i32.shr_s + (i32.add + (get_local $2) + (i32.const 31) + ) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + ) + (i32.const 0) + (get_local $6) + ) + (block $break|0 + (set_local $4 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.le_s + (get_local $4) + (i32.const 0) + ) + ) + (set_local $6 + (get_local $4) + ) + (loop $continue|1 + (if + (i32.eq + (i32.and + (get_local $6) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 6) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (i32.shr_s + (get_local $6) + (i32.const 1) + ) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + (block + (set_local $6 + (i32.shr_s + (get_local $6) + (i32.const 1) + ) + ) + (br $continue|1) + ) + ) + ) + (set_local $9 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (tee_local $5 + (i32.shr_s + (get_local $6) + (i32.const 1) + ) + ) + (i32.const 3) + ) + ) + ) + ) + (set_local $7 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $FFi) + (get_local $9) + (get_local $7) + (get_local $3) + ) + (i32.const 0) + ) + (block + (i32.store + (tee_local $6 + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $4) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.xor + (i32.load + (get_local $6) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $4) + (i32.const 31) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + (get_local $9) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + (get_local $7) + ) + ) + ) + (set_local $4 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (block $break|2 + (set_local $4 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|2 + (br_if $break|2 + (i32.lt_s + (get_local $4) + (i32.const 2) + ) + ) + (set_local $7 + (f64.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (f64.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + (get_local $7) + ) + (set_local $5 + (i32.const 1) + ) + (loop $continue|3 + (if + (i32.lt_s + (tee_local $6 + (i32.add + (i32.shl + (get_local $5) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $5) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (get_local $5) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + ) + (get_local $4) + ) + (block + (set_local $5 + (get_local $6) + ) + (br $continue|3) + ) + ) + ) + (loop $continue|4 + (if + (i32.gt_s + (get_local $5) + (i32.const 0) + ) + (block + (set_local $7 + (f64.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (set_local $9 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $FFi) + (get_local $7) + (get_local $9) + (get_local $3) + ) + (i32.const 0) + ) + (block + (i32.store + (tee_local $2 + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $5) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.xor + (i32.load + (get_local $2) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $5) + (i32.const 31) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + (get_local $7) + ) + (f64.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (get_local $9) + ) + ) + ) + (set_local $5 + (i32.shr_s + (get_local $5) + (i32.const 1) + ) + ) + (br $continue|4) + ) + ) + ) + (set_local $4 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|2) + ) + ) + (call $~lib/allocator/arena/__memory_free + (get_local $8) + ) + (set_local $7 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.const 8) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.const 8) + ) + (f64.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (f64.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (get_local $7) + ) + ) + (func $~lib/array/Array#sort (; 75 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 f64) + (local $5 f64) + (if + (i32.eqz + (get_local $1) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 311) + (i32.const 4) + ) + (unreachable) + ) + ) + (if + (i32.le_s + (tee_local $3 + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 1) + ) + (return + (get_local $0) + ) + ) + (set_local $2 + (i32.load + (get_local $0) + ) + ) + (if + (i32.eq + (get_local $3) + (i32.const 2) + ) + (block + (set_local $4 + (f64.load offset=8 + (i32.add + (get_local $2) + (i32.const 8) + ) + ) + ) + (set_local $5 + (f64.load offset=8 + (get_local $2) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $FFi) + (get_local $4) + (get_local $5) + (get_local $1) + ) + (i32.const 0) + ) + (block + (f64.store offset=8 + (i32.add + (get_local $2) + (i32.const 8) + ) + (get_local $5) + ) + (f64.store offset=8 + (get_local $2) + (get_local $4) + ) + ) + ) + (return + (get_local $0) + ) + ) + ) + (if + (i32.lt_s + (get_local $3) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $2) + (i32.const 0) + (get_local $3) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $2) + (i32.const 0) + (get_local $3) + (get_local $1) + ) + ) + (get_local $0) + ) + (func $~lib/array/Array#sort|trampoline~anonymous|43 (; 76 ;) (; has Stack IR ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (local $2 i64) + (local $3 i64) + (i32.sub + (i64.gt_s + (tee_local $2 + (i64.xor + (tee_local $2 + (i64.reinterpret/f64 + (get_local $0) + ) + ) + (i64.shr_u + (i64.shr_s + (get_local $2) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + (tee_local $3 + (i64.xor + (tee_local $3 + (i64.reinterpret/f64 + (get_local $1) + ) + ) + (i64.shr_u + (i64.shr_s + (get_local $3) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + ) + (i64.lt_s + (get_local $2) + (get_local $3) + ) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 77 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (i32.const 43) + ) + ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/array/Array#__get (; 78 ;) (; has Stack IR ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (if (result f64) + (i32.lt_u + (get_local $1) + (i32.shr_u + (i32.load + (tee_local $0 + (i32.load + (get_local $0) + ) + ) + ) + (i32.const 3) + ) + ) + (f64.load offset=8 + (i32.add + (get_local $0) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + ) + (unreachable) + ) + ) + (func $~lib/builtins/isNaN (; 79 ;) (; has Stack IR ;) (type $Fi) (param $0 f64) (result i32) + (f64.ne + (get_local $0) + (get_local $0) + ) + ) + (func $std/array/isArraysEqual (; 80 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (if + (i32.eqz + (get_local $2) + ) + (block + (if + (i32.ne + (i32.load offset=4 + (get_local $0) + ) + (i32.load offset=4 + (get_local $1) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + (block $break|0 + (loop $repeat|0 + (block $continue|0 + (br_if $break|0 + (i32.ge_s + (get_local $3) + (get_local $2) + ) + ) + (if + (tee_local $4 + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + ) + (set_local $4 + (i32.eq + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + ) + ) + ) + (br_if $continue|0 + (get_local $4) + ) + (if + (f64.ne + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + (return + (i32.const 0) + ) + ) + ) + (set_local $3 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (i32.const 1) + ) + (func $~lib/internal/array/insertionSort (; 81 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (block $break|0 + (loop $repeat|0 + (br_if $break|0 + (i32.ge_s + (get_local $4) + (get_local $2) + ) + ) + (set_local $7 + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + (set_local $5 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_s + (get_local $5) + (i32.const 0) + ) + (block + (set_local $6 + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 2) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (br_if $break|1 + (i32.ge_s + (call_indirect (type $iii) + (get_local $7) + (tee_local $8 + (get_local $6) + ) + (get_local $3) + ) + (i32.const 0) + ) + ) + (set_local $5 + (i32.sub + (tee_local $6 + (get_local $5) + ) + (i32.const 1) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (i32.add + (get_local $6) + (i32.const 1) + ) + (i32.const 2) + ) + ) + (get_local $8) + ) + (br $continue|1) + ) + ) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (i32.add + (get_local $5) + (i32.const 1) + ) + (i32.const 2) + ) + ) + (get_local $7) + ) + (set_local $4 + (i32.add + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + (func $~lib/internal/array/weakHeapSort (; 82 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (call $~lib/internal/memory/memset + (tee_local $8 + (call $~lib/allocator/arena/__memory_allocate + (tee_local $7 + (i32.shl + (i32.shr_s + (i32.add + (get_local $2) + (i32.const 31) + ) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + ) + (i32.const 0) + (get_local $7) + ) + (block $break|0 + (set_local $4 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.le_s + (get_local $4) + (i32.const 0) + ) + ) + (set_local $5 + (get_local $4) + ) + (loop $continue|1 + (if + (i32.eq + (i32.and + (get_local $5) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $5) + (i32.const 6) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (i32.shr_s + (get_local $5) + (i32.const 1) + ) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + (block + (set_local $5 + (i32.shr_s + (get_local $5) + (i32.const 1) + ) + ) + (br $continue|1) + ) + ) + ) + (set_local $5 + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (tee_local $6 + (i32.shr_s + (get_local $5) + (i32.const 1) + ) + ) + (i32.const 2) + ) + ) + ) + ) + (set_local $7 + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $iii) + (get_local $5) + (get_local $7) + (get_local $3) + ) + (i32.const 0) + ) + (block + (i32.store + (tee_local $9 + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $4) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.xor + (i32.load + (get_local $9) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $4) + (i32.const 31) + ) + ) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + (get_local $5) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $7) + ) + ) + ) + (set_local $4 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (block $break|2 + (set_local $4 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|2 + (br_if $break|2 + (i32.lt_s + (get_local $4) + (i32.const 2) + ) + ) + (set_local $7 + (i32.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (i32.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + (get_local $7) + ) + (set_local $6 + (i32.const 1) + ) + (loop $continue|3 + (if + (i32.lt_s + (tee_local $5 + (i32.add + (i32.shl + (get_local $6) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (get_local $6) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + ) + (get_local $4) + ) + (block + (set_local $6 + (get_local $5) + ) + (br $continue|3) + ) + ) + ) + (loop $continue|4 + (if + (i32.gt_s + (get_local $6) + (i32.const 0) + ) + (block + (set_local $7 + (i32.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (set_local $5 + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $iii) + (get_local $7) + (get_local $5) + (get_local $3) + ) + (i32.const 0) + ) + (block + (i32.store + (tee_local $2 + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.xor + (i32.load + (get_local $2) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $6) + (i32.const 31) + ) + ) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $7) + ) + (i32.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (get_local $5) + ) + ) + ) + (set_local $6 + (i32.shr_s + (get_local $6) + (i32.const 1) + ) + ) + (br $continue|4) + ) + ) + ) + (set_local $4 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|2) + ) + ) + (call $~lib/allocator/arena/__memory_free + (get_local $8) + ) + (set_local $2 (i32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.const 4) ) ) ) (i32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.const 4) ) (i32.load offset=8 - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) ) ) (i32.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) (get_local $2) - (get_local $1) ) - (get_local $0) ) - (func $~lib/array/Array#sort (; 74 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 83 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4958,7 +6540,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 310) + (i32.const 311) (i32.const 4) ) (unreachable) @@ -5032,24 +6614,303 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.lt_s - (get_local $2) - (i32.const 256) + (if + (i32.lt_s + (get_local $2) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + ) + (get_local $0) + ) + (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 84 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.sub + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 85 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) ) - (call $~lib/internal/array/insertionSort - (get_local $0) - (get_local $1) + (unreachable) + ) + (set_local $1 + (i32.const 44) + ) + ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) + ) + (func $std/array/isArraysEqual (; 86 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (if + (i32.eqz + (get_local $2) + ) + (block + (if + (i32.ne + (i32.load offset=4 + (get_local $0) + ) + (i32.load offset=4 + (get_local $1) + ) + ) + (return + (i32.const 0) + ) ) - (call $~lib/internal/array/weakHeapSort - (get_local $0) - (get_local $1) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) ) ) ) + (block $break|0 + (loop $repeat|0 + (br_if $break|0 + (i32.ge_s + (get_local $3) + (get_local $2) + ) + ) + (if + (i32.ne + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + (return + (i32.const 0) + ) + (block + (set_local $3 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + ) + (i32.const 1) ) - (func $std/array/isSorted (; 75 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 87 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.sub + (i32.gt_u + (get_local $0) + (get_local $1) + ) + (i32.lt_u + (get_local $0) + (get_local $1) + ) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 88 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (i32.const 45) + ) + ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) + ) + (func $std/array/createReverseOrderedArray (; 89 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (set_local $1 + (call $~lib/array/Array#constructor + (i32.const 0) + (get_local $0) + ) + ) + (block $break|0 + (set_local $0 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.ge_s + (get_local $0) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + (call $~lib/array/Array#__set + (get_local $1) + (get_local $0) + (i32.sub + (i32.sub + (i32.load offset=4 + (get_local $1) + ) + (i32.const 1) + ) + (get_local $0) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (get_local $1) + ) + (func $~lib/math/NativeMath.random (; 90 ;) (; has Stack IR ;) (type $F) (result f64) + (local $0 i64) + (local $1 i64) + (if + (i32.eqz + (get_global $~lib/math/random_seeded) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 136) + (i32.const 1007) + (i32.const 24) + ) + (unreachable) + ) + ) + (set_local $0 + (get_global $~lib/math/random_state0) + ) + (set_global $~lib/math/random_state0 + (tee_local $1 + (get_global $~lib/math/random_state1) + ) + ) + (set_global $~lib/math/random_state1 + (tee_local $0 + (i64.xor + (i64.xor + (i64.xor + (tee_local $0 + (i64.xor + (get_local $0) + (i64.shl + (get_local $0) + (i64.const 23) + ) + ) + ) + (i64.shr_u + (get_local $0) + (i64.const 17) + ) + ) + (get_local $1) + ) + (i64.shr_u + (get_local $1) + (i64.const 26) + ) + ) + ) + ) + (f64.sub + (f64.reinterpret/i64 + (i64.or + (i64.and + (i64.add + (get_local $1) + (get_local $0) + ) + (i64.const 4503599627370495) + ) + (i64.const 4607182418800017408) + ) + ) + (f64.const 1) + ) + ) + (func $std/array/createRandomOrderedArray (; 91 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (set_local $0 + (call $~lib/array/Array#constructor + (i32.const 0) + (get_local $0) + ) + ) + (block $break|0 + (loop $repeat|0 + (br_if $break|0 + (i32.ge_s + (get_local $1) + (i32.load offset=4 + (get_local $0) + ) + ) + ) + (call $~lib/array/Array#__set + (get_local $0) + (get_local $1) + (i32.trunc_s/f64 + (f64.mul + (call $~lib/math/NativeMath.random) + (f64.convert_s/i32 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (get_local $0) + ) + (func $std/array/isSorted (; 92 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (block $break|0 @@ -5057,7 +6918,7 @@ (i32.const 1) ) (set_local $3 - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $0) ) ) @@ -5106,7 +6967,7 @@ ) (i32.const 1) ) - (func $std/array/assertSorted (; 76 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 93 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) (if (i32.eqz (call $std/array/isSorted @@ -5121,95 +6982,26 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 605) + (i32.const 608) (i32.const 2) ) (unreachable) ) ) ) - (func $std/array/assertSortedDefault (; 77 ;) (; has Stack IR ;) (type $iv) (param $0 i32) + (func $std/array/assertSortedDefault (; 94 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (call $std/array/assertSorted (get_local $0) - (call $~lib/internal/array/defaultComparator) + (i32.const 46) ) ) - (func $std/array/isArraysEqual (; 78 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (if - (i32.eqz - (get_local $2) - ) - (block - (if - (i32.ne - (call $~lib/array/Array#get:length - (get_local $0) - ) - (call $~lib/array/Array#get:length - (get_local $1) - ) - ) - (return - (i32.const 0) - ) - ) - (set_local $2 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) - ) - ) - (block $break|0 - (loop $repeat|0 - (br_if $break|0 - (i32.ge_s - (get_local $3) - (get_local $2) - ) - ) - (if - (i32.ne - (call $~lib/array/Array#__get - (get_local $0) - (get_local $3) - ) - (call $~lib/array/Array#__get - (get_local $1) - (get_local $3) - ) - ) - (return - (i32.const 0) - ) - (block - (set_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (br $repeat|0) - ) - ) - ) - ) - (i32.const 1) - ) - (func $start~anonymous|43 (; 79 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (i32.sub - (get_local $0) - (get_local $1) - ) - ) - (func $start~anonymous|44 (; 80 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|48 (; 95 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $1) (get_local $0) ) ) - (func $std/array/createReverseOrderedNestedArray (; 81 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedNestedArray (; 96 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (set_local $1 (call $~lib/array/Array#constructor @@ -5225,7 +7017,7 @@ (br_if $break|0 (i32.ge_s (get_local $0) - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $1) ) ) @@ -5246,7 +7038,7 @@ (i32.const 0) (i32.sub (i32.sub - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $1) ) (i32.const 1) @@ -5265,7 +7057,7 @@ ) (get_local $1) ) - (func $start~anonymous|47 (; 82 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|51 (; 97 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/array/Array#__get (get_local $0) @@ -5277,7 +7069,7 @@ ) ) ) - (func $~lib/array/Array>#sort (; 83 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#sort (; 98 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5289,7 +7081,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 310) + (i32.const 311) (i32.const 4) ) (unreachable) @@ -5364,11 +7156,14 @@ ) ) (call $~lib/internal/array/insertionSort - (get_local $0) + (get_local $3) + (i32.const 0) + (get_local $2) (get_local $1) ) + (get_local $0) ) - (func $std/array/assertSorted> (; 84 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted> (; 99 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) (if (i32.eqz (call $std/array/isSorted @@ -5383,14 +7178,14 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 605) + (i32.const 608) (i32.const 2) ) (unreachable) ) ) ) - (func $std/array/Proxy#constructor (; 85 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/Proxy#constructor (; 100 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (if (i32.eqz (get_local $0) @@ -5406,7 +7201,7 @@ ) (get_local $0) ) - (func $std/array/createReverseOrderedElementsArray (; 86 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedElementsArray (; 101 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (set_local $1 (call $~lib/array/Array#constructor @@ -5422,7 +7217,7 @@ (br_if $break|0 (i32.ge_s (get_local $0) - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $1) ) ) @@ -5434,7 +7229,7 @@ (i32.const 0) (i32.sub (i32.sub - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $1) ) (i32.const 1) @@ -5454,7 +7249,7 @@ ) (get_local $1) ) - (func $start~anonymous|48 (; 87 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|52 (; 102 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (i32.load (get_local $0) @@ -5464,7 +7259,7 @@ ) ) ) - (func $~lib/internal/string/compareUnsafe (; 88 ;) (; has Stack IR ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/internal/string/compareUnsafe (; 103 ;) (; has Stack IR ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (set_local $1 (i32.add @@ -5529,7 +7324,7 @@ ) (get_local $5) ) - (func $~lib/string/String.__gt (; 89 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gt (; 104 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (if @@ -5606,7 +7401,7 @@ (i32.const 0) ) ) - (func $~lib/string/String.__lt (; 90 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lt (; 105 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (if @@ -5683,7 +7478,7 @@ (i32.const 0) ) ) - (func $start~anonymous|49 (; 91 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|53 (; 106 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/string/String.__gt (get_local $0) @@ -5695,7 +7490,7 @@ ) ) ) - (func $~lib/string/String.__eq (; 92 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 107 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (if (i32.eq @@ -5751,7 +7546,7 @@ ) ) ) - (func $~lib/string/String.__ne (; 93 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 108 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.eqz (call $~lib/string/String.__eq (get_local $0) @@ -5759,7 +7554,7 @@ ) ) ) - (func $std/array/isArraysEqual (; 94 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 109 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (if (i32.eqz @@ -5768,10 +7563,10 @@ (block (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $0) ) - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $1) ) ) @@ -5780,7 +7575,7 @@ ) ) (set_local $2 - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $0) ) ) @@ -5822,7 +7617,7 @@ ) (i32.const 1) ) - (func $~lib/internal/string/allocateUnsafe (; 95 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/string/allocateUnsafe (; 110 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (if (tee_local $1 @@ -5845,7 +7640,7 @@ (block (call $~lib/env/abort (i32.const 0) - (i32.const 752) + (i32.const 1328) (i32.const 14) (i32.const 2) ) @@ -5868,7 +7663,7 @@ ) (get_local $1) ) - (func $~lib/string/String#charAt (; 96 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#charAt (; 111 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (if (i32.eqz @@ -5877,7 +7672,7 @@ (block (call $~lib/env/abort (i32.const 0) - (i32.const 720) + (i32.const 1296) (i32.const 56) (i32.const 4) ) @@ -5892,7 +7687,7 @@ ) ) (return - (i32.const 568) + (i32.const 1144) ) ) (i32.store16 offset=4 @@ -5913,7 +7708,7 @@ ) (get_local $2) ) - (func $~lib/internal/string/copyUnsafe (; 97 ;) (; has Stack IR ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) + (func $~lib/internal/string/copyUnsafe (; 112 ;) (; has Stack IR ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (call $~lib/internal/memory/memmove (i32.add (i32.add @@ -5941,7 +7736,7 @@ ) ) ) - (func $~lib/string/String#concat (; 98 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 113 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5952,7 +7747,7 @@ (block (call $~lib/env/abort (i32.const 0) - (i32.const 720) + (i32.const 1296) (i32.const 108) (i32.const 4) ) @@ -5964,7 +7759,7 @@ (get_local $1) ) (set_local $1 - (i32.const 808) + (i32.const 1384) ) ) (if @@ -5985,7 +7780,7 @@ ) ) (return - (i32.const 568) + (i32.const 1144) ) ) (call $~lib/internal/string/copyUnsafe @@ -6008,13 +7803,13 @@ ) (get_local $2) ) - (func $~lib/string/String.__concat (; 99 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 114 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (if (i32.eqz (get_local $0) ) (set_local $0 - (i32.const 808) + (i32.const 1384) ) ) (call $~lib/string/String#concat @@ -6022,11 +7817,11 @@ (get_local $1) ) ) - (func $std/array/createRandomString (; 100 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 115 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (set_local $1 - (i32.const 568) + (i32.const 1144) ) (block $break|0 (loop $repeat|0 @@ -6067,7 +7862,7 @@ ) (get_local $1) ) - (func $std/array/createRandomStringArray (; 101 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createRandomStringArray (; 116 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (set_local $1 (call $~lib/array/Array#constructor @@ -6083,7 +7878,7 @@ (br_if $break|0 (i32.ge_s (get_local $0) - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_local $1) ) ) @@ -6111,9 +7906,9 @@ ) (get_local $1) ) - (func $start (; 102 ;) (; has Stack IR ;) (type $v) + (func $start (; 117 ;) (; has Stack IR ;) (type $v) (set_global $~lib/allocator/arena/startOffset - (i32.const 824) + (i32.const 1400) ) (set_global $~lib/allocator/arena/offset (get_global $~lib/allocator/arena/startOffset) @@ -6125,7 +7920,7 @@ ) ) (if - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (block @@ -6178,7 +7973,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 1) @@ -6231,7 +8026,7 @@ ) ) (if - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (block @@ -6269,7 +8064,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 1) @@ -6327,7 +8122,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -6403,7 +8198,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 3) @@ -6497,7 +8292,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 4) @@ -6609,7 +8404,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 5) @@ -6753,7 +8548,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 4) @@ -6879,7 +8674,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 3) @@ -6972,7 +8767,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 3) @@ -7508,7 +9303,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 4) @@ -7679,7 +9474,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -7758,7 +9553,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -7847,7 +9642,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -7923,7 +9718,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -8009,7 +9804,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -8085,7 +9880,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -8158,7 +9953,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -8239,7 +10034,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -8274,7 +10069,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/newArr) ) (i32.const 4) @@ -8338,7 +10133,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -8423,7 +10218,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -8458,7 +10253,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/filteredArr) ) (i32.const 2) @@ -8499,7 +10294,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -8584,7 +10379,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -8726,7 +10521,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -8807,7 +10602,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 2) @@ -8949,7 +10744,7 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (i32.const 8) @@ -9029,7 +10824,7 @@ ) ) (if - (call $~lib/array/Array#get:length + (i32.load offset=4 (get_global $std/array/arr) ) (block @@ -9071,6 +10866,114 @@ (call $~lib/math/JSMath.random) ) ) + (set_global $~argc + (i32.const 0) + ) + (drop + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/f32ArrayTyped) + (i32.const 0) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/f32ArrayTyped) + (i32.const 480) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 619) + (i32.const 0) + ) + (unreachable) + ) + ) + (set_global $~argc + (i32.const 0) + ) + (drop + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/f64ArrayTyped) + (i32.const 0) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/f64ArrayTyped) + (i32.const 752) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 623) + (i32.const 0) + ) + (unreachable) + ) + ) + (set_global $~argc + (i32.const 0) + ) + (drop + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/i32ArrayTyped) + (i32.const 0) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/i32ArrayTyped) + (i32.const 832) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 627) + (i32.const 0) + ) + (unreachable) + ) + ) + (set_global $~argc + (i32.const 0) + ) + (drop + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/u32ArrayTyped) + (i32.const 0) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/u32ArrayTyped) + (i32.const 912) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 631) + (i32.const 0) + ) + (unreachable) + ) + ) (set_global $std/array/reversed64 (call $std/array/createReverseOrderedArray (i32.const 64) @@ -9106,7 +11009,7 @@ (i32.eqz (call $std/array/isArraysEqual (get_global $std/array/reversed1) - (i32.const 504) + (i32.const 1080) (i32.const 0) ) ) @@ -9114,7 +11017,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 631) + (i32.const 651) (i32.const 0) ) (unreachable) @@ -9127,7 +11030,7 @@ (i32.eqz (call $std/array/isArraysEqual (get_global $std/array/reversed2) - (i32.const 528) + (i32.const 1104) (i32.const 0) ) ) @@ -9135,7 +11038,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 634) + (i32.const 654) (i32.const 0) ) (unreachable) @@ -9156,7 +11059,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 637) + (i32.const 657) (i32.const 0) ) (unreachable) @@ -9177,7 +11080,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 640) + (i32.const 660) (i32.const 0) ) (unreachable) @@ -9198,7 +11101,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 643) + (i32.const 663) (i32.const 0) ) (unreachable) @@ -9219,7 +11122,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 646) + (i32.const 666) (i32.const 0) ) (unreachable) @@ -9240,7 +11143,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 649) + (i32.const 669) (i32.const 0) ) (unreachable) @@ -9261,19 +11164,19 @@ ) (call $std/array/assertSorted (get_global $std/array/randomized64) - (i32.const 43) + (i32.const 47) ) (call $std/array/assertSorted (get_global $std/array/randomized64) - (i32.const 44) + (i32.const 48) ) (call $std/array/assertSorted (get_global $std/array/randomized257) - (i32.const 45) + (i32.const 49) ) (call $std/array/assertSorted (get_global $std/array/randomized257) - (i32.const 46) + (i32.const 50) ) (set_global $std/array/reversedNested512 (call $std/array/createReverseOrderedNestedArray @@ -9282,7 +11185,7 @@ ) (call $std/array/assertSorted> (get_global $std/array/reversedNested512) - (i32.const 47) + (i32.const 51) ) (set_global $std/array/reversedElements512 (call $std/array/createReverseOrderedElementsArray @@ -9291,11 +11194,11 @@ ) (call $std/array/assertSorted> (get_global $std/array/reversedElements512) - (i32.const 48) + (i32.const 52) ) (call $std/array/assertSorted> (get_global $std/array/randomStringsActual) - (i32.const 49) + (i32.const 53) ) (if (i32.eqz @@ -9309,7 +11212,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 678) + (i32.const 698) (i32.const 0) ) (unreachable) @@ -9322,7 +11225,7 @@ ) (call $std/array/assertSorted> (get_global $std/array/randomStrings400) - (i32.const 50) + (i32.const 54) ) ) ) diff --git a/tests/compiler/std/array.ts b/tests/compiler/std/array.ts index db6c6750..fb104d01 100644 --- a/tests/compiler/std/array.ts +++ b/tests/compiler/std/array.ts @@ -538,6 +538,9 @@ function isArraysEqual(a: Array, b: Array, len: i32 = 0): bool { len = a.length; } for (let i = 0; i < len; i++) { + if (isFloat()) { + if (isNaN(a[i]) && isNaN(a[i]) == isNaN(b[i])) continue; + } if (a[i] != b[i]) return false; } return true; @@ -609,12 +612,29 @@ function assertSortedDefault(arr: Array): void { assertSorted(arr, defaultComparator()); } -var reversed0: Array = []; -var reversed1: Array = [1]; -var reversed2: Array = [2, 1]; -var reversed4: Array = [3, 2, 1, 0]; +// Tests for default comparator -var expected4: Array = [0, 1, 2, 3]; +var f32ArrayTyped: f32[] = [1.0, NaN, -Infinity, 1.00000001, 0.0, -1.0, -2.0, +Infinity]; +f32ArrayTyped.sort(); +assert(isArraysEqual(f32ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.00000001, Infinity, NaN])); + +var f64ArrayTyped: f64[] = [1.0, NaN, -Infinity, 1.000000000000001, 0.0, -1.0, -2.0, +Infinity]; +f64ArrayTyped.sort(); +assert(isArraysEqual(f64ArrayTyped, [-Infinity, -2.0, -1.0, 0.0, 1.0, 1.000000000000001, Infinity, NaN])); + +var i32ArrayTyped: i32[] = [1, -2, -1, 0, 2]; +i32ArrayTyped.sort(); +assert(isArraysEqual(i32ArrayTyped, [-2, -1, 0, 1, 2])); + +var u32ArrayTyped: u32[] = [1, 4294967295, 4294967294, 0, 2]; +u32ArrayTyped.sort(); +assert(isArraysEqual(u32ArrayTyped, [0, 1, 2, 4294967294, 4294967295])); + +var reversed0: i32[] = []; +var reversed1: i32[] = [1]; +var reversed2: i32[] = [2, 1]; +var reversed4: i32[] = [3, 2, 1, 0]; +var expected4: i32[] = [0, 1, 2, 3]; var reversed64 = createReverseOrderedArray(64); var reversed128 = createReverseOrderedArray(128); diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index dd9e79d4..f6a33df4 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -11,8 +11,12 @@ (type $F (func (result f64))) (type $Iv (func (param i64))) (type $II (func (param i64) (result i64))) + (type $ffi (func (param f32 f32) (result i32))) (type $iv (func (param i32))) - (type $i (func (result i32))) + (type $fi (func (param f32) (result i32))) + (type $FFi (func (param f64 f64) (result i32))) + (type $iiF (func (param i32 i32) (result f64))) + (type $Fi (func (param f64) (result i32))) (type $iiiiii (func (param i32 i32 i32 i32 i32) (result i32))) (type $iiiiiv (func (param i32 i32 i32 i32 i32))) (type $v (func)) @@ -26,6 +30,8 @@ (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8)) (global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816)) + (global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4)) + (global $~lib/internal/string/MAX_LENGTH i32 (i32.const 536870910)) (global $std/array/arr (mut i32) (i32.const 0)) (global $std/array/i (mut i32) (i32.const 0)) (global $std/array/includes (mut i32) (i32.const 0)) @@ -39,11 +45,17 @@ (global $~lib/math/random_state0 (mut i64) (i64.const 0)) (global $~lib/math/random_state1 (mut i64) (i64.const 0)) (global $std/array/charset i32 (i32.const 168)) - (global $std/array/reversed0 (mut i32) (i32.const 352)) - (global $std/array/reversed1 (mut i32) (i32.const 376)) - (global $std/array/reversed2 (mut i32) (i32.const 400)) - (global $std/array/reversed4 (mut i32) (i32.const 440)) - (global $std/array/expected4 (mut i32) (i32.const 480)) + (global $NaN f64 (f64.const nan:0x8000000000000)) + (global $Infinity f64 (f64.const inf)) + (global $std/array/f32ArrayTyped (mut i32) (i32.const 408)) + (global $std/array/f64ArrayTyped (mut i32) (i32.const 616)) + (global $std/array/i32ArrayTyped (mut i32) (i32.const 792)) + (global $std/array/u32ArrayTyped (mut i32) (i32.const 872)) + (global $std/array/reversed0 (mut i32) (i32.const 928)) + (global $std/array/reversed1 (mut i32) (i32.const 952)) + (global $std/array/reversed2 (mut i32) (i32.const 976)) + (global $std/array/reversed4 (mut i32) (i32.const 1016)) + (global $std/array/expected4 (mut i32) (i32.const 1056)) (global $std/array/reversed64 (mut i32) (i32.const 0)) (global $std/array/reversed128 (mut i32) (i32.const 0)) (global $std/array/reversed1024 (mut i32) (i32.const 0)) @@ -53,46 +65,60 @@ (global $std/array/randomized257 (mut i32) (i32.const 0)) (global $std/array/reversedNested512 (mut i32) (i32.const 0)) (global $std/array/reversedElements512 (mut i32) (i32.const 0)) - (global $std/array/randomStringsActual (mut i32) (i32.const 640)) - (global $std/array/randomStringsExpected (mut i32) (i32.const 712)) - (global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4)) - (global $~lib/internal/string/MAX_LENGTH i32 (i32.const 536870910)) + (global $std/array/randomStringsActual (mut i32) (i32.const 1216)) + (global $std/array/randomStringsExpected (mut i32) (i32.const 1288)) (global $std/array/randomStrings400 (mut i32) (i32.const 0)) - (global $HEAP_BASE i32 (i32.const 820)) - (table 51 51 anyfunc) - (elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|4 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|18 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|29 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|33 $start~anonymous|34 $start~anonymous|35 $start~anonymous|36 $start~anonymous|37 $start~anonymous|38 $start~anonymous|39 $start~anonymous|40 $start~anonymous|41 $~lib/internal/array/defaultComparator~compare|42 $start~anonymous|43 $start~anonymous|44 $start~anonymous|45 $start~anonymous|46 $start~anonymous|47 $start~anonymous|48 $start~anonymous|49 $start~anonymous|50) + (global $HEAP_BASE i32 (i32.const 1396)) + (table 55 55 anyfunc) + (elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~anonymous|2 $start~anonymous|3 $start~anonymous|4 $start~anonymous|5 $start~anonymous|6 $start~anonymous|7 $start~anonymous|8 $start~anonymous|9 $start~anonymous|10 $start~anonymous|11 $start~anonymous|12 $start~anonymous|13 $start~anonymous|14 $start~anonymous|15 $start~anonymous|16 $start~anonymous|17 $start~anonymous|18 $start~anonymous|19 $start~anonymous|20 $start~anonymous|21 $start~anonymous|22 $start~anonymous|23 $start~anonymous|24 $start~anonymous|25 $start~anonymous|26 $start~anonymous|27 $start~anonymous|28 $start~anonymous|29 $start~anonymous|30 $start~anonymous|31 $start~anonymous|32 $start~anonymous|33 $start~anonymous|34 $start~anonymous|35 $start~anonymous|36 $start~anonymous|37 $start~anonymous|38 $start~anonymous|39 $start~anonymous|40 $start~anonymous|41 $~lib/array/Array#sort|trampoline~anonymous|42 $~lib/array/Array#sort|trampoline~anonymous|43 $~lib/array/Array#sort|trampoline~anonymous|44 $~lib/array/Array#sort|trampoline~anonymous|45 $std/array/assertSortedDefault~anonymous|46 $start~anonymous|47 $start~anonymous|48 $start~anonymous|49 $start~anonymous|50 $start~anonymous|51 $start~anonymous|52 $start~anonymous|53 $start~anonymous|54) (memory $0 1) (data (i32.const 8) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 40) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (data (i32.const 104) "\0c\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 136) "\0c\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") (data (i32.const 168) "V\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\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 344) "\00\00\00\00\00\00\00\00") - (data (i32.const 352) "X\01\00\00\00\00\00\00") - (data (i32.const 360) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 376) "h\01\00\00\01\00\00\00") - (data (i32.const 384) "\08\00\00\00\00\00\00\00\02\00\00\00\01\00\00\00") - (data (i32.const 400) "\80\01\00\00\02\00\00\00") - (data (i32.const 408) "\10\00\00\00\00\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 440) "\98\01\00\00\04\00\00\00") - (data (i32.const 448) "\10\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 480) "\c0\01\00\00\04\00\00\00") - (data (i32.const 488) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 504) "\e8\01\00\00\01\00\00\00") - (data (i32.const 512) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 528) "\00\02\00\00\02\00\00\00") - (data (i32.const 536) "\01\00\00\00a\00") - (data (i32.const 544) "\01\00\00\00b\00") - (data (i32.const 552) "\02\00\00\00a\00b\00") - (data (i32.const 560) "\02\00\00\00b\00a\00") - (data (i32.const 568) "\00\00\00\00") - (data (i32.const 576) "\1c\00\00\00\00\00\00\00\18\02\00\00 \02\00\00\18\02\00\00(\02\00\000\02\00\008\02\00\00\00\00\00\00\00\00\00\00\00\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 640) "@\02\00\00\07\00\00\00") - (data (i32.const 648) "\1c\00\00\00\00\00\00\008\02\00\00\18\02\00\00\18\02\00\00(\02\00\00 \02\00\000\02\00\00\00\00\00\00\00\00\00\00\00\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 712) "\88\02\00\00\07\00\00\00") - (data (i32.const 720) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 752) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") - (data (i32.const 808) "\04\00\00\00n\00u\00l\00l\00") + (data (i32.const 344) " \00\00\00\00\00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f\00\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 408) "X\01\00\00\08\00\00\00") + (data (i32.const 416) " \00\00\00\00\00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f\00\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 480) "\a0\01\00\00\08\00\00\00") + (data (i32.const 488) "@\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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 616) "\e8\01\00\00\08\00\00\00") + (data (i32.const 624) "@\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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 752) "p\02\00\00\08\00\00\00") + (data (i32.const 760) "\14\00\00\00\00\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00\00\00\00\00") + (data (i32.const 792) "\f8\02\00\00\05\00\00\00") + (data (i32.const 800) "\14\00\00\00\00\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00") + (data (i32.const 832) " \03\00\00\05\00\00\00") + (data (i32.const 840) "\14\00\00\00\00\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00\00\00\00\00") + (data (i32.const 872) "H\03\00\00\05\00\00\00") + (data (i32.const 880) "\14\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00") + (data (i32.const 912) "p\03\00\00\05\00\00\00") + (data (i32.const 920) "\00\00\00\00\00\00\00\00") + (data (i32.const 928) "\98\03\00\00\00\00\00\00") + (data (i32.const 936) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 952) "\a8\03\00\00\01\00\00\00") + (data (i32.const 960) "\08\00\00\00\00\00\00\00\02\00\00\00\01\00\00\00") + (data (i32.const 976) "\c0\03\00\00\02\00\00\00") + (data (i32.const 984) "\10\00\00\00\00\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 1016) "\d8\03\00\00\04\00\00\00") + (data (i32.const 1024) "\10\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 1056) "\00\04\00\00\04\00\00\00") + (data (i32.const 1064) "\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 1080) "(\04\00\00\01\00\00\00") + (data (i32.const 1088) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 1104) "@\04\00\00\02\00\00\00") + (data (i32.const 1112) "\01\00\00\00a\00") + (data (i32.const 1120) "\01\00\00\00b\00") + (data (i32.const 1128) "\02\00\00\00a\00b\00") + (data (i32.const 1136) "\02\00\00\00b\00a\00") + (data (i32.const 1144) "\00\00\00\00") + (data (i32.const 1152) "\1c\00\00\00\00\00\00\00X\04\00\00`\04\00\00X\04\00\00h\04\00\00p\04\00\00x\04\00\00\00\00\00\00\00\00\00\00\00\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 1216) "\80\04\00\00\07\00\00\00") + (data (i32.const 1224) "\1c\00\00\00\00\00\00\00x\04\00\00X\04\00\00X\04\00\00h\04\00\00`\04\00\00p\04\00\00\00\00\00\00\00\00\00\00\00\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 1288) "\c8\04\00\00\07\00\00\00") + (data (i32.const 1296) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 1328) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00") + (data (i32.const 1384) "\04\00\00\00n\00u\00l\00l\00") (export "memory" (memory $0)) (export "table" (table $0)) (start $start) @@ -703,12 +729,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#get:length (; 8 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $std/array/internalCapacity (; 9 ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/internalCapacity (; 8 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (set_local $1 (i32.load @@ -722,7 +743,7 @@ (i32.const 2) ) ) - (func $~lib/internal/memory/memcpy (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memcpy (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2524,7 +2545,7 @@ ) ) ) - (func $~lib/internal/memory/memmove (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memmove (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (if (i32.eq @@ -2842,7 +2863,7 @@ ) ) ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/arraybuffer/reallocateUnsafe (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3005,7 +3026,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#push (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#push (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3049,7 +3070,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 145) + (i32.const 146) (i32.const 42) ) (unreachable) @@ -3088,7 +3109,7 @@ ) (get_local $5) ) - (func $~lib/array/Array#__get (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (set_local $2 (i32.load @@ -3119,7 +3140,7 @@ (unreachable) ) ) - (func $~lib/array/Array#pop (; 15 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/array/Array#pop (; 14 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3138,7 +3159,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 157) + (i32.const 158) (i32.const 20) ) (unreachable) @@ -3176,7 +3197,7 @@ ) (get_local $4) ) - (func $~lib/array/Array#unshift (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#unshift (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3223,7 +3244,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 247) + (i32.const 248) (i32.const 42) ) (unreachable) @@ -3304,7 +3325,7 @@ ) (get_local $5) ) - (func $~lib/array/Array#shift (; 17 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/array/Array#shift (; 16 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3326,7 +3347,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 218) + (i32.const 219) (i32.const 20) ) (unreachable) @@ -3408,7 +3429,7 @@ ) (get_local $4) ) - (func $~lib/array/Array#reverse (; 18 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/array/Array#reverse (; 17 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -3513,7 +3534,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#indexOf (; 19 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#indexOf (; 18 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3611,7 +3632,7 @@ ) (i32.const -1) ) - (func $~lib/array/Array#includes (; 20 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#includes (; 19 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3709,7 +3730,7 @@ ) (i32.const 0) ) - (func $~lib/array/Array#splice (; 21 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#splice (; 20 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3827,7 +3848,7 @@ ) ) ) - (func $~lib/array/Array#__set (; 22 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 21 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (set_local $3 @@ -3858,7 +3879,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -3902,13 +3923,13 @@ ) ) ) - (func $start~anonymous|0 (; 23 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|0 (; 22 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 0) ) ) - (func $~lib/array/Array#findIndex (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#findIndex (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3989,19 +4010,19 @@ ) (i32.const -1) ) - (func $start~anonymous|1 (; 25 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|1 (; 24 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 1) ) ) - (func $start~anonymous|2 (; 26 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|2 (; 25 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 100) ) ) - (func $start~anonymous|3 (; 27 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|3 (; 26 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4013,13 +4034,13 @@ (i32.const 100) ) ) - (func $start~anonymous|4 (; 28 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|4 (; 27 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.eq (get_local $0) (i32.const 100) ) ) - (func $start~anonymous|5 (; 29 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|5 (; 28 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4030,13 +4051,13 @@ (i32.const 100) ) ) - (func $start~anonymous|6 (; 30 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|6 (; 29 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 0) ) ) - (func $~lib/array/Array#every (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#every (; 30 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4119,13 +4140,13 @@ ) (i32.const 1) ) - (func $start~anonymous|7 (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|7 (; 31 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const 0) ) ) - (func $start~anonymous|8 (; 33 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|8 (; 32 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4137,13 +4158,13 @@ (i32.const 10) ) ) - (func $start~anonymous|9 (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|9 (; 33 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.lt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|10 (; 35 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|10 (; 34 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4154,13 +4175,13 @@ (i32.const 3) ) ) - (func $start~anonymous|11 (; 36 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|11 (; 35 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 3) ) ) - (func $~lib/array/Array#some (; 37 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#some (; 36 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4241,13 +4262,13 @@ ) (i32.const 0) ) - (func $start~anonymous|12 (; 38 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|12 (; 37 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.le_s (get_local $0) (i32.const -1) ) ) - (func $start~anonymous|13 (; 39 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|13 (; 38 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4259,13 +4280,13 @@ (i32.const 10) ) ) - (func $start~anonymous|14 (; 40 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|14 (; 39 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.gt_s (get_local $0) (i32.const 10) ) ) - (func $start~anonymous|15 (; 41 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|15 (; 40 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4276,7 +4297,7 @@ (i32.const 3) ) ) - (func $start~anonymous|16 (; 42 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|16 (; 41 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4284,7 +4305,7 @@ ) ) ) - (func $~lib/array/Array#forEach (; 43 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $~lib/array/Array#forEach (; 42 ;) (type $iiv) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4356,7 +4377,7 @@ ) ) ) - (func $start~anonymous|17 (; 44 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|17 (; 43 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4370,7 +4391,7 @@ ) ) ) - (func $start~anonymous|18 (; 45 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|18 (; 44 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4378,7 +4399,7 @@ ) ) ) - (func $start~anonymous|19 (; 46 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $start~anonymous|19 (; 45 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4391,12 +4412,12 @@ ) ) ) - (func $start~anonymous|20 (; 47 ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) + (func $start~anonymous|20 (; 46 ;) (type $iiif) (param $0 i32) (param $1 i32) (param $2 i32) (result f32) (f32.convert_s/i32 (get_local $0) ) ) - (func $~lib/array/Array#constructor (; 48 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 47 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4476,7 +4497,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#map (; 49 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 48 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4575,12 +4596,7 @@ ) (get_local $4) ) - (func $~lib/array/Array#get:length (; 50 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 51 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__get (; 49 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (local $2 i32) (set_local $2 (i32.load @@ -4611,7 +4627,7 @@ (unreachable) ) ) - (func $start~anonymous|21 (; 52 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|21 (; 50 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4626,7 +4642,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#map (; 53 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#map (; 51 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4724,7 +4740,7 @@ ) (get_local $4) ) - (func $start~anonymous|22 (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|22 (; 52 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4733,7 +4749,7 @@ ) (get_local $0) ) - (func $start~anonymous|23 (; 55 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|23 (; 53 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4747,13 +4763,13 @@ ) (get_local $0) ) - (func $start~anonymous|24 (; 56 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|24 (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (i32.ge_s (get_local $0) (i32.const 2) ) ) - (func $~lib/array/Array#filter (; 57 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#filter (; 55 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4847,7 +4863,7 @@ ) (get_local $4) ) - (func $start~anonymous|25 (; 58 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|25 (; 56 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $2) @@ -4865,7 +4881,7 @@ (i32.const 2) ) ) - (func $start~anonymous|26 (; 59 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|26 (; 57 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (set_global $std/array/i (i32.add (get_global $std/array/i) @@ -4877,7 +4893,7 @@ (i32.const 2) ) ) - (func $start~anonymous|27 (; 60 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $start~anonymous|27 (; 58 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $2) @@ -4894,13 +4910,13 @@ (i32.const 2) ) ) - (func $start~anonymous|28 (; 61 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|28 (; 59 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $~lib/array/Array#reduce (; 62 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 60 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4980,13 +4996,13 @@ ) (get_local $3) ) - (func $start~anonymous|29 (; 63 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|29 (; 61 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|30 (; 64 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|30 (; 62 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -4999,7 +5015,7 @@ ) ) ) - (func $~lib/array/Array#reduce (; 65 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduce (; 63 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5079,7 +5095,7 @@ ) (get_local $3) ) - (func $start~anonymous|31 (; 66 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|31 (; 64 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -5092,7 +5108,7 @@ ) ) ) - (func $start~anonymous|32 (; 67 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|32 (; 65 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $3) @@ -5104,13 +5120,13 @@ (get_local $1) ) ) - (func $start~anonymous|33 (; 68 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|33 (; 66 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|34 (; 69 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|34 (; 67 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $3) @@ -5121,13 +5137,13 @@ (get_local $1) ) ) - (func $start~anonymous|35 (; 70 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|35 (; 68 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $~lib/array/Array#reduceRight (; 71 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 69 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5192,13 +5208,13 @@ ) (get_local $3) ) - (func $start~anonymous|36 (; 72 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|36 (; 70 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|37 (; 73 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|37 (; 71 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -5211,7 +5227,7 @@ ) ) ) - (func $~lib/array/Array#reduceRight (; 74 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/array/Array#reduceRight (; 72 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5276,7 +5292,7 @@ ) (get_local $3) ) - (func $start~anonymous|38 (; 75 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|38 (; 73 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (if (result i32) (i32.and (get_local $0) @@ -5289,7 +5305,7 @@ ) ) ) - (func $start~anonymous|39 (; 76 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|39 (; 74 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#push (get_local $3) @@ -5301,13 +5317,13 @@ (get_local $1) ) ) - (func $start~anonymous|40 (; 77 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|40 (; 75 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (i32.add (get_local $0) (get_local $1) ) ) - (func $start~anonymous|41 (; 78 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $start~anonymous|41 (; 76 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (drop (call $~lib/array/Array#pop (get_local $3) @@ -5318,7 +5334,7 @@ (get_local $1) ) ) - (func $~lib/math/murmurHash3 (; 79 ;) (type $II) (param $0 i64) (result i64) + (func $~lib/math/murmurHash3 (; 77 ;) (type $II) (param $0 i64) (result i64) (set_local $0 (i64.xor (get_local $0) @@ -5360,7 +5376,7 @@ ) (get_local $0) ) - (func $~lib/math/NativeMath.seedRandom (; 80 ;) (type $Iv) (param $0 i64) + (func $~lib/math/NativeMath.seedRandom (; 78 ;) (type $Iv) (param $0 i64) (if (i64.eqz (get_local $0) @@ -5389,241 +5405,36 @@ ) ) ) - (func $std/array/createReverseOrderedArray (; 81 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (set_local $1 - (call $~lib/array/Array#constructor - (i32.const 0) - (get_local $0) - ) - ) - (block $break|0 - (set_local $2 - (i32.const 0) - ) - (loop $repeat|0 - (br_if $break|0 - (i32.eqz - (i32.lt_s - (get_local $2) - (call $~lib/array/Array#get:length - (get_local $1) - ) - ) - ) - ) - (call $~lib/array/Array#__set - (get_local $1) - (get_local $2) - (i32.sub - (i32.sub - (call $~lib/array/Array#get:length - (get_local $1) - ) - (i32.const 1) - ) - (get_local $2) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (br $repeat|0) - ) - ) - (get_local $1) - ) - (func $~lib/math/NativeMath.random (; 82 ;) (type $F) (result f64) - (local $0 i64) - (local $1 i64) - (local $2 i64) - (if - (i32.eqz - (get_global $~lib/math/random_seeded) - ) - (block - (call $~lib/env/abort - (i32.const 0) - (i32.const 136) - (i32.const 1007) - (i32.const 24) - ) - (unreachable) - ) - ) - (set_local $0 - (get_global $~lib/math/random_state0) - ) - (set_local $1 - (get_global $~lib/math/random_state1) - ) - (set_global $~lib/math/random_state0 - (get_local $1) - ) - (set_local $0 - (i64.xor - (get_local $0) - (i64.shl - (get_local $0) - (i64.const 23) - ) - ) - ) - (set_local $0 - (i64.xor - (get_local $0) - (i64.shr_u - (get_local $0) - (i64.const 17) - ) - ) - ) - (set_local $0 - (i64.xor - (get_local $0) - (get_local $1) - ) - ) - (set_local $0 - (i64.xor - (get_local $0) - (i64.shr_u - (get_local $1) - (i64.const 26) - ) - ) - ) - (set_global $~lib/math/random_state1 - (get_local $0) - ) - (set_local $2 - (i64.or - (i64.and - (i64.add - (get_local $1) - (get_local $0) - ) - (i64.const 4503599627370495) - ) - (i64.const 4607182418800017408) - ) - ) - (f64.sub - (f64.reinterpret/i64 - (get_local $2) - ) - (f64.const 1) - ) - ) - (func $std/array/createRandomOrderedArray (; 83 ;) (type $ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (set_local $1 - (call $~lib/array/Array#constructor - (i32.const 0) - (get_local $0) - ) - ) - (block $break|0 - (set_local $2 - (i32.const 0) - ) - (loop $repeat|0 - (br_if $break|0 - (i32.eqz - (i32.lt_s - (get_local $2) - (call $~lib/array/Array#get:length - (get_local $1) - ) - ) - ) - ) - (call $~lib/array/Array#__set - (get_local $1) - (get_local $2) - (i32.trunc_s/f64 - (f64.mul - (call $~lib/math/NativeMath.random) - (f64.convert_s/i32 - (call $~lib/array/Array#get:length - (get_local $1) - ) - ) - ) - ) - ) - (set_local $2 - (i32.add - (get_local $2) - (i32.const 1) - ) - ) - (br $repeat|0) - ) - ) - (get_local $1) - ) - (func $~lib/internal/array/defaultComparator~compare|42 (; 84 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (i32.sub - (i32.gt_s - (get_local $0) - (get_local $1) - ) - (i32.lt_s - (get_local $0) - (get_local $1) - ) - ) - ) - (func $~lib/internal/array/defaultComparator (; 85 ;) (type $i) (result i32) - (i32.const 42) - ) - (func $~lib/internal/array/insertionSort (; 86 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/internal/array/insertionSort (; 79 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) - (local $5 i32) + (local $5 f32) (local $6 i32) - (local $7 i32) + (local $7 f32) (local $8 i32) - (set_local $2 - (i32.load - (get_local $0) - ) - ) (block $break|0 - (block - (set_local $3 - (i32.const 0) - ) - (set_local $4 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) + (set_local $4 + (i32.const 0) ) (loop $repeat|0 (br_if $break|0 (i32.eqz (i32.lt_s - (get_local $3) (get_local $4) + (get_local $2) ) ) ) (block (set_local $5 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.25 (result i32) - (i32.load offset=8 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result f32) + (f32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) @@ -5632,7 +5443,7 @@ ) (set_local $6 (i32.sub - (get_local $3) + (get_local $4) (i32.const 1) ) ) @@ -5646,10 +5457,13 @@ (block (block (set_local $7 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.26 (result i32) - (i32.load offset=8 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result f32) + (f32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $6) (i32.const 2) @@ -5664,15 +5478,15 @@ (set_global $~argc (i32.const 2) ) - (call_indirect (type $iii) + (call_indirect (type $ffi) (get_local $5) (get_local $7) - (get_local $1) + (get_local $3) ) ) (i32.const 0) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.9 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.0 (set_local $8 (i32.add (block (result i32) @@ -5690,9 +5504,12 @@ (i32.const 1) ) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -5709,18 +5526,21 @@ ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.10 - (set_local $7 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.1 + (set_local $8 (i32.add (get_local $6) (i32.const 1) ) ) - (i32.store offset=8 + (f32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $7) + (get_local $8) (i32.const 2) ) ) @@ -5728,38 +5548,30 @@ ) ) ) - (set_local $3 + (set_local $4 (i32.add - (get_local $3) + (get_local $4) (i32.const 1) ) ) (br $repeat|0) ) ) - (get_local $0) ) - (func $~lib/allocator/arena/__memory_free (; 87 ;) (type $iv) (param $0 i32) + (func $~lib/allocator/arena/__memory_free (; 80 ;) (type $iv) (param $0 i32) (nop) ) - (func $~lib/internal/array/weakHeapSort (; 88 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/internal/array/weakHeapSort (; 81 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (local $9 i32) - (local $10 i32) + (local $9 f32) + (local $10 f32) (local $11 i32) - (local $12 i32) - (set_local $2 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) - (set_local $3 + (local $12 f32) + (set_local $4 (i32.shl (i32.shr_s (i32.add @@ -5771,32 +5583,27 @@ (i32.const 2) ) ) - (set_local $4 + (set_local $5 (block $~lib/memory/memory.allocate|inlined.1 (result i32) (br $~lib/memory/memory.allocate|inlined.1 (call $~lib/allocator/arena/__memory_allocate - (get_local $3) + (get_local $4) ) ) ) ) (block $~lib/memory/memory.fill|inlined.4 - (set_local $5 + (set_local $6 (i32.const 0) ) (call $~lib/internal/memory/memset - (get_local $4) (get_local $5) - (get_local $3) - ) - ) - (set_local $6 - (i32.load - (get_local $0) + (get_local $6) + (get_local $4) ) ) (block $break|0 - (set_local $5 + (set_local $6 (i32.sub (get_local $2) (i32.const 1) @@ -5806,14 +5613,14 @@ (br_if $break|0 (i32.eqz (i32.gt_s - (get_local $5) + (get_local $6) (i32.const 0) ) ) ) (block (set_local $7 - (get_local $5) + (get_local $6) ) (block $break|1 (loop $continue|1 @@ -5827,7 +5634,7 @@ (i32.shr_u (i32.load (i32.add - (get_local $4) + (get_local $5) (i32.shl (i32.shr_s (get_local $7) @@ -5867,10 +5674,13 @@ ) ) (set_local $9 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.27 (result i32) - (i32.load offset=8 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result f32) + (f32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -5880,12 +5690,2214 @@ ) ) (set_local $10 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.28 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result f32) + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $ffi) + (get_local $9) + (get_local $10) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $6) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.2 + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.3 + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + (get_local $10) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (block $break|2 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|2 + (br_if $break|2 + (i32.eqz + (i32.ge_s + (get_local $6) + (i32.const 2) + ) + ) + ) + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result f32) + (set_local $8 + (i32.const 0) + ) + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.4 + (set_local $8 + (i32.const 0) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result f32) + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.5 + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $10) + ) + ) + (set_local $8 + (i32.const 1) + ) + (block $break|3 + (loop $continue|3 + (if + (i32.lt_s + (tee_local $7 + (i32.add + (i32.shl + (get_local $8) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + ) + (get_local $6) + ) + (block + (set_local $8 + (get_local $7) + ) + (br $continue|3) + ) + ) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.gt_s + (get_local $8) + (i32.const 0) + ) + (block + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result f32) + (set_local $11 + (i32.const 0) + ) + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $11) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result f32) + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $ffi) + (get_local $10) + (get_local $9) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.6 + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + (get_local $10) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.7 + (set_local $11 + (i32.const 0) + ) + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $11) + (i32.const 2) + ) + ) + (get_local $9) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $8) + (i32.const 1) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|2) + ) + ) + (block $~lib/memory/memory.free|inlined.0 + (block + (call $~lib/allocator/arena/__memory_free + (get_local $5) + ) + (br $~lib/memory/memory.free|inlined.0) + ) + ) + (set_local $12 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result f32) + (set_local $6 + (i32.const 1) + ) + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.8 + (set_local $6 + (i32.const 1) + ) + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result f32) + (set_local $7 + (i32.const 0) + ) + (f32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $7) + (i32.const 2) + ) + ) + ) + ) + ) + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $10) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.9 + (set_local $6 + (i32.const 0) + ) + (f32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $12) + ) + ) + ) + (func $~lib/array/Array#sort (; 82 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f32) + (local $6 f32) + (if + (i32.eqz + (get_local $1) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 311) + (i32.const 4) + ) + (unreachable) + ) + ) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + (if + (i32.le_s + (get_local $2) + (i32.const 1) + ) + (return + (get_local $0) + ) + ) + (set_local $3 + (i32.load + (get_local $0) + ) + ) + (if + (i32.eq + (get_local $2) + (i32.const 2) + ) + (block + (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result f32) + (set_local $4 + (i32.const 1) + ) + (f32.load offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $6 + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result f32) + (set_local $4 + (i32.const 0) + ) + (f32.load offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $ffi) + (get_local $5) + (get_local $6) + (get_local $1) + ) + ) + (i32.const 0) + ) + (block + (block $~lib/internal/arraybuffer/storeUnsafe|inlined.1 + (set_local $4 + (i32.const 1) + ) + (f32.store offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + (get_local $6) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafe|inlined.2 + (set_local $4 + (i32.const 0) + ) + (f32.store offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + (get_local $5) + ) + ) + ) + ) + (return + (get_local $0) + ) + ) + ) + (if + (i32.lt_s + (get_local $2) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + ) + (return + (get_local $0) + ) + ) + (func $~lib/array/Array#sort|trampoline~anonymous|42 (; 83 ;) (type $ffi) (param $0 f32) (param $1 f32) (result i32) + (local $2 i32) + (local $3 i32) + (set_local $2 + (i32.reinterpret/f32 + (get_local $0) + ) + ) + (set_local $3 + (i32.reinterpret/f32 + (get_local $1) + ) + ) + (set_local $2 + (i32.xor + (get_local $2) + (i32.shr_u + (i32.shr_s + (get_local $2) + (i32.const 31) + ) + (i32.const 1) + ) + ) + ) + (set_local $3 + (i32.xor + (get_local $3) + (i32.shr_u + (i32.shr_s + (get_local $3) + (i32.const 31) + ) + (i32.const 1) + ) + ) + ) + (i32.sub + (i32.gt_s + (get_local $2) + (get_local $3) + ) + (i32.lt_s + (get_local $2) + (get_local $3) + ) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 84 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) + (br $~lib/internal/array/defaultComparator|inlined.0 + (i32.const 42) + ) + ) + ) + ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/builtins/isNaN (; 85 ;) (type $fi) (param $0 f32) (result i32) + (f32.ne + (get_local $0) + (get_local $0) + ) + ) + (func $std/array/isArraysEqual (; 86 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (if + (i32.eqz + (get_local $2) + ) + (block + (if + (i32.ne + (block $~lib/array/Array#get:length|inlined.3 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + (block $~lib/array/Array#get:length|inlined.4 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $2 + (block $~lib/array/Array#get:length|inlined.5 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + ) + (block $break|0 + (set_local $3 + (i32.const 0) + ) + (loop $repeat|0 + (block $continue|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $3) + (get_local $2) + ) + ) + ) + (block + (if + (if (result i32) + (tee_local $4 + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + ) + (i32.eq + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + ) + (get_local $4) + ) + (br $continue|0) + ) + (if + (f32.ne + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + (return + (i32.const 0) + ) + ) + ) + ) + (set_local $3 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (i32.const 1) + ) + (func $~lib/internal/array/insertionSort (; 87 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 f64) + (local $6 i32) + (local $7 f64) + (local $8 i32) + (block $break|0 + (set_local $4 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $4) + (get_local $2) + ) + ) + ) + (block + (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_s + (get_local $6) + (i32.const 0) + ) + (block + (block + (set_local $7 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $5) + (get_local $7) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.0 + (set_local $8 + (i32.add + (block (result i32) + (set_local $8 + (get_local $6) + ) + (set_local $6 + (i32.sub + (get_local $8) + (i32.const 1) + ) + ) + (get_local $8) + ) + (i32.const 1) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $7) + ) + ) + (br $break|1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.1 + (set_local $8 + (i32.add + (get_local $6) + (i32.const 1) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $4 + (i32.add + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + (func $~lib/internal/array/weakHeapSort (; 88 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 f64) + (local $10 f64) + (local $11 i32) + (local $12 f64) + (set_local $4 + (i32.shl + (i32.shr_s + (i32.add + (get_local $2) + (i32.const 31) + ) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (set_local $5 + (block $~lib/memory/memory.allocate|inlined.2 (result i32) + (br $~lib/memory/memory.allocate|inlined.2 + (call $~lib/allocator/arena/__memory_allocate + (get_local $4) + ) + ) + ) + ) + (block $~lib/memory/memory.fill|inlined.5 + (set_local $6 + (i32.const 0) + ) + (call $~lib/internal/memory/memset + (get_local $5) + (get_local $6) + (get_local $4) + ) + ) + (block $break|0 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.gt_s + (get_local $6) + (i32.const 0) + ) + ) + ) + (block + (set_local $7 + (get_local $6) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.eq + (i32.and + (get_local $7) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $7) + (i32.const 6) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + (block + (set_local $7 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $9) + (get_local $10) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $6) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.2 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.3 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (block $break|2 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|2 + (br_if $break|2 + (i32.eqz + (i32.ge_s + (get_local $6) + (i32.const 2) + ) + ) + ) + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result f64) + (set_local $8 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.4 + (set_local $8 + (i32.const 0) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.5 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + (set_local $8 + (i32.const 1) + ) + (block $break|3 + (loop $continue|3 + (if + (i32.lt_s + (tee_local $7 + (i32.add + (i32.shl + (get_local $8) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + ) + (get_local $6) + ) + (block + (set_local $8 + (get_local $7) + ) + (br $continue|3) + ) + ) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.gt_s + (get_local $8) + (i32.const 0) + ) + (block + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result f64) + (set_local $11 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $11) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $10) + (get_local $9) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.6 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.7 + (set_local $11 + (i32.const 0) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $11) + (i32.const 3) + ) + ) + (get_local $9) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $8) + (i32.const 1) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|2) + ) + ) + (block $~lib/memory/memory.free|inlined.1 + (block + (call $~lib/allocator/arena/__memory_free + (get_local $5) + ) + (br $~lib/memory/memory.free|inlined.1) + ) + ) + (set_local $12 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result f64) + (set_local $6 + (i32.const 1) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.8 + (set_local $6 + (i32.const 1) + ) + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result f64) + (set_local $7 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $7) + (i32.const 3) + ) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.9 + (set_local $6 + (i32.const 0) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $12) + ) + ) + ) + (func $~lib/array/Array#sort (; 89 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f64) + (local $6 f64) + (if + (i32.eqz + (get_local $1) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 311) + (i32.const 4) + ) + (unreachable) + ) + ) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + (if + (i32.le_s + (get_local $2) + (i32.const 1) + ) + (return + (get_local $0) + ) + ) + (set_local $3 + (i32.load + (get_local $0) + ) + ) + (if + (i32.eq + (get_local $2) + (i32.const 2) + ) + (block + (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result f64) + (set_local $4 + (i32.const 1) + ) + (f64.load offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $6 + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result f64) + (set_local $4 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $5) + (get_local $6) + (get_local $1) + ) + ) + (i32.const 0) + ) + (block + (block $~lib/internal/arraybuffer/storeUnsafe|inlined.0 + (set_local $4 + (i32.const 1) + ) + (f64.store offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + (get_local $6) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafe|inlined.1 + (set_local $4 + (i32.const 0) + ) + (f64.store offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + (get_local $5) + ) + ) + ) + ) + (return + (get_local $0) + ) + ) + ) + (if + (i32.lt_s + (get_local $2) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + ) + (return + (get_local $0) + ) + ) + (func $~lib/array/Array#sort|trampoline~anonymous|43 (; 90 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (local $2 i64) + (local $3 i64) + (set_local $2 + (i64.reinterpret/f64 + (get_local $0) + ) + ) + (set_local $3 + (i64.reinterpret/f64 + (get_local $1) + ) + ) + (set_local $2 + (i64.xor + (get_local $2) + (i64.shr_u + (i64.shr_s + (get_local $2) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + (set_local $3 + (i64.xor + (get_local $3) + (i64.shr_u + (i64.shr_s + (get_local $3) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + (i32.sub + (i64.gt_s + (get_local $2) + (get_local $3) + ) + (i64.lt_s + (get_local $2) + (get_local $3) + ) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 91 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) + (br $~lib/internal/array/defaultComparator|inlined.0 + (i32.const 43) + ) + ) + ) + ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/array/Array#__get (; 92 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (local $2 i32) + (set_local $2 + (i32.load + (get_local $0) + ) + ) + (if (result f64) + (i32.lt_u + (get_local $1) + (i32.shr_u + (i32.load + (get_local $2) + ) + (i32.const 3) + ) + ) + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result f64) + (f64.load offset=8 + (i32.add + (get_local $2) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + ) + ) + (unreachable) + ) + ) + (func $~lib/builtins/isNaN (; 93 ;) (type $Fi) (param $0 f64) (result i32) + (f64.ne + (get_local $0) + (get_local $0) + ) + ) + (func $std/array/isArraysEqual (; 94 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (if + (i32.eqz + (get_local $2) + ) + (block + (if + (i32.ne + (block $~lib/array/Array#get:length|inlined.2 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + (block $~lib/array/Array#get:length|inlined.3 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $2 + (block $~lib/array/Array#get:length|inlined.4 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + ) + (block $break|0 + (set_local $3 + (i32.const 0) + ) + (loop $repeat|0 + (block $continue|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $3) + (get_local $2) + ) + ) + ) + (block + (if + (if (result i32) + (tee_local $4 + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + ) + (i32.eq + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + ) + (call $~lib/builtins/isNaN + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + ) + (get_local $4) + ) + (br $continue|0) + ) + (if + (f64.ne + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + (return + (i32.const 0) + ) + ) + ) + ) + (set_local $3 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (i32.const 1) + ) + (func $~lib/internal/array/insertionSort (; 95 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (block $break|0 + (set_local $4 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $4) + (get_local $2) + ) + ) + ) + (block + (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) (i32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $5) + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_s + (get_local $6) + (i32.const 0) + ) + (block + (block + (set_local $7 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $iii) + (get_local $5) + (get_local $7) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.0 + (set_local $8 + (i32.add + (block (result i32) + (set_local $8 + (get_local $6) + ) + (set_local $6 + (i32.sub + (get_local $8) + (i32.const 1) + ) + ) + (get_local $8) + ) + (i32.const 1) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + (get_local $7) + ) + ) + (br $break|1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.1 + (set_local $7 + (i32.add + (get_local $6) + (i32.const 1) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $7) + (i32.const 2) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $4 + (i32.add + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + (func $~lib/internal/array/weakHeapSort (; 96 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $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 $12 i32) + (set_local $4 + (i32.shl + (i32.shr_s + (i32.add + (get_local $2) + (i32.const 31) + ) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (set_local $5 + (block $~lib/memory/memory.allocate|inlined.3 (result i32) + (br $~lib/memory/memory.allocate|inlined.3 + (call $~lib/allocator/arena/__memory_allocate + (get_local $4) + ) + ) + ) + ) + (block $~lib/memory/memory.fill|inlined.6 + (set_local $6 + (i32.const 0) + ) + (call $~lib/internal/memory/memset + (get_local $5) + (get_local $6) + (get_local $4) + ) + ) + (block $break|0 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.gt_s + (get_local $6) + (i32.const 0) + ) + ) + ) + (block + (set_local $7 + (get_local $6) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.eq + (i32.and + (get_local $7) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $7) + (i32.const 6) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + (block + (set_local $7 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) (i32.const 2) ) ) @@ -5901,7 +7913,7 @@ (call_indirect (type $iii) (get_local $9) (get_local $10) - (get_local $1) + (get_local $3) ) ) (i32.const 0) @@ -5909,10 +7921,10 @@ (block (i32.store (i32.add - (get_local $4) + (get_local $5) (i32.shl (i32.shr_s - (get_local $5) + (get_local $6) (i32.const 5) ) (i32.const 2) @@ -5921,10 +7933,10 @@ (i32.xor (i32.load (i32.add - (get_local $4) + (get_local $5) (i32.shl (i32.shr_s - (get_local $5) + (get_local $6) (i32.const 5) ) (i32.const 2) @@ -5934,28 +7946,34 @@ (i32.shl (i32.const 1) (i32.and - (get_local $5) + (get_local $6) (i32.const 31) ) ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.11 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.2 (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $5) + (get_local $6) (i32.const 2) ) ) (get_local $9) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.12 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.3 (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -5967,9 +7985,9 @@ ) ) ) - (set_local $5 + (set_local $6 (i32.sub - (get_local $5) + (get_local $6) (i32.const 1) ) ) @@ -5977,7 +7995,7 @@ ) ) (block $break|2 - (set_local $5 + (set_local $6 (i32.sub (get_local $2) (i32.const 1) @@ -5987,20 +8005,23 @@ (br_if $break|2 (i32.eqz (i32.ge_s - (get_local $5) + (get_local $6) (i32.const 2) ) ) ) (block (set_local $10 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.29 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result i32) (set_local $10 (i32.const 0) ) (i32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $10) (i32.const 2) @@ -6009,17 +8030,20 @@ ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.13 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.4 (set_local $9 (i32.const 0) ) (set_local $8 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.30 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result i32) (i32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $5) + (get_local $6) (i32.const 2) ) ) @@ -6028,7 +8052,10 @@ ) (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $9) (i32.const 2) @@ -6037,12 +8064,15 @@ (get_local $8) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.14 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.5 (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $5) + (get_local $6) (i32.const 2) ) ) @@ -6066,7 +8096,7 @@ (i32.shr_u (i32.load (i32.add - (get_local $4) + (get_local $5) (i32.shl (i32.shr_s (get_local $8) @@ -6085,7 +8115,7 @@ ) ) ) - (get_local $5) + (get_local $6) ) (block (set_local $8 @@ -6106,13 +8136,16 @@ (block (block (set_local $10 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.31 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result i32) (set_local $7 (i32.const 0) ) (i32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $7) (i32.const 2) @@ -6122,10 +8155,13 @@ ) ) (set_local $7 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.32 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result i32) (i32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -6143,7 +8179,7 @@ (call_indirect (type $iii) (get_local $10) (get_local $7) - (get_local $1) + (get_local $3) ) ) (i32.const 0) @@ -6151,7 +8187,7 @@ (block (i32.store (i32.add - (get_local $4) + (get_local $5) (i32.shl (i32.shr_s (get_local $8) @@ -6163,7 +8199,7 @@ (i32.xor (i32.load (i32.add - (get_local $4) + (get_local $5) (i32.shl (i32.shr_s (get_local $8) @@ -6182,10 +8218,13 @@ ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.15 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.6 (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -6194,13 +8233,16 @@ (get_local $10) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.16 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.7 (set_local $11 (i32.const 0) ) (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $11) (i32.const 2) @@ -6224,51 +8266,57 @@ ) ) ) - (set_local $5 + (set_local $6 (i32.sub - (get_local $5) + (get_local $6) (i32.const 1) ) ) (br $repeat|2) ) ) - (block $~lib/memory/memory.free|inlined.0 + (block $~lib/memory/memory.free|inlined.2 (block (call $~lib/allocator/arena/__memory_free - (get_local $4) + (get_local $5) ) - (br $~lib/memory/memory.free|inlined.0) + (br $~lib/memory/memory.free|inlined.2) ) ) (set_local $12 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.33 (result i32) - (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result i32) + (set_local $6 (i32.const 1) ) (i32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $5) + (get_local $6) (i32.const 2) ) ) ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.17 - (set_local $5 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.8 + (set_local $6 (i32.const 1) ) (set_local $9 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.34 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result i32) (set_local $9 (i32.const 0) ) (i32.load offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $9) (i32.const 2) @@ -6279,22 +8327,28 @@ ) (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $5) + (get_local $6) (i32.const 2) ) ) (get_local $9) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.18 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.9 (set_local $9 (i32.const 0) ) (i32.store offset=8 (i32.add - (get_local $6) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $9) (i32.const 2) @@ -6303,9 +8357,8 @@ (get_local $12) ) ) - (get_local $0) ) - (func $~lib/array/Array#sort (; 89 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 97 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6319,7 +8372,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 310) + (i32.const 311) (i32.const 4) ) (unreachable) @@ -6434,24 +8487,1363 @@ ) ) ) + (if + (i32.lt_s + (get_local $2) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + ) (return - (if (result i32) - (i32.lt_s - (get_local $2) - (i32.const 256) + (get_local $0) + ) + ) + (func $~lib/array/Array#sort|trampoline~anonymous|44 (; 98 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.sub + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 99 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) ) - (call $~lib/internal/array/insertionSort - (get_local $0) - (get_local $1) - ) - (call $~lib/internal/array/weakHeapSort - (get_local $0) - (get_local $1) + (unreachable) + ) + (set_local $1 + (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) + (br $~lib/internal/array/defaultComparator|inlined.0 + (i32.const 44) + ) ) ) ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) ) - (func $std/array/isSorted (; 90 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isArraysEqual (; 100 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (if + (i32.eqz + (get_local $2) + ) + (block + (if + (i32.ne + (block $~lib/array/Array#get:length|inlined.31 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + (block $~lib/array/Array#get:length|inlined.32 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $2 + (block $~lib/array/Array#get:length|inlined.33 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + ) + (block $break|0 + (set_local $3 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $3) + (get_local $2) + ) + ) + ) + (if + (i32.ne + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $3 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (i32.const 1) + ) + (func $~lib/internal/array/insertionSort (; 101 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (block $break|0 + (set_local $4 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $4) + (get_local $2) + ) + ) + ) + (block + (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_s + (get_local $6) + (i32.const 0) + ) + (block + (block + (set_local $7 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $iii) + (get_local $5) + (get_local $7) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.0 + (set_local $8 + (i32.add + (block (result i32) + (set_local $8 + (get_local $6) + ) + (set_local $6 + (i32.sub + (get_local $8) + (i32.const 1) + ) + ) + (get_local $8) + ) + (i32.const 1) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + (get_local $7) + ) + ) + (br $break|1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.1 + (set_local $7 + (i32.add + (get_local $6) + (i32.const 1) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $7) + (i32.const 2) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $4 + (i32.add + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + (func $~lib/internal/array/weakHeapSort (; 102 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $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 $12 i32) + (set_local $4 + (i32.shl + (i32.shr_s + (i32.add + (get_local $2) + (i32.const 31) + ) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (set_local $5 + (block $~lib/memory/memory.allocate|inlined.4 (result i32) + (br $~lib/memory/memory.allocate|inlined.4 + (call $~lib/allocator/arena/__memory_allocate + (get_local $4) + ) + ) + ) + ) + (block $~lib/memory/memory.fill|inlined.7 + (set_local $6 + (i32.const 0) + ) + (call $~lib/internal/memory/memset + (get_local $5) + (get_local $6) + (get_local $4) + ) + ) + (block $break|0 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.gt_s + (get_local $6) + (i32.const 0) + ) + ) + ) + (block + (set_local $7 + (get_local $6) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.eq + (i32.and + (get_local $7) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $7) + (i32.const 6) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + (block + (set_local $7 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $iii) + (get_local $9) + (get_local $10) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $6) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.2 + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.3 + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + (get_local $10) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (block $break|2 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|2 + (br_if $break|2 + (i32.eqz + (i32.ge_s + (get_local $6) + (i32.const 2) + ) + ) + ) + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result i32) + (set_local $10 + (i32.const 0) + ) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $10) + (i32.const 2) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.4 + (set_local $9 + (i32.const 0) + ) + (set_local $8 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $9) + (i32.const 2) + ) + ) + (get_local $8) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.5 + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $10) + ) + ) + (set_local $8 + (i32.const 1) + ) + (block $break|3 + (loop $continue|3 + (if + (i32.lt_s + (tee_local $9 + (i32.add + (i32.shl + (get_local $8) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + ) + (get_local $6) + ) + (block + (set_local $8 + (get_local $9) + ) + (br $continue|3) + ) + ) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.gt_s + (get_local $8) + (i32.const 0) + ) + (block + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result i32) + (set_local $7 + (i32.const 0) + ) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $7) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $7 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result i32) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $iii) + (get_local $10) + (get_local $7) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.6 + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 2) + ) + ) + (get_local $10) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.7 + (set_local $11 + (i32.const 0) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $11) + (i32.const 2) + ) + ) + (get_local $7) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $8) + (i32.const 1) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|2) + ) + ) + (block $~lib/memory/memory.free|inlined.3 + (block + (call $~lib/allocator/arena/__memory_free + (get_local $5) + ) + (br $~lib/memory/memory.free|inlined.3) + ) + ) + (set_local $12 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result i32) + (set_local $6 + (i32.const 1) + ) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.8 + (set_local $6 + (i32.const 1) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result i32) + (set_local $9 + (i32.const 0) + ) + (i32.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $9) + (i32.const 2) + ) + ) + ) + ) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.9 + (set_local $9 + (i32.const 0) + ) + (i32.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $9) + (i32.const 2) + ) + ) + (get_local $12) + ) + ) + ) + (func $~lib/array/Array#sort (; 103 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (if + (i32.eqz + (get_local $1) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 311) + (i32.const 4) + ) + (unreachable) + ) + ) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + (if + (i32.le_s + (get_local $2) + (i32.const 1) + ) + (return + (get_local $0) + ) + ) + (set_local $3 + (i32.load + (get_local $0) + ) + ) + (if + (i32.eq + (get_local $2) + (i32.const 2) + ) + (block + (set_local $4 + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + (set_local $4 + (i32.const 1) + ) + (i32.load offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $4) + (i32.const 2) + ) + ) + ) + ) + ) + (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + (set_local $5 + (i32.const 0) + ) + (i32.load offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $5) + (i32.const 2) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $iii) + (get_local $4) + (get_local $5) + (get_local $1) + ) + ) + (i32.const 0) + ) + (block + (block $~lib/internal/arraybuffer/storeUnsafe|inlined.0 + (set_local $6 + (i32.const 1) + ) + (i32.store offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $5) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafe|inlined.1 + (set_local $6 + (i32.const 0) + ) + (i32.store offset=8 + (i32.add + (get_local $3) + (i32.shl + (get_local $6) + (i32.const 2) + ) + ) + (get_local $4) + ) + ) + ) + ) + (return + (get_local $0) + ) + ) + ) + (if + (i32.lt_s + (get_local $2) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) + ) + (return + (get_local $0) + ) + ) + (func $~lib/array/Array#sort|trampoline~anonymous|45 (; 104 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.sub + (i32.gt_u + (get_local $0) + (get_local $1) + ) + (i32.lt_u + (get_local $0) + (get_local $1) + ) + ) + ) + (func $~lib/array/Array#sort|trampoline (; 105 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) + (br $~lib/internal/array/defaultComparator|inlined.0 + (i32.const 45) + ) + ) + ) + ) + (call $~lib/array/Array#sort + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/array/Array#__get (; 106 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (set_local $2 + (i32.load + (get_local $0) + ) + ) + (if (result i32) + (i32.lt_u + (get_local $1) + (i32.shr_u + (i32.load + (get_local $2) + ) + (i32.const 2) + ) + ) + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + (i32.load offset=8 + (i32.add + (get_local $2) + (i32.shl + (get_local $1) + (i32.const 2) + ) + ) + ) + ) + (unreachable) + ) + ) + (func $std/array/isArraysEqual (; 107 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (if + (i32.eqz + (get_local $2) + ) + (block + (if + (i32.ne + (block $~lib/array/Array#get:length|inlined.2 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + (block $~lib/array/Array#get:length|inlined.3 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $2 + (block $~lib/array/Array#get:length|inlined.4 (result i32) + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + ) + (block $break|0 + (set_local $3 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $3) + (get_local $2) + ) + ) + ) + (if + (i32.ne + (call $~lib/array/Array#__get + (get_local $0) + (get_local $3) + ) + (call $~lib/array/Array#__get + (get_local $1) + (get_local $3) + ) + ) + (return + (i32.const 0) + ) + ) + (set_local $3 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (i32.const 1) + ) + (func $std/array/createReverseOrderedArray (; 108 ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (set_local $1 + (call $~lib/array/Array#constructor + (i32.const 0) + (get_local $0) + ) + ) + (block $break|0 + (set_local $2 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $2) + (block $~lib/array/Array#get:length|inlined.35 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + ) + ) + (call $~lib/array/Array#__set + (get_local $1) + (get_local $2) + (i32.sub + (i32.sub + (block $~lib/array/Array#get:length|inlined.36 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + (i32.const 1) + ) + (get_local $2) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (get_local $1) + ) + (func $~lib/math/NativeMath.random (; 109 ;) (type $F) (result f64) + (local $0 i64) + (local $1 i64) + (local $2 i64) + (if + (i32.eqz + (get_global $~lib/math/random_seeded) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 136) + (i32.const 1007) + (i32.const 24) + ) + (unreachable) + ) + ) + (set_local $0 + (get_global $~lib/math/random_state0) + ) + (set_local $1 + (get_global $~lib/math/random_state1) + ) + (set_global $~lib/math/random_state0 + (get_local $1) + ) + (set_local $0 + (i64.xor + (get_local $0) + (i64.shl + (get_local $0) + (i64.const 23) + ) + ) + ) + (set_local $0 + (i64.xor + (get_local $0) + (i64.shr_u + (get_local $0) + (i64.const 17) + ) + ) + ) + (set_local $0 + (i64.xor + (get_local $0) + (get_local $1) + ) + ) + (set_local $0 + (i64.xor + (get_local $0) + (i64.shr_u + (get_local $1) + (i64.const 26) + ) + ) + ) + (set_global $~lib/math/random_state1 + (get_local $0) + ) + (set_local $2 + (i64.or + (i64.and + (i64.add + (get_local $1) + (get_local $0) + ) + (i64.const 4503599627370495) + ) + (i64.const 4607182418800017408) + ) + ) + (f64.sub + (f64.reinterpret/i64 + (get_local $2) + ) + (f64.const 1) + ) + ) + (func $std/array/createRandomOrderedArray (; 110 ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (set_local $1 + (call $~lib/array/Array#constructor + (i32.const 0) + (get_local $0) + ) + ) + (block $break|0 + (set_local $2 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $2) + (block $~lib/array/Array#get:length|inlined.38 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + ) + ) + (call $~lib/array/Array#__set + (get_local $1) + (get_local $2) + (i32.trunc_s/f64 + (f64.mul + (call $~lib/math/NativeMath.random) + (f64.convert_s/i32 + (block $~lib/array/Array#get:length|inlined.39 (result i32) + (i32.load offset=4 + (get_local $1) + ) + ) + ) + ) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (get_local $1) + ) + (func $std/array/assertSortedDefault~anonymous|46 (; 111 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.sub + (get_local $0) + (get_local $1) + ) + ) + (func $std/array/isSorted (; 112 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (block $break|0 @@ -6460,8 +9852,10 @@ (i32.const 1) ) (set_local $3 - (call $~lib/array/Array#get:length - (get_local $0) + (block $~lib/array/Array#get:length|inlined.40 (result i32) + (i32.load offset=4 + (get_local $0) + ) ) ) ) @@ -6512,7 +9906,7 @@ ) (i32.const 1) ) - (func $std/array/assertSorted (; 91 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 113 ;) (type $iiv) (param $0 i32) (param $1 i32) (if (i32.eqz (call $std/array/isSorted @@ -6527,110 +9921,48 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 605) + (i32.const 608) (i32.const 2) ) (unreachable) ) ) ) - (func $std/array/assertSortedDefault (; 92 ;) (type $iv) (param $0 i32) + (func $std/array/assertSortedDefault (; 114 ;) (type $iv) (param $0 i32) (call $std/array/assertSorted (get_local $0) - (call $~lib/internal/array/defaultComparator) + (block $~lib/internal/array/defaultComparator|inlined.1 (result i32) + (br $~lib/internal/array/defaultComparator|inlined.1 + (i32.const 46) + ) + ) ) ) - (func $std/array/isArraysEqual (; 93 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (if - (i32.eqz - (get_local $2) - ) - (block - (if - (i32.ne - (call $~lib/array/Array#get:length - (get_local $0) - ) - (call $~lib/array/Array#get:length - (get_local $1) - ) - ) - (return - (i32.const 0) - ) - ) - (set_local $2 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) - ) - ) - (block $break|0 - (set_local $3 - (i32.const 0) - ) - (loop $repeat|0 - (br_if $break|0 - (i32.eqz - (i32.lt_s - (get_local $3) - (get_local $2) - ) - ) - ) - (if - (i32.ne - (call $~lib/array/Array#__get - (get_local $0) - (get_local $3) - ) - (call $~lib/array/Array#__get - (get_local $1) - (get_local $3) - ) - ) - (return - (i32.const 0) - ) - ) - (set_local $3 - (i32.add - (get_local $3) - (i32.const 1) - ) - ) - (br $repeat|0) - ) - ) - (i32.const 1) - ) - (func $start~anonymous|43 (; 94 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|47 (; 115 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $0) (get_local $1) ) ) - (func $start~anonymous|44 (; 95 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|48 (; 116 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $1) (get_local $0) ) ) - (func $start~anonymous|45 (; 96 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|49 (; 117 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $0) (get_local $1) ) ) - (func $start~anonymous|46 (; 97 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|50 (; 118 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (get_local $1) (get_local $0) ) ) - (func $~lib/array/Array>#constructor (; 98 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#constructor (; 119 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6692,7 +10024,7 @@ (get_local $0) (get_local $1) ) - (block $~lib/memory/memory.fill|inlined.5 + (block $~lib/memory/memory.fill|inlined.8 (set_local $4 (i32.add (get_local $3) @@ -6710,12 +10042,7 @@ ) (get_local $0) ) - (func $~lib/array/Array>#get:length (; 99 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array>#__set (; 100 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array>#__set (; 120 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (set_local $3 @@ -6746,7 +10073,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -6790,7 +10117,7 @@ ) ) ) - (func $~lib/array/Array>#__get (; 101 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#__get (; 121 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (set_local $2 (i32.load @@ -6821,7 +10148,7 @@ (unreachable) ) ) - (func $std/array/createReverseOrderedNestedArray (; 102 ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedNestedArray (; 122 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (set_local $1 @@ -6839,8 +10166,10 @@ (i32.eqz (i32.lt_s (get_local $2) - (call $~lib/array/Array>#get:length - (get_local $1) + (block $~lib/array/Array>#get:length|inlined.1 (result i32) + (i32.load offset=4 + (get_local $1) + ) ) ) ) @@ -6862,8 +10191,10 @@ (i32.const 0) (i32.sub (i32.sub - (call $~lib/array/Array>#get:length - (get_local $1) + (block $~lib/array/Array>#get:length|inlined.2 (result i32) + (i32.load offset=4 + (get_local $1) + ) ) (i32.const 1) ) @@ -6882,7 +10213,7 @@ ) (get_local $1) ) - (func $start~anonymous|47 (; 103 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|51 (; 123 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/array/Array#__get (get_local $0) @@ -6894,47 +10225,36 @@ ) ) ) - (func $~lib/internal/array/insertionSort> (; 104 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/internal/array/insertionSort> (; 124 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (set_local $2 - (i32.load - (get_local $0) - ) - ) (block $break|0 - (block - (set_local $3 - (i32.const 0) - ) - (set_local $4 - (call $~lib/array/Array>#get:length - (get_local $0) - ) - ) + (set_local $4 + (i32.const 0) ) (loop $repeat|0 (br_if $break|0 (i32.eqz (i32.lt_s - (get_local $3) (get_local $4) + (get_local $2) ) ) ) (block (set_local $5 - (block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.3 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Array>|inlined.0 (result i32) (i32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) @@ -6943,7 +10263,7 @@ ) (set_local $6 (i32.sub - (get_local $3) + (get_local $4) (i32.const 1) ) ) @@ -6957,10 +10277,13 @@ (block (block (set_local $7 - (block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.4 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Array>|inlined.1 (result i32) (i32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $6) (i32.const 2) @@ -6978,12 +10301,12 @@ (call_indirect (type $iii) (get_local $5) (get_local $7) - (get_local $1) + (get_local $3) ) ) (i32.const 0) ) - (block $~lib/internal/arraybuffer/storeUnsafe,Array>|inlined.3 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset,Array>|inlined.0 (set_local $8 (i32.add (block (result i32) @@ -7003,7 +10326,10 @@ ) (i32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -7020,7 +10346,7 @@ ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe,Array>|inlined.4 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset,Array>|inlined.1 (set_local $7 (i32.add (get_local $6) @@ -7029,7 +10355,10 @@ ) (i32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $7) (i32.const 2) @@ -7039,18 +10368,17 @@ ) ) ) - (set_local $3 + (set_local $4 (i32.add - (get_local $3) + (get_local $4) (i32.const 1) ) ) (br $repeat|0) ) ) - (get_local $0) ) - (func $~lib/array/Array>#sort (; 105 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#sort (; 125 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7064,7 +10392,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 310) + (i32.const 311) (i32.const 4) ) (unreachable) @@ -7179,14 +10507,17 @@ ) ) ) + (call $~lib/internal/array/insertionSort> + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) (return - (call $~lib/internal/array/insertionSort> - (get_local $0) - (get_local $1) - ) + (get_local $0) ) ) - (func $std/array/isSorted> (; 106 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted> (; 126 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (block $break|0 @@ -7195,8 +10526,10 @@ (i32.const 1) ) (set_local $3 - (call $~lib/array/Array>#get:length - (get_local $0) + (block $~lib/array/Array>#get:length|inlined.3 (result i32) + (i32.load offset=4 + (get_local $0) + ) ) ) ) @@ -7247,7 +10580,7 @@ ) (i32.const 1) ) - (func $std/array/assertSorted> (; 107 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted> (; 127 ;) (type $iiv) (param $0 i32) (param $1 i32) (if (i32.eqz (call $std/array/isSorted> @@ -7262,14 +10595,14 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 605) + (i32.const 608) (i32.const 2) ) (unreachable) ) ) ) - (func $~lib/array/Array>#constructor (; 108 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#constructor (; 128 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7331,7 +10664,7 @@ (get_local $0) (get_local $1) ) - (block $~lib/memory/memory.fill|inlined.6 + (block $~lib/memory/memory.fill|inlined.9 (set_local $4 (i32.add (get_local $3) @@ -7349,12 +10682,7 @@ ) (get_local $0) ) - (func $~lib/array/Array>#get:length (; 109 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $std/array/Proxy#constructor (; 110 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/Proxy#constructor (; 129 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (tee_local $0 (if (result i32) @@ -7377,7 +10705,7 @@ ) ) ) - (func $~lib/array/Array>#__set (; 111 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array>#__set (; 130 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (set_local $3 @@ -7408,7 +10736,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -7452,7 +10780,7 @@ ) ) ) - (func $std/array/createReverseOrderedElementsArray (; 112 ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createReverseOrderedElementsArray (; 131 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (set_local $1 @@ -7470,8 +10798,10 @@ (i32.eqz (i32.lt_s (get_local $2) - (call $~lib/array/Array>#get:length - (get_local $1) + (block $~lib/array/Array>#get:length|inlined.1 (result i32) + (i32.load offset=4 + (get_local $1) + ) ) ) ) @@ -7483,8 +10813,10 @@ (i32.const 0) (i32.sub (i32.sub - (call $~lib/array/Array>#get:length - (get_local $1) + (block $~lib/array/Array>#get:length|inlined.2 (result i32) + (i32.load offset=4 + (get_local $1) + ) ) (i32.const 1) ) @@ -7503,7 +10835,7 @@ ) (get_local $1) ) - (func $start~anonymous|48 (; 113 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|52 (; 132 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (i32.load (get_local $0) @@ -7513,47 +10845,36 @@ ) ) ) - (func $~lib/internal/array/insertionSort> (; 114 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/internal/array/insertionSort> (; 133 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (set_local $2 - (i32.load - (get_local $0) - ) - ) (block $break|0 - (block - (set_local $3 - (i32.const 0) - ) - (set_local $4 - (call $~lib/array/Array>#get:length - (get_local $0) - ) - ) + (set_local $4 + (i32.const 0) ) (loop $repeat|0 (br_if $break|0 (i32.eqz (i32.lt_s - (get_local $3) (get_local $4) + (get_local $2) ) ) ) (block (set_local $5 - (block $~lib/internal/arraybuffer/loadUnsafe,Proxy>|inlined.2 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Proxy>|inlined.0 (result i32) (i32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) @@ -7562,7 +10883,7 @@ ) (set_local $6 (i32.sub - (get_local $3) + (get_local $4) (i32.const 1) ) ) @@ -7576,10 +10897,13 @@ (block (block (set_local $7 - (block $~lib/internal/arraybuffer/loadUnsafe,Proxy>|inlined.3 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Proxy>|inlined.1 (result i32) (i32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $6) (i32.const 2) @@ -7597,12 +10921,12 @@ (call_indirect (type $iii) (get_local $5) (get_local $7) - (get_local $1) + (get_local $3) ) ) (i32.const 0) ) - (block $~lib/internal/arraybuffer/storeUnsafe,Proxy>|inlined.3 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset,Proxy>|inlined.0 (set_local $8 (i32.add (block (result i32) @@ -7622,7 +10946,10 @@ ) (i32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -7639,7 +10966,7 @@ ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe,Proxy>|inlined.4 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset,Proxy>|inlined.1 (set_local $7 (i32.add (get_local $6) @@ -7648,7 +10975,10 @@ ) (i32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $7) (i32.const 2) @@ -7658,18 +10988,17 @@ ) ) ) - (set_local $3 + (set_local $4 (i32.add - (get_local $3) + (get_local $4) (i32.const 1) ) ) (br $repeat|0) ) ) - (get_local $0) ) - (func $~lib/array/Array>#sort (; 115 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#sort (; 134 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7683,7 +11012,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 310) + (i32.const 311) (i32.const 4) ) (unreachable) @@ -7798,14 +11127,17 @@ ) ) ) + (call $~lib/internal/array/insertionSort> + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) (return - (call $~lib/internal/array/insertionSort> - (get_local $0) - (get_local $1) - ) + (get_local $0) ) ) - (func $~lib/array/Array>#__get (; 116 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array>#__get (; 135 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (set_local $2 (i32.load @@ -7822,7 +11154,7 @@ (i32.const 2) ) ) - (block $~lib/internal/arraybuffer/loadUnsafe,Proxy>|inlined.4 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafe,Proxy>|inlined.2 (result i32) (i32.load offset=8 (i32.add (get_local $2) @@ -7836,7 +11168,7 @@ (unreachable) ) ) - (func $std/array/isSorted> (; 117 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted> (; 136 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (block $break|0 @@ -7845,8 +11177,10 @@ (i32.const 1) ) (set_local $3 - (call $~lib/array/Array>#get:length - (get_local $0) + (block $~lib/array/Array>#get:length|inlined.3 (result i32) + (i32.load offset=4 + (get_local $0) + ) ) ) ) @@ -7897,7 +11231,7 @@ ) (i32.const 1) ) - (func $std/array/assertSorted> (; 118 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted> (; 137 ;) (type $iiv) (param $0 i32) (param $1 i32) (if (i32.eqz (call $std/array/isSorted> @@ -7912,14 +11246,14 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 605) + (i32.const 608) (i32.const 2) ) (unreachable) ) ) ) - (func $~lib/internal/string/compareUnsafe (; 119 ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (func $~lib/internal/string/compareUnsafe (; 138 ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) (local $6 i32) (local $7 i32) @@ -7991,7 +11325,7 @@ ) (get_local $5) ) - (func $~lib/string/String.__gt (; 120 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__gt (; 139 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8075,7 +11409,7 @@ (i32.const 0) ) ) - (func $~lib/string/String.__lt (; 121 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__lt (; 140 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8159,7 +11493,7 @@ (i32.const 0) ) ) - (func $start~anonymous|49 (; 122 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|53 (; 141 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/string/String.__gt (get_local $0) @@ -8171,52 +11505,36 @@ ) ) ) - (func $~lib/array/Array#get:length (; 123 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/internal/array/insertionSort (; 124 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) + (func $~lib/internal/array/insertionSort (; 142 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) (local $8 i32) - (set_local $2 - (i32.load - (get_local $0) - ) - ) (block $break|0 - (block - (set_local $3 - (i32.const 0) - ) - (set_local $4 - (call $~lib/array/Array#get:length - (get_local $0) - ) - ) + (set_local $4 + (i32.const 0) ) (loop $repeat|0 (br_if $break|0 (i32.eqz (i32.lt_s - (get_local $3) (get_local $4) + (get_local $2) ) ) ) (block (set_local $5 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) (i32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl - (get_local $3) + (get_local $4) (i32.const 2) ) ) @@ -8225,7 +11543,7 @@ ) (set_local $6 (i32.sub - (get_local $3) + (get_local $4) (i32.const 1) ) ) @@ -8239,10 +11557,13 @@ (block (block (set_local $7 - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) (i32.load offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $6) (i32.const 2) @@ -8260,12 +11581,12 @@ (call_indirect (type $iii) (get_local $5) (get_local $7) - (get_local $1) + (get_local $3) ) ) (i32.const 0) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.2 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.0 (set_local $8 (i32.add (block (result i32) @@ -8285,7 +11606,10 @@ ) (i32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $8) (i32.const 2) @@ -8302,7 +11626,7 @@ ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.3 + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.1 (set_local $7 (i32.add (get_local $6) @@ -8311,7 +11635,10 @@ ) (i32.store offset=8 (i32.add - (get_local $2) + (i32.add + (get_local $0) + (get_local $1) + ) (i32.shl (get_local $7) (i32.const 2) @@ -8321,18 +11648,17 @@ ) ) ) - (set_local $3 + (set_local $4 (i32.add - (get_local $3) + (get_local $4) (i32.const 1) ) ) (br $repeat|0) ) ) - (get_local $0) ) - (func $~lib/array/Array#sort (; 125 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#sort (; 143 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8346,7 +11672,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 310) + (i32.const 311) (i32.const 4) ) (unreachable) @@ -8461,14 +11787,17 @@ ) ) ) + (call $~lib/internal/array/insertionSort + (get_local $3) + (i32.const 0) + (get_local $2) + (get_local $1) + ) (return - (call $~lib/internal/array/insertionSort - (get_local $0) - (get_local $1) - ) + (get_local $0) ) ) - (func $~lib/array/Array#__get (; 126 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 144 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (set_local $2 (i32.load @@ -8485,7 +11814,7 @@ (i32.const 2) ) ) - (block $~lib/internal/arraybuffer/loadUnsafe|inlined.4 (result i32) + (block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) (i32.load offset=8 (i32.add (get_local $2) @@ -8499,7 +11828,7 @@ (unreachable) ) ) - (func $std/array/isSorted (; 127 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $std/array/isSorted (; 145 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (block $break|0 @@ -8508,8 +11837,10 @@ (i32.const 1) ) (set_local $3 - (call $~lib/array/Array#get:length - (get_local $0) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (i32.load offset=4 + (get_local $0) + ) ) ) ) @@ -8560,7 +11891,7 @@ ) (i32.const 1) ) - (func $std/array/assertSorted (; 128 ;) (type $iiv) (param $0 i32) (param $1 i32) + (func $std/array/assertSorted (; 146 ;) (type $iiv) (param $0 i32) (param $1 i32) (if (i32.eqz (call $std/array/isSorted @@ -8575,14 +11906,14 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 605) + (i32.const 608) (i32.const 2) ) (unreachable) ) ) ) - (func $~lib/string/String.__eq (; 129 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__eq (; 147 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (if @@ -8638,7 +11969,7 @@ ) ) ) - (func $~lib/string/String.__ne (; 130 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__ne (; 148 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.eqz (call $~lib/string/String.__eq (get_local $0) @@ -8646,7 +11977,7 @@ ) ) ) - (func $std/array/isArraysEqual (; 131 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $std/array/isArraysEqual (; 149 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (if (i32.eqz @@ -8655,11 +11986,15 @@ (block (if (i32.ne - (call $~lib/array/Array#get:length - (get_local $0) + (block $~lib/array/Array#get:length|inlined.3 (result i32) + (i32.load offset=4 + (get_local $0) + ) ) - (call $~lib/array/Array#get:length - (get_local $1) + (block $~lib/array/Array#get:length|inlined.4 (result i32) + (i32.load offset=4 + (get_local $1) + ) ) ) (return @@ -8667,8 +12002,10 @@ ) ) (set_local $2 - (call $~lib/array/Array#get:length - (get_local $0) + (block $~lib/array/Array#get:length|inlined.5 (result i32) + (i32.load offset=4 + (get_local $0) + ) ) ) ) @@ -8712,7 +12049,7 @@ ) (i32.const 1) ) - (func $~lib/array/Array#constructor (; 132 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#constructor (; 150 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8774,7 +12111,7 @@ (get_local $0) (get_local $1) ) - (block $~lib/memory/memory.fill|inlined.7 + (block $~lib/memory/memory.fill|inlined.10 (set_local $4 (i32.add (get_local $3) @@ -8792,7 +12129,7 @@ ) (get_local $0) ) - (func $~lib/internal/string/allocateUnsafe (; 133 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/string/allocateUnsafe (; 151 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (if @@ -8814,7 +12151,7 @@ (block (call $~lib/env/abort (i32.const 0) - (i32.const 752) + (i32.const 1328) (i32.const 14) (i32.const 2) ) @@ -8822,7 +12159,7 @@ ) ) (set_local $2 - (block $~lib/memory/memory.allocate|inlined.2 (result i32) + (block $~lib/memory/memory.allocate|inlined.5 (result i32) (set_local $1 (i32.add (get_global $~lib/internal/string/HEADER_SIZE) @@ -8832,7 +12169,7 @@ ) ) ) - (br $~lib/memory/memory.allocate|inlined.2 + (br $~lib/memory/memory.allocate|inlined.5 (call $~lib/allocator/arena/__memory_allocate (get_local $1) ) @@ -8845,7 +12182,7 @@ ) (get_local $2) ) - (func $~lib/string/String#charAt (; 134 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#charAt (; 152 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (if (i32.eqz @@ -8857,7 +12194,7 @@ (block (call $~lib/env/abort (i32.const 0) - (i32.const 720) + (i32.const 1296) (i32.const 56) (i32.const 4) ) @@ -8872,7 +12209,7 @@ ) ) (return - (i32.const 568) + (i32.const 1144) ) ) (set_local $2 @@ -8894,7 +12231,7 @@ ) (get_local $2) ) - (func $~lib/internal/string/copyUnsafe (; 135 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) + (func $~lib/internal/string/copyUnsafe (; 153 ;) (type $iiiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) @@ -8936,7 +12273,7 @@ ) ) ) - (func $~lib/string/String#concat (; 136 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String#concat (; 154 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8951,7 +12288,7 @@ (block (call $~lib/env/abort (i32.const 0) - (i32.const 720) + (i32.const 1296) (i32.const 108) (i32.const 4) ) @@ -8964,7 +12301,7 @@ (i32.const 0) ) (set_local $1 - (i32.const 808) + (i32.const 1384) ) ) (set_local $2 @@ -8989,7 +12326,7 @@ (i32.const 0) ) (return - (i32.const 568) + (i32.const 1144) ) ) (set_local $5 @@ -9013,13 +12350,13 @@ ) (get_local $5) ) - (func $~lib/string/String.__concat (; 137 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/string/String.__concat (; 155 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (if (i32.eqz (get_local $0) ) (set_local $0 - (i32.const 808) + (i32.const 1384) ) ) (call $~lib/string/String#concat @@ -9027,12 +12364,12 @@ (get_local $1) ) ) - (func $std/array/createRandomString (; 138 ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createRandomString (; 156 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 f64) (set_local $1 - (i32.const 568) + (i32.const 1144) ) (block $break|0 (set_local $2 @@ -9083,7 +12420,7 @@ ) (get_local $1) ) - (func $~lib/array/Array#__set (; 139 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 157 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (set_local $3 @@ -9114,7 +12451,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -9145,7 +12482,7 @@ ) ) ) - (block $~lib/internal/arraybuffer/storeUnsafe|inlined.4 + (block $~lib/internal/arraybuffer/storeUnsafe|inlined.2 (i32.store offset=8 (i32.add (get_local $3) @@ -9158,7 +12495,7 @@ ) ) ) - (func $std/array/createRandomStringArray (; 140 ;) (type $ii) (param $0 i32) (result i32) + (func $std/array/createRandomStringArray (; 158 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (set_local $1 @@ -9176,8 +12513,10 @@ (i32.eqz (i32.lt_s (get_local $2) - (call $~lib/array/Array#get:length - (get_local $1) + (block $~lib/array/Array#get:length|inlined.7 (result i32) + (i32.load offset=4 + (get_local $1) + ) ) ) ) @@ -9205,7 +12544,7 @@ ) (get_local $1) ) - (func $start~anonymous|50 (; 141 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $start~anonymous|54 (; 159 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.sub (call $~lib/string/String.__gt (get_local $0) @@ -9217,7 +12556,8 @@ ) ) ) - (func $start (; 142 ;) (type $v) + (func $start (; 160 ;) (type $v) + (local $0 i32) (set_global $~lib/allocator/arena/startOffset (i32.and (i32.add @@ -9242,8 +12582,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 0) ) @@ -9306,8 +12651,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.1 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 1) ) @@ -9366,8 +12716,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.2 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 0) ) @@ -9410,8 +12765,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.3 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 1) ) @@ -9474,8 +12834,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.4 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -9558,8 +12923,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.5 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 3) ) @@ -9662,8 +13032,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.6 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 4) ) @@ -9786,8 +13161,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.7 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 5) ) @@ -9946,8 +13326,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.8 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 4) ) @@ -10086,8 +13471,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.9 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 3) ) @@ -10189,8 +13579,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.10 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 3) ) @@ -10784,8 +14179,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.11 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 4) ) @@ -10974,8 +14374,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.12 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -11059,8 +14464,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.13 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -11159,8 +14569,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.14 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -11244,8 +14659,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.15 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -11344,8 +14764,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.16 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -11429,8 +14854,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.17 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -11508,8 +14938,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.18 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -11595,8 +15030,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.19 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -11632,8 +15072,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/newArr) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/array/newArr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 4) ) @@ -11702,8 +15147,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.20 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -11793,8 +15243,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.21 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -11830,8 +15285,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/filteredArr) + (block $~lib/array/Array#get:length|inlined.22 (result i32) + (set_local $0 + (get_global $std/array/filteredArr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -11875,8 +15335,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.23 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -11966,8 +15431,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.24 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -12123,8 +15593,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.25 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -12210,8 +15685,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.26 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -12367,8 +15847,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.27 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 8) ) @@ -12454,8 +15939,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/array/arr) + (block $~lib/array/Array#get:length|inlined.28 (result i32) + (set_local $0 + (get_global $std/array/arr) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 0) ) @@ -12499,6 +15989,122 @@ (call $~lib/math/JSMath.random) ) ) + (drop + (block (result i32) + (set_global $~argc + (i32.const 0) + ) + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/f32ArrayTyped) + (i32.const 0) + ) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/f32ArrayTyped) + (i32.const 480) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 619) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (block (result i32) + (set_global $~argc + (i32.const 0) + ) + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/f64ArrayTyped) + (i32.const 0) + ) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/f64ArrayTyped) + (i32.const 752) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 623) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (block (result i32) + (set_global $~argc + (i32.const 0) + ) + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/i32ArrayTyped) + (i32.const 0) + ) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/i32ArrayTyped) + (i32.const 832) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 627) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (block (result i32) + (set_global $~argc + (i32.const 0) + ) + (call $~lib/array/Array#sort|trampoline + (get_global $std/array/u32ArrayTyped) + (i32.const 0) + ) + ) + ) + (if + (i32.eqz + (call $std/array/isArraysEqual + (get_global $std/array/u32ArrayTyped) + (i32.const 912) + (i32.const 0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 104) + (i32.const 631) + (i32.const 0) + ) + (unreachable) + ) + ) (set_global $std/array/reversed64 (call $std/array/createReverseOrderedArray (i32.const 64) @@ -12534,7 +16140,7 @@ (i32.eqz (call $std/array/isArraysEqual (get_global $std/array/reversed1) - (i32.const 504) + (i32.const 1080) (i32.const 0) ) ) @@ -12542,7 +16148,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 631) + (i32.const 651) (i32.const 0) ) (unreachable) @@ -12555,7 +16161,7 @@ (i32.eqz (call $std/array/isArraysEqual (get_global $std/array/reversed2) - (i32.const 528) + (i32.const 1104) (i32.const 0) ) ) @@ -12563,7 +16169,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 634) + (i32.const 654) (i32.const 0) ) (unreachable) @@ -12584,7 +16190,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 637) + (i32.const 657) (i32.const 0) ) (unreachable) @@ -12605,7 +16211,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 640) + (i32.const 660) (i32.const 0) ) (unreachable) @@ -12626,7 +16232,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 643) + (i32.const 663) (i32.const 0) ) (unreachable) @@ -12647,7 +16253,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 646) + (i32.const 666) (i32.const 0) ) (unreachable) @@ -12668,7 +16274,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 649) + (i32.const 669) (i32.const 0) ) (unreachable) @@ -12689,19 +16295,19 @@ ) (call $std/array/assertSorted (get_global $std/array/randomized64) - (i32.const 43) + (i32.const 47) ) (call $std/array/assertSorted (get_global $std/array/randomized64) - (i32.const 44) + (i32.const 48) ) (call $std/array/assertSorted (get_global $std/array/randomized257) - (i32.const 45) + (i32.const 49) ) (call $std/array/assertSorted (get_global $std/array/randomized257) - (i32.const 46) + (i32.const 50) ) (set_global $std/array/reversedNested512 (call $std/array/createReverseOrderedNestedArray @@ -12710,7 +16316,7 @@ ) (call $std/array/assertSorted> (get_global $std/array/reversedNested512) - (i32.const 47) + (i32.const 51) ) (set_global $std/array/reversedElements512 (call $std/array/createReverseOrderedElementsArray @@ -12719,11 +16325,11 @@ ) (call $std/array/assertSorted> (get_global $std/array/reversedElements512) - (i32.const 48) + (i32.const 52) ) (call $std/array/assertSorted (get_global $std/array/randomStringsActual) - (i32.const 49) + (i32.const 53) ) (if (i32.eqz @@ -12737,7 +16343,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 104) - (i32.const 678) + (i32.const 698) (i32.const 0) ) (unreachable) @@ -12750,7 +16356,7 @@ ) (call $std/array/assertSorted (get_global $std/array/randomStrings400) - (i32.const 50) + (i32.const 54) ) ) ) diff --git a/tests/compiler/std/gc-array.optimized.wat b/tests/compiler/std/gc-array.optimized.wat index 6f53654f..86a2e7b7 100644 --- a/tests/compiler/std/gc-array.optimized.wat +++ b/tests/compiler/std/gc-array.optimized.wat @@ -2802,7 +2802,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 72) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) diff --git a/tests/compiler/std/gc-array.untouched.wat b/tests/compiler/std/gc-array.untouched.wat index 924c6df1..23a84174 100644 --- a/tests/compiler/std/gc-array.untouched.wat +++ b/tests/compiler/std/gc-array.untouched.wat @@ -3478,7 +3478,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 72) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 38c21ea5..da201cfa 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -1,8 +1,8 @@ (module - (type $ii (func (param i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) (type $iii (func (param i32 i32) (result i32))) (type $iiiv (func (param i32 i32 i32))) + (type $ii (func (param i32) (result i32))) (type $iiI (func (param i32 i32) (result i64))) (type $iiIv (func (param i32 i32 i64))) (type $iif (func (param i32 i32) (result f32))) @@ -29,12 +29,7 @@ (data (i32.const 216) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") (export "memory" (memory $0)) (start $start) - (func $~lib/array/Array#get:length (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 2 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 1 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (tee_local $0 (if (result i32) (i32.lt_u @@ -63,7 +58,7 @@ ) ) ) - (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/computeSize (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (i32.shl (i32.const 1) (i32.sub @@ -77,7 +72,7 @@ ) ) ) - (func $~lib/internal/memory/memset (; 4 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memset (; 3 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i64) (if @@ -407,7 +402,7 @@ ) ) ) - (func $~lib/allocator/arena/__memory_allocate (; 5 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -492,7 +487,7 @@ ) (get_local $1) ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (if (i32.gt_u @@ -521,7 +516,7 @@ ) (get_local $1) ) - (func $~lib/internal/memory/memcpy (; 7 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memcpy (; 6 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1907,7 +1902,7 @@ ) ) ) - (func $~lib/internal/memory/memmove (; 8 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memmove (; 7 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (if @@ -2199,7 +2194,7 @@ ) ) ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 9 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/arraybuffer/reallocateUnsafe (; 8 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (if @@ -2323,7 +2318,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#__set (; 10 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 9 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (if @@ -2350,7 +2345,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -2390,7 +2385,7 @@ (get_local $2) ) ) - (func $~lib/array/Array#__get (; 11 ;) (; has Stack IR ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/array/Array#__get (; 10 ;) (; has Stack IR ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) (if (result i64) (i32.lt_u (get_local $1) @@ -2417,7 +2412,7 @@ (unreachable) ) ) - (func $~lib/array/Array#__set (; 12 ;) (; has Stack IR ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/array/Array#__set (; 11 ;) (; has Stack IR ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) (if @@ -2444,7 +2439,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -2484,7 +2479,7 @@ (get_local $2) ) ) - (func $~lib/array/Array#__get (; 13 ;) (; has Stack IR ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__get (; 12 ;) (; has Stack IR ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (if (result f32) (i32.lt_u (get_local $1) @@ -2511,7 +2506,7 @@ (unreachable) ) ) - (func $~lib/array/Array#__set (; 14 ;) (; has Stack IR ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/array/Array#__set (; 13 ;) (; has Stack IR ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) (local $4 i32) (if @@ -2538,7 +2533,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -2578,7 +2573,7 @@ (get_local $2) ) ) - (func $~lib/array/Array#__get (; 15 ;) (; has Stack IR ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__get (; 14 ;) (; has Stack IR ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (if (result f64) (i32.lt_u (get_local $1) @@ -2605,7 +2600,7 @@ (unreachable) ) ) - (func $~lib/array/Array#__set (; 16 ;) (; has Stack IR ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) + (func $~lib/array/Array#__set (; 15 ;) (; has Stack IR ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) (local $4 i32) (if @@ -2632,7 +2627,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -2672,7 +2667,7 @@ (get_local $2) ) ) - (func $start (; 17 ;) (; has Stack IR ;) (type $v) + (func $start (; 16 ;) (; has Stack IR ;) (type $v) (set_global $~lib/allocator/arena/startOffset (i32.const 280) ) @@ -2681,8 +2676,8 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length - (i32.const 24) + (i32.load + (i32.const 28) ) (i32.const 2) ) @@ -2757,8 +2752,8 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length - (i32.const 64) + (i32.load + (i32.const 68) ) (i32.const 2) ) @@ -2833,8 +2828,8 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length - (i32.const 88) + (i32.load + (i32.const 92) ) (i32.const 2) ) @@ -2909,8 +2904,8 @@ ) (if (i32.ne - (call $~lib/array/Array#get:length - (i32.const 128) + (i32.load + (i32.const 132) ) (i32.const 2) ) diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index 74b2b0f2..67b8c31d 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -1,8 +1,8 @@ (module - (type $ii (func (param i32) (result i32))) (type $iiiiv (func (param i32 i32 i32 i32))) (type $iii (func (param i32 i32) (result i32))) (type $iiiv (func (param i32 i32 i32))) + (type $ii (func (param i32) (result i32))) (type $iiI (func (param i32 i32) (result i64))) (type $iiIv (func (param i32 i32 i64))) (type $iif (func (param i32 i32) (result f32))) @@ -38,12 +38,7 @@ (data (i32.const 216) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (export "memory" (memory $0)) (start $start) - (func $~lib/array/Array#get:length (; 1 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/array/Array#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (set_local $2 (i32.load @@ -74,7 +69,7 @@ (unreachable) ) ) - (func $~lib/internal/arraybuffer/computeSize (; 3 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/computeSize (; 2 ;) (type $ii) (param $0 i32) (result i32) (i32.shl (i32.const 1) (i32.sub @@ -91,7 +86,7 @@ ) ) ) - (func $~lib/internal/memory/memset (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memset (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i64) @@ -443,7 +438,7 @@ ) ) ) - (func $~lib/allocator/arena/__memory_allocate (; 5 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -554,7 +549,7 @@ ) (get_local $1) ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (type $ii) (param $0 i32) (result i32) + (func $~lib/internal/arraybuffer/allocateUnsafe (; 5 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (if @@ -594,7 +589,7 @@ ) (get_local $1) ) - (func $~lib/internal/memory/memcpy (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memcpy (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2396,7 +2391,7 @@ ) ) ) - (func $~lib/internal/memory/memmove (; 8 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/memory/memmove (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (if (i32.eq @@ -2714,7 +2709,7 @@ ) ) ) - (func $~lib/internal/arraybuffer/reallocateUnsafe (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/arraybuffer/reallocateUnsafe (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2877,7 +2872,7 @@ ) (get_local $0) ) - (func $~lib/array/Array#__set (; 10 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/array/Array#__set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (set_local $3 @@ -2908,7 +2903,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -2952,12 +2947,7 @@ ) ) ) - (func $~lib/array/Array#get:length (; 11 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 12 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) + (func $~lib/array/Array#__get (; 10 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) (local $2 i32) (set_local $2 (i32.load @@ -2988,7 +2978,7 @@ (unreachable) ) ) - (func $~lib/array/Array#__set (; 13 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/array/Array#__set (; 11 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) (set_local $3 @@ -3019,7 +3009,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -3063,12 +3053,7 @@ ) ) ) - (func $~lib/array/Array#get:length (; 14 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 15 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) + (func $~lib/array/Array#__get (; 12 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (local $2 i32) (set_local $2 (i32.load @@ -3099,7 +3084,7 @@ (unreachable) ) ) - (func $~lib/array/Array#__set (; 16 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/array/Array#__set (; 13 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) (local $4 i32) (set_local $3 @@ -3130,7 +3115,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -3174,12 +3159,7 @@ ) ) ) - (func $~lib/array/Array#get:length (; 17 ;) (type $ii) (param $0 i32) (result i32) - (i32.load offset=4 - (get_local $0) - ) - ) - (func $~lib/array/Array#__get (; 18 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/array/Array#__get (; 14 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (set_local $2 (i32.load @@ -3210,7 +3190,7 @@ (unreachable) ) ) - (func $~lib/array/Array#__set (; 19 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) + (func $~lib/array/Array#__set (; 15 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) (local $4 i32) (set_local $3 @@ -3241,7 +3221,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 184) - (i32.const 86) + (i32.const 87) (i32.const 41) ) (unreachable) @@ -3285,7 +3265,8 @@ ) ) ) - (func $start (; 20 ;) (type $v) + (func $start (; 16 ;) (type $v) + (local $0 i32) (set_global $~lib/allocator/arena/startOffset (i32.and (i32.add @@ -3304,8 +3285,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/static-array/i) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/static-array/i) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -3388,8 +3374,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/static-array/I) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/static-array/I) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -3472,8 +3463,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/static-array/f) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/static-array/f) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) @@ -3556,8 +3552,13 @@ (if (i32.eqz (i32.eq - (call $~lib/array/Array#get:length - (get_global $std/static-array/F) + (block $~lib/array/Array#get:length|inlined.0 (result i32) + (set_local $0 + (get_global $std/static-array/F) + ) + (i32.load offset=4 + (get_local $0) + ) ) (i32.const 2) ) diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 692f9173..6dfe0e0e 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -5,17 +5,25 @@ (type $ii (func (param i32) (result i32))) (type $iiiv (func (param i32 i32 i32))) (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiFv (func (param i32 i32 f64))) + (type $FFi (func (param f64 f64) (result i32))) + (type $iiF (func (param i32 i32) (result f64))) (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $std/typedarray/arr (mut i32) (i32.const 0)) + (global $std/typedarray/af64 (mut i32) (i32.const 0)) + (global $~argc (mut i32) (i32.const 0)) (global $std/typedarray/clampedArr (mut i32) (i32.const 0)) + (table 1 1 anyfunc) + (elem (i32.const 0) $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0) (memory $0 1) (data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 112) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") (export "memory" (memory $0)) + (export "table" (table $0)) (start $start) (func $~lib/internal/arraybuffer/computeSize (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (i32.shl @@ -491,7 +499,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -557,7 +565,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -628,7 +636,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -699,7 +707,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -1471,7 +1479,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 49) + (i32.const 55) (i32.const 42) ) (unreachable) @@ -1516,7 +1524,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 36) + (i32.const 42) (i32.const 42) ) (unreachable) @@ -1648,7 +1656,956 @@ ) (get_local $3) ) - (func $~lib/internal/typedarray/TypedArray#__set (; 14 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 14 ;) (; has Stack IR ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) + (local $3 i32) + (if + (i32.ge_u + (get_local $1) + (i32.shr_u + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (tee_local $3 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + (i32.const 3) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 48) + (i32.const 55) + (i32.const 42) + ) + (unreachable) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (i32.load + (get_local $0) + ) + (get_local $3) + ) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + (get_local $2) + ) + ) + (func $~lib/typedarray/Float64Array#subarray (; 15 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (set_local $4 + (i32.shr_s + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 3) + ) + ) + (set_local $1 + (if (result i32) + (i32.lt_s + (get_local $1) + (i32.const 0) + ) + (select + (tee_local $3 + (i32.add + (get_local $4) + (get_local $1) + ) + ) + (i32.const 0) + (i32.gt_s + (get_local $3) + (i32.const 0) + ) + ) + (select + (tee_local $3 + (get_local $1) + ) + (get_local $4) + (i32.lt_s + (get_local $1) + (get_local $4) + ) + ) + ) + ) + (set_local $2 + (if (result i32) + (i32.lt_s + (get_local $2) + (i32.const 0) + ) + (select + (tee_local $3 + (i32.add + (get_local $4) + (get_local $2) + ) + ) + (get_local $1) + (i32.gt_s + (get_local $3) + (get_local $1) + ) + ) + (select + (tee_local $3 + (select + (get_local $2) + (get_local $4) + (i32.lt_s + (get_local $2) + (get_local $4) + ) + ) + ) + (get_local $1) + (i32.gt_s + (get_local $3) + (get_local $1) + ) + ) + ) + ) + (i32.store + (tee_local $3 + (call $~lib/allocator/arena/__memory_allocate + (i32.const 12) + ) + ) + (i32.load + (get_local $0) + ) + ) + (i32.store offset=4 + (get_local $3) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + (i32.store offset=8 + (get_local $3) + (i32.shl + (get_local $2) + (i32.const 3) + ) + ) + (get_local $3) + ) + (func $~lib/internal/array/insertionSort (; 16 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 f64) + (local $7 f64) + (local $8 i32) + (block $break|0 + (loop $repeat|0 + (br_if $break|0 + (i32.ge_s + (get_local $4) + (get_local $2) + ) + ) + (set_local $6 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + (set_local $5 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_s + (get_local $5) + (i32.const 0) + ) + (block + (set_local $7 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (br_if $break|1 + (i32.ge_s + (call_indirect (type $FFi) + (get_local $6) + (get_local $7) + (get_local $3) + ) + (i32.const 0) + ) + ) + (set_local $5 + (i32.sub + (tee_local $8 + (get_local $5) + ) + (i32.const 1) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (i32.add + (get_local $8) + (i32.const 1) + ) + (i32.const 3) + ) + ) + (get_local $7) + ) + (br $continue|1) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (i32.add + (get_local $5) + (i32.const 1) + ) + (i32.const 3) + ) + ) + (get_local $6) + ) + (set_local $4 + (i32.add + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + (func $~lib/allocator/arena/__memory_free (; 17 ;) (; has Stack IR ;) (type $iv) (param $0 i32) + (nop) + ) + (func $~lib/internal/array/weakHeapSort (; 18 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 f64) + (local $8 i32) + (local $9 f64) + (call $~lib/internal/memory/memset + (tee_local $8 + (call $~lib/allocator/arena/__memory_allocate + (tee_local $6 + (i32.shl + (i32.shr_s + (i32.add + (get_local $2) + (i32.const 31) + ) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + ) + (i32.const 0) + (get_local $6) + ) + (block $break|0 + (set_local $4 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.le_s + (get_local $4) + (i32.const 0) + ) + ) + (set_local $6 + (get_local $4) + ) + (loop $continue|1 + (if + (i32.eq + (i32.and + (get_local $6) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 6) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (i32.shr_s + (get_local $6) + (i32.const 1) + ) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + (block + (set_local $6 + (i32.shr_s + (get_local $6) + (i32.const 1) + ) + ) + (br $continue|1) + ) + ) + ) + (set_local $9 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (tee_local $5 + (i32.shr_s + (get_local $6) + (i32.const 1) + ) + ) + (i32.const 3) + ) + ) + ) + ) + (set_local $7 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $FFi) + (get_local $9) + (get_local $7) + (get_local $3) + ) + (i32.const 0) + ) + (block + (i32.store + (tee_local $6 + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $4) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.xor + (i32.load + (get_local $6) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $4) + (i32.const 31) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + (get_local $9) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + (get_local $7) + ) + ) + ) + (set_local $4 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (block $break|2 + (set_local $4 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|2 + (br_if $break|2 + (i32.lt_s + (get_local $4) + (i32.const 2) + ) + ) + (set_local $7 + (f64.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (f64.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + (get_local $7) + ) + (set_local $5 + (i32.const 1) + ) + (loop $continue|3 + (if + (i32.lt_s + (tee_local $6 + (i32.add + (i32.shl + (get_local $5) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $5) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (get_local $5) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + ) + (get_local $4) + ) + (block + (set_local $5 + (get_local $6) + ) + (br $continue|3) + ) + ) + ) + (loop $continue|4 + (if + (i32.gt_s + (get_local $5) + (i32.const 0) + ) + (block + (set_local $7 + (f64.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (set_local $9 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $FFi) + (get_local $7) + (get_local $9) + (get_local $3) + ) + (i32.const 0) + ) + (block + (i32.store + (tee_local $2 + (i32.add + (get_local $8) + (i32.shl + (i32.shr_s + (get_local $5) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.xor + (i32.load + (get_local $2) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $5) + (i32.const 31) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + (get_local $7) + ) + (f64.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (get_local $9) + ) + ) + ) + (set_local $5 + (i32.shr_s + (get_local $5) + (i32.const 1) + ) + ) + (br $continue|4) + ) + ) + ) + (set_local $4 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|2) + ) + ) + (call $~lib/allocator/arena/__memory_free + (get_local $8) + ) + (set_local $7 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.const 8) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.const 8) + ) + (f64.load offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + ) + ) + (f64.store offset=8 + (i32.add + (get_local $0) + (get_local $1) + ) + (get_local $7) + ) + ) + (func $~lib/internal/typedarray/TypedArray#sort (; 19 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 f64) + (local $6 f64) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + (if + (i32.le_s + (tee_local $4 + (i32.shr_s + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 3) + ) + ) + (i32.const 1) + ) + (return + (get_local $0) + ) + ) + (set_local $3 + (i32.load + (get_local $0) + ) + ) + (if + (i32.eq + (get_local $4) + (i32.const 2) + ) + (block + (set_local $5 + (f64.load offset=8 + (i32.add + (i32.add + (get_local $3) + (get_local $2) + ) + (i32.const 8) + ) + ) + ) + (set_local $6 + (f64.load offset=8 + (i32.add + (get_local $3) + (get_local $2) + ) + ) + ) + (set_global $~argc + (i32.const 2) + ) + (if + (i32.lt_s + (call_indirect (type $FFi) + (get_local $5) + (get_local $6) + (get_local $1) + ) + (i32.const 0) + ) + (block + (f64.store offset=8 + (i32.add + (i32.add + (get_local $3) + (get_local $2) + ) + (i32.const 8) + ) + (get_local $6) + ) + (f64.store offset=8 + (i32.add + (get_local $3) + (get_local $2) + ) + (get_local $5) + ) + ) + ) + (return + (get_local $0) + ) + ) + ) + (if + (i32.lt_s + (get_local $4) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $3) + (get_local $2) + (get_local $4) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $3) + (get_local $2) + (get_local $4) + (get_local $1) + ) + ) + (get_local $0) + ) + (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0 (; 20 ;) (; has Stack IR ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (local $2 i64) + (local $3 i64) + (i32.sub + (i64.gt_s + (tee_local $2 + (i64.xor + (tee_local $2 + (i64.reinterpret/f64 + (get_local $0) + ) + ) + (i64.shr_u + (i64.shr_s + (get_local $2) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + (tee_local $3 + (i64.xor + (tee_local $3 + (i64.reinterpret/f64 + (get_local $1) + ) + ) + (i64.shr_u + (i64.shr_s + (get_local $3) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + ) + (i64.lt_s + (get_local $2) + (get_local $3) + ) + ) + ) + (func $~lib/internal/typedarray/TypedArray#sort|trampoline (; 21 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (i32.const 0) + ) + ) + (call $~lib/internal/typedarray/TypedArray#sort + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/internal/typedarray/TypedArray#__get (; 22 ;) (; has Stack IR ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (local $2 i32) + (if + (i32.ge_u + (get_local $1) + (i32.shr_u + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (tee_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + (i32.const 3) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 48) + (i32.const 42) + (i32.const 42) + ) + (unreachable) + ) + ) + (f64.load offset=8 + (i32.add + (i32.add + (i32.load + (get_local $0) + ) + (get_local $2) + ) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + ) + ) + (func $~lib/internal/typedarray/TypedArray#__set (; 23 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (if (i32.ge_u @@ -1668,7 +2625,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 49) + (i32.const 55) (i32.const 42) ) (unreachable) @@ -1687,7 +2644,7 @@ (get_local $2) ) ) - (func $~lib/typedarray/Uint8ClampedArray#__set (; 15 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint8ClampedArray#__set (; 24 ;) (; has Stack IR ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (call $~lib/internal/typedarray/TypedArray#__set (get_local $0) @@ -1711,7 +2668,7 @@ ) ) ) - (func $~lib/internal/typedarray/TypedArray#__get (; 16 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 25 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (if (i32.ge_u @@ -1731,7 +2688,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 36) + (i32.const 42) (i32.const 42) ) (unreachable) @@ -1749,7 +2706,7 @@ ) ) ) - (func $start (; 17 ;) (; has Stack IR ;) (type $v) + (func $start (; 26 ;) (; has Stack IR ;) (type $v) (local $0 i32) (set_global $~lib/allocator/arena/startOffset (i32.const 176) @@ -1982,6 +2939,153 @@ (unreachable) ) ) + (set_global $std/typedarray/af64 + (call $~lib/internal/typedarray/TypedArray#constructor + (i32.const 0) + (i32.const 8) + ) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 0) + (f64.const 1) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 1) + (f64.const 2) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 2) + (f64.const 7) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 3) + (f64.const 6) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 4) + (f64.const 5) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 5) + (f64.const 4) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 6) + (f64.const 3) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 7) + (f64.const 8) + ) + (set_global $std/typedarray/af64 + (call $~lib/typedarray/Float64Array#subarray + (get_global $std/typedarray/af64) + (i32.const 2) + (i32.const 6) + ) + ) + (if + (i32.ne + (i32.shr_s + (i32.sub + (i32.load offset=8 + (tee_local $0 + (get_global $std/typedarray/af64) + ) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 3) + ) + (i32.const 4) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 105) + (i32.const 0) + ) + (unreachable) + ) + ) + (set_global $~argc + (i32.const 0) + ) + (drop + (call $~lib/internal/typedarray/TypedArray#sort|trampoline + (get_global $std/typedarray/af64) + (i32.const 0) + ) + ) + (if + (tee_local $0 + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 0) + ) + (f64.const 4) + ) + ) + (set_local $0 + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 1) + ) + (f64.const 5) + ) + ) + ) + (if + (get_local $0) + (set_local $0 + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 2) + ) + (f64.const 6) + ) + ) + ) + (if + (get_local $0) + (set_local $0 + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 3) + ) + (f64.const 7) + ) + ) + ) + (if + (i32.eqz + (get_local $0) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 107) + (i32.const 0) + ) + (unreachable) + ) + ) (set_global $std/typedarray/clampedArr (call $~lib/internal/typedarray/TypedArray#constructor (i32.const 0) @@ -2015,7 +3119,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 98) + (i32.const 114) (i32.const 0) ) (unreachable) @@ -2036,7 +3140,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 99) + (i32.const 115) (i32.const 0) ) (unreachable) @@ -2057,7 +3161,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 100) + (i32.const 116) (i32.const 0) ) (unreachable) diff --git a/tests/compiler/std/typedarray.ts b/tests/compiler/std/typedarray.ts index e0fb62ff..279df220 100644 --- a/tests/compiler/std/typedarray.ts +++ b/tests/compiler/std/typedarray.ts @@ -90,6 +90,22 @@ assert(arr.byteOffset == 1 * sizeof()); assert(arr.byteLength == 2 * sizeof()); assert(arr[0] == 2); +var af64 = new Float64Array(8); +af64[0] = 1; +af64[1] = 2; + +af64[2] = 7; +af64[3] = 6; +af64[4] = 5; +af64[5] = 4; + +af64[6] = 3; +af64[7] = 8; +af64 = af64.subarray(2, 6); +assert(af64.length == 4); +af64.sort(); +assert(af64[0] == 4 && af64[1] == 5 && af64[2] == 6 && af64[3] == 7); + var clampedArr = new Uint8ClampedArray(3); clampedArr[0] = -32; clampedArr[1] = 2; diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index a0211ca3..38b114cb 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -5,6 +5,9 @@ (type $ii (func (param i32) (result i32))) (type $iiiv (func (param i32 i32 i32))) (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iiFv (func (param i32 i32 f64))) + (type $FFi (func (param f64 f64) (result i32))) + (type $iiF (func (param i32 i32) (result f64))) (type $v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) @@ -27,14 +30,19 @@ (global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8)) (global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816)) (global $std/typedarray/arr (mut i32) (i32.const 0)) + (global $std/typedarray/af64 (mut i32) (i32.const 0)) + (global $~argc (mut i32) (i32.const 0)) (global $std/typedarray/clampedArr (mut i32) (i32.const 0)) (global $std/typedarray/MAX_F64LENGTH i32 (i32.const 134217727)) (global $HEAP_BASE i32 (i32.const 172)) + (table 1 1 anyfunc) + (elem (i32.const 0) $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0) (memory $0 1) (data (i32.const 8) "\11\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 48) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 112) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") (export "memory" (memory $0)) + (export "table" (table $0)) (start $start) (func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32) (i32.shl @@ -577,7 +585,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -665,7 +673,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -753,7 +761,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -841,7 +849,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -929,7 +937,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -1017,7 +1025,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -1105,7 +1113,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -1193,7 +1201,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -1281,7 +1289,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -1369,7 +1377,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 18) + (i32.const 24) (i32.const 34) ) (unreachable) @@ -2321,7 +2329,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 49) + (i32.const 55) (i32.const 42) ) (unreachable) @@ -2377,7 +2385,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 36) + (i32.const 42) (i32.const 42) ) (unreachable) @@ -2543,7 +2551,1248 @@ (get_local $4) ) ) - (func $~lib/internal/typedarray/TypedArray#__set (; 20 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 20 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (set_local $3 + (i32.load offset=4 + (get_local $0) + ) + ) + (set_local $4 + (i32.shr_u + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (get_local $3) + ) + (i32.const 3) + ) + ) + (if + (i32.ge_u + (get_local $1) + (get_local $4) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 48) + (i32.const 55) + (i32.const 42) + ) + (unreachable) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.0 + (set_local $5 + (i32.load + (get_local $0) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $5) + (get_local $3) + ) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + (get_local $2) + ) + ) + ) + (func $~lib/typedarray/Float64Array#subarray (; 21 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (block $~lib/internal/typedarray/TypedArray#subarray|inlined.0 (result i32) + (set_local $3 + (block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) + (i32.shr_s + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 3) + ) + ) + ) + (if + (i32.lt_s + (get_local $1) + (i32.const 0) + ) + (set_local $1 + (select + (tee_local $4 + (i32.add + (get_local $3) + (get_local $1) + ) + ) + (tee_local $5 + (i32.const 0) + ) + (i32.gt_s + (get_local $4) + (get_local $5) + ) + ) + ) + (set_local $1 + (select + (tee_local $4 + (get_local $1) + ) + (tee_local $5 + (get_local $3) + ) + (i32.lt_s + (get_local $4) + (get_local $5) + ) + ) + ) + ) + (if + (i32.lt_s + (get_local $2) + (i32.const 0) + ) + (set_local $2 + (select + (tee_local $4 + (i32.add + (get_local $3) + (get_local $2) + ) + ) + (tee_local $5 + (get_local $1) + ) + (i32.gt_s + (get_local $4) + (get_local $5) + ) + ) + ) + (set_local $2 + (select + (tee_local $4 + (select + (tee_local $4 + (get_local $2) + ) + (tee_local $5 + (get_local $3) + ) + (i32.lt_s + (get_local $4) + (get_local $5) + ) + ) + ) + (tee_local $5 + (get_local $1) + ) + (i32.gt_s + (get_local $4) + (get_local $5) + ) + ) + ) + ) + (set_local $4 + (block $~lib/memory/memory.allocate|inlined.2 (result i32) + (set_local $4 + (i32.const 12) + ) + (br $~lib/memory/memory.allocate|inlined.2 + (call $~lib/allocator/arena/__memory_allocate + (get_local $4) + ) + ) + ) + ) + (i32.store + (get_local $4) + (i32.load + (get_local $0) + ) + ) + (i32.store offset=4 + (get_local $4) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + (i32.store offset=8 + (get_local $4) + (i32.shl + (get_local $2) + (i32.const 3) + ) + ) + (get_local $4) + ) + ) + (func $~lib/internal/array/insertionSort (; 22 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 f64) + (local $6 i32) + (local $7 f64) + (local $8 i32) + (block $break|0 + (set_local $4 + (i32.const 0) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.lt_s + (get_local $4) + (get_local $2) + ) + ) + ) + (block + (set_local $5 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $4) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $4) + (i32.const 1) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_s + (get_local $6) + (i32.const 0) + ) + (block + (block + (set_local $7 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $5) + (get_local $7) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.3 + (set_local $8 + (i32.add + (block (result i32) + (set_local $8 + (get_local $6) + ) + (set_local $6 + (i32.sub + (get_local $8) + (i32.const 1) + ) + ) + (get_local $8) + ) + (i32.const 1) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $7) + ) + ) + (br $break|1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.4 + (set_local $8 + (i32.add + (get_local $6) + (i32.const 1) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $4 + (i32.add + (get_local $4) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + ) + (func $~lib/allocator/arena/__memory_free (; 23 ;) (type $iv) (param $0 i32) + (nop) + ) + (func $~lib/internal/array/weakHeapSort (; 24 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 f64) + (local $10 f64) + (local $11 i32) + (local $12 f64) + (set_local $4 + (i32.shl + (i32.shr_s + (i32.add + (get_local $2) + (i32.const 31) + ) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (set_local $5 + (block $~lib/memory/memory.allocate|inlined.3 (result i32) + (br $~lib/memory/memory.allocate|inlined.3 + (call $~lib/allocator/arena/__memory_allocate + (get_local $4) + ) + ) + ) + ) + (block $~lib/memory/memory.fill|inlined.10 + (set_local $6 + (i32.const 0) + ) + (call $~lib/internal/memory/memset + (get_local $5) + (get_local $6) + (get_local $4) + ) + ) + (block $break|0 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|0 + (br_if $break|0 + (i32.eqz + (i32.gt_s + (get_local $6) + (i32.const 0) + ) + ) + ) + (block + (set_local $7 + (get_local $6) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.eq + (i32.and + (get_local $7) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $7) + (i32.const 6) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + (block + (set_local $7 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $7) + (i32.const 1) + ) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $9) + (get_local $10) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $6) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $6) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.5 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.6 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|0) + ) + ) + (block $break|2 + (set_local $6 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $repeat|2 + (br_if $break|2 + (i32.eqz + (i32.ge_s + (get_local $6) + (i32.const 2) + ) + ) + ) + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result f64) + (set_local $8 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.7 + (set_local $8 + (i32.const 0) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $9) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.8 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + (set_local $8 + (i32.const 1) + ) + (block $break|3 + (loop $continue|3 + (if + (i32.lt_s + (tee_local $7 + (i32.add + (i32.shl + (get_local $8) + (i32.const 1) + ) + (i32.and + (i32.shr_u + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + (i32.const 1) + ) + ) + ) + (get_local $6) + ) + (block + (set_local $8 + (get_local $7) + ) + (br $continue|3) + ) + ) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.gt_s + (get_local $8) + (i32.const 0) + ) + (block + (block + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result f64) + (set_local $11 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $11) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $9 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result f64) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $10) + (get_local $9) + (get_local $3) + ) + ) + (i32.const 0) + ) + (block + (i32.store + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + (i32.xor + (i32.load + (i32.add + (get_local $5) + (i32.shl + (i32.shr_s + (get_local $8) + (i32.const 5) + ) + (i32.const 2) + ) + ) + ) + (i32.shl + (i32.const 1) + (i32.and + (get_local $8) + (i32.const 31) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.9 + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $8) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.10 + (set_local $11 + (i32.const 0) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $11) + (i32.const 3) + ) + ) + (get_local $9) + ) + ) + ) + ) + (set_local $8 + (i32.shr_s + (get_local $8) + (i32.const 1) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + (set_local $6 + (i32.sub + (get_local $6) + (i32.const 1) + ) + ) + (br $repeat|2) + ) + ) + (block $~lib/memory/memory.free|inlined.0 + (block + (call $~lib/allocator/arena/__memory_free + (get_local $5) + ) + (br $~lib/memory/memory.free|inlined.0) + ) + ) + (set_local $12 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.10 (result f64) + (set_local $6 + (i32.const 1) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + ) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.11 + (set_local $6 + (i32.const 1) + ) + (set_local $10 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.11 (result f64) + (set_local $7 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $7) + (i32.const 3) + ) + ) + ) + ) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $10) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.12 + (set_local $6 + (i32.const 0) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $0) + (get_local $1) + ) + (i32.shl + (get_local $6) + (i32.const 3) + ) + ) + (get_local $12) + ) + ) + ) + (func $~lib/internal/typedarray/TypedArray#sort (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 f64) + (local $7 f64) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + (set_local $3 + (block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) + (i32.shr_s + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 3) + ) + ) + ) + (if + (i32.le_s + (get_local $3) + (i32.const 1) + ) + (return + (get_local $0) + ) + ) + (set_local $4 + (i32.load + (get_local $0) + ) + ) + (if + (i32.eq + (get_local $3) + (i32.const 2) + ) + (block + (set_local $6 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result f64) + (set_local $5 + (i32.const 1) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $4) + (get_local $2) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + ) + ) + ) + (set_local $7 + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result f64) + (set_local $5 + (i32.const 0) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $4) + (get_local $2) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + ) + ) + ) + (if + (i32.lt_s + (block (result i32) + (set_global $~argc + (i32.const 2) + ) + (call_indirect (type $FFi) + (get_local $6) + (get_local $7) + (get_local $1) + ) + ) + (i32.const 0) + ) + (block + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.1 + (set_local $5 + (i32.const 1) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $4) + (get_local $2) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + (get_local $7) + ) + ) + (block $~lib/internal/arraybuffer/storeUnsafeWithOffset|inlined.2 + (set_local $5 + (i32.const 0) + ) + (f64.store offset=8 + (i32.add + (i32.add + (get_local $4) + (get_local $2) + ) + (i32.shl + (get_local $5) + (i32.const 3) + ) + ) + (get_local $6) + ) + ) + ) + ) + (return + (get_local $0) + ) + ) + ) + (if + (i32.lt_s + (get_local $3) + (i32.const 256) + ) + (call $~lib/internal/array/insertionSort + (get_local $4) + (get_local $2) + (get_local $3) + (get_local $1) + ) + (call $~lib/internal/array/weakHeapSort + (get_local $4) + (get_local $2) + (get_local $3) + (get_local $1) + ) + ) + (return + (get_local $0) + ) + ) + (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|0 (; 26 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (local $2 i64) + (local $3 i64) + (set_local $2 + (i64.reinterpret/f64 + (get_local $0) + ) + ) + (set_local $3 + (i64.reinterpret/f64 + (get_local $1) + ) + ) + (set_local $2 + (i64.xor + (get_local $2) + (i64.shr_u + (i64.shr_s + (get_local $2) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + (set_local $3 + (i64.xor + (get_local $3) + (i64.shr_u + (i64.shr_s + (get_local $3) + (i64.const 63) + ) + (i64.const 1) + ) + ) + ) + (i32.sub + (i64.gt_s + (get_local $2) + (get_local $3) + ) + (i64.lt_s + (get_local $2) + (get_local $3) + ) + ) + ) + (func $~lib/internal/typedarray/TypedArray#sort|trampoline (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (block $1of1 + (block $0of1 + (block $outOfRange + (br_table $0of1 $1of1 $outOfRange + (get_global $~argc) + ) + ) + (unreachable) + ) + (set_local $1 + (block $~lib/internal/array/defaultComparator|inlined.0 (result i32) + (br $~lib/internal/array/defaultComparator|inlined.0 + (i32.const 0) + ) + ) + ) + ) + (call $~lib/internal/typedarray/TypedArray#sort + (get_local $0) + (get_local $1) + ) + ) + (func $~lib/internal/typedarray/TypedArray#__get (; 28 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (set_local $2 + (i32.load offset=4 + (get_local $0) + ) + ) + (set_local $3 + (i32.shr_u + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (get_local $2) + ) + (i32.const 3) + ) + ) + (if + (i32.ge_u + (get_local $1) + (get_local $3) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 48) + (i32.const 42) + (i32.const 42) + ) + (unreachable) + ) + ) + (block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.12 (result f64) + (set_local $4 + (i32.load + (get_local $0) + ) + ) + (f64.load offset=8 + (i32.add + (i32.add + (get_local $4) + (get_local $2) + ) + (i32.shl + (get_local $1) + (i32.const 3) + ) + ) + ) + ) + ) + (func $~lib/internal/typedarray/TypedArray#__set (; 29 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2572,7 +3821,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 49) + (i32.const 55) (i32.const 42) ) (unreachable) @@ -2599,7 +3848,7 @@ ) ) ) - (func $~lib/typedarray/Uint8ClampedArray#__set (; 21 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/typedarray/Uint8ClampedArray#__set (; 30 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (call $~lib/internal/typedarray/TypedArray#__set @@ -2630,7 +3879,7 @@ ) ) ) - (func $~lib/internal/typedarray/TypedArray#__get (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2659,7 +3908,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 48) - (i32.const 36) + (i32.const 42) (i32.const 42) ) (unreachable) @@ -2685,7 +3934,7 @@ ) ) ) - (func $start (; 23 ;) (type $v) + (func $start (; 32 ;) (type $v) (local $0 i32) (if (i32.eqz @@ -3152,6 +4401,158 @@ (unreachable) ) ) + (set_global $std/typedarray/af64 + (call $~lib/internal/typedarray/TypedArray#constructor + (i32.const 0) + (i32.const 8) + ) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 0) + (f64.const 1) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 1) + (f64.const 2) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 2) + (f64.const 7) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 3) + (f64.const 6) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 4) + (f64.const 5) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 5) + (f64.const 4) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 6) + (f64.const 3) + ) + (call $~lib/internal/typedarray/TypedArray#__set + (get_global $std/typedarray/af64) + (i32.const 7) + (f64.const 8) + ) + (set_global $std/typedarray/af64 + (call $~lib/typedarray/Float64Array#subarray + (get_global $std/typedarray/af64) + (i32.const 2) + (i32.const 6) + ) + ) + (if + (i32.eqz + (i32.eq + (block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) + (set_local $0 + (get_global $std/typedarray/af64) + ) + (i32.shr_s + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (i32.const 3) + ) + ) + (i32.const 4) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 105) + (i32.const 0) + ) + (unreachable) + ) + ) + (drop + (block (result i32) + (set_global $~argc + (i32.const 0) + ) + (call $~lib/internal/typedarray/TypedArray#sort|trampoline + (get_global $std/typedarray/af64) + (i32.const 0) + ) + ) + ) + (if + (i32.eqz + (if (result i32) + (tee_local $0 + (if (result i32) + (tee_local $0 + (if (result i32) + (tee_local $0 + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 0) + ) + (f64.const 4) + ) + ) + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 1) + ) + (f64.const 5) + ) + (get_local $0) + ) + ) + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 2) + ) + (f64.const 6) + ) + (get_local $0) + ) + ) + (f64.eq + (call $~lib/internal/typedarray/TypedArray#__get + (get_global $std/typedarray/af64) + (i32.const 3) + ) + (f64.const 7) + ) + (get_local $0) + ) + ) + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 107) + (i32.const 0) + ) + (unreachable) + ) + ) (set_global $std/typedarray/clampedArr (call $~lib/internal/typedarray/TypedArray#constructor (i32.const 0) @@ -3190,7 +4591,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 98) + (i32.const 114) (i32.const 0) ) (unreachable) @@ -3213,7 +4614,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 99) + (i32.const 115) (i32.const 0) ) (unreachable) @@ -3236,7 +4637,7 @@ (call $~lib/env/abort (i32.const 0) (i32.const 8) - (i32.const 100) + (i32.const 116) (i32.const 0) ) (unreachable)