diff --git a/src/builtins.ts b/src/builtins.ts index 227179bd..b1b68204 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -483,7 +483,7 @@ export namespace BuiltinSymbols { export const runtime_reallocate = "~lib/runtime/runtime.reallocate"; export const runtime_register = "~lib/runtime/runtime.register"; export const runtime_discard = "~lib/runtime/runtime.discard"; - export const runtime_makeArray = "~lib/runtime/runtime.makeArray"; + export const runtime_newArray = "~lib/runtime/runtime.newArray"; // std/gc.ts export const gc_mark_roots = "~lib/gc/__gc_mark_roots"; diff --git a/src/common.ts b/src/common.ts index 8068571d..80846fad 100644 --- a/src/common.ts +++ b/src/common.ts @@ -184,5 +184,7 @@ export namespace CommonSymbols { export const reallocate = "reallocate"; export const register = "register"; export const discard = "discard"; - export const makeArray = "makeArray"; + export const newString = "newString"; + export const newArrayBuffer = "newArrayBuffer"; + export const newArray = "newArray"; } diff --git a/src/compiler.ts b/src/compiler.ts index 90313d90..9ef2de2c 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -6944,13 +6944,13 @@ export class Compiler extends DiagnosticEmitter { // otherwise allocate a new array header and make it wrap a copy of the static buffer } else { - // makeArray(length, classId, alignLog2, staticBuffer) - let expr = this.makeCallDirect(assert(program.makeArrayInstance), [ + // newArray(length, alignLog2, classId, staticBuffer) + let expr = this.makeCallDirect(assert(program.newArrayInstance), [ module.createI32(length), - module.createI32(arrayInstance.ensureId()), program.options.isWasm64 ? module.createI64(elementType.alignLog2) : module.createI32(elementType.alignLog2), + module.createI32(arrayInstance.ensureId()), program.options.isWasm64 ? module.createI64(i64_low(bufferAddress), i64_high(bufferAddress)) : module.createI32(i64_low(bufferAddress)) @@ -6974,17 +6974,17 @@ export class Compiler extends DiagnosticEmitter { var flow = this.currentFlow; var tempThis = flow.getTempLocal(arrayType, false); var tempDataStart = flow.getTempLocal(arrayBufferInstance.type); - var makeArrayInstance = assert(program.makeArrayInstance); + var newArrayInstance = assert(program.newArrayInstance); var stmts = new Array(); - // tempThis = makeArray(length, classId, alignLog2, source = 0) + // tempThis = newArray(length, alignLog2, classId, source = 0) stmts.push( module.createSetLocal(tempThis.index, - this.makeCallDirect(makeArrayInstance, [ + this.makeCallDirect(newArrayInstance, [ module.createI32(length), - module.createI32(arrayInstance.ensureId()), program.options.isWasm64 ? module.createI64(elementType.alignLog2) : module.createI32(elementType.alignLog2), + module.createI32(arrayInstance.ensureId()), program.options.isWasm64 ? module.createI64(0) : module.createI32(0) diff --git a/src/program.ts b/src/program.ts index ab8da777..a3ba8f39 100644 --- a/src/program.ts +++ b/src/program.ts @@ -374,8 +374,8 @@ export class Program extends DiagnosticEmitter { discardInstance: Function | null = null; /** Runtime register function. `register(ref: usize, cid: u32): usize` */ registerInstance: Function | null = null; - /** Runtime make array function. `makeArray(capacity: i32, source: usize = 0, cid: u32): usize` */ - makeArrayInstance: Function | null = null; + /** Runtime make array function. `newArray(length: i32, alignLog2: usize, id: u32, source: usize = 0): usize` */ + newArrayInstance: Function | null = null; /** The kind of garbage collector being present. */ collectorKind: CollectorKind = CollectorKind.NONE; @@ -844,9 +844,9 @@ export class Program extends DiagnosticEmitter { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.registerInstance = this.resolver.resolveFunction(element, null); } - if (element = this.lookupGlobal(BuiltinSymbols.runtime_makeArray)) { + if (element = this.lookupGlobal(BuiltinSymbols.runtime_newArray)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); - this.makeArrayInstance = this.resolver.resolveFunction(element, null); + this.newArrayInstance = this.resolver.resolveFunction(element, null); } // memory allocator interface if (element = this.lookupGlobal("__mem_allocate")) { diff --git a/std/assembly/array.ts b/std/assembly/array.ts index 71cf6bf7..47047e3a 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -43,7 +43,7 @@ export class Array extends ArrayBufferView { static create(capacity: i32 = 0): Array { if (capacity > MAX_BYTELENGTH >>> alignof()) throw new RangeError(E_INVALIDLENGTH); - var array = changetype>(runtime.makeArray(capacity, __runtime_id>(), alignof())); + var array = changetype>(runtime.newArray(capacity, alignof(), __runtime_id>())); memory.fill(array.dataStart, 0, array.dataLength); array.length_ = 0; // ! return array; @@ -233,7 +233,7 @@ export class Array extends ArrayBufferView { concat(other: Array): Array { var thisLen = this.length_; var otherLen = select(0, other.length_, other === null); - var out = changetype>(runtime.makeArray(thisLen + otherLen, __runtime_id>(), alignof())); + var out = changetype>(runtime.newArray(thisLen + otherLen, alignof(), __runtime_id>())); var outStart = out.dataStart; var thisSize = thisLen << alignof(); if (isManaged()) { @@ -321,7 +321,7 @@ export class Array extends ArrayBufferView { map(callbackfn: (value: T, index: i32, array: Array) => U): Array { var length = this.length_; - var out = changetype>(runtime.makeArray(length, __runtime_id>(), alignof())); + var out = changetype>(runtime.newArray(length, alignof(), __runtime_id>())); var outStart = out.dataStart; for (let index = 0; index < min(length, this.length_); ++index) { let value = load(this.dataStart + (index << alignof())); @@ -347,7 +347,7 @@ export class Array extends ArrayBufferView { } filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array { - var result = changetype>(runtime.makeArray(0, __runtime_id>(), alignof())); + var result = changetype>(runtime.newArray(0, alignof(), __runtime_id>())); for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) { let value = load(this.dataStart + (index << alignof())); if (callbackfn(value, index, this)) result.push(value); @@ -435,7 +435,7 @@ export class Array extends ArrayBufferView { begin = begin < 0 ? max(begin + length, 0) : min(begin, length); end = end < 0 ? max(end + length, 0) : min(end , length); length = max(end - begin, 0); - var slice = changetype>(runtime.makeArray(length, __runtime_id>(), alignof())); + var slice = changetype>(runtime.newArray(length, alignof(), __runtime_id>())); var sliceBase = slice.dataStart; var thisBase = this.dataStart + (begin << alignof()); if (isManaged()) { @@ -467,7 +467,7 @@ export class Array extends ArrayBufferView { var length = this.length_; start = start < 0 ? max(length + start, 0) : min(start, length); deleteCount = max(min(deleteCount, length - start), 0); - var result = changetype>(runtime.makeArray(deleteCount, __runtime_id>(), alignof())); + var result = changetype>(runtime.newArray(deleteCount, alignof(), __runtime_id>())); var resultStart = result.dataStart; var thisStart = this.dataStart; var thisBase = thisStart + (start << alignof()); diff --git a/std/assembly/runtime.ts b/std/assembly/runtime.ts index 09b3e8cf..996ced3b 100644 --- a/std/assembly/runtime.ts +++ b/std/assembly/runtime.ts @@ -1,7 +1,7 @@ // The runtime provides common functionality that links runtime interfaces for memory management // and garbage collection to the standard library, making sure it all plays well together. -import { HEADER, HEADER_SIZE, HEADER_MAGIC } from "./util/runtime"; +import { HEADER, HEADER_SIZE, HEADER_MAGIC, adjust } from "./util/runtime"; import { HEAP_BASE, memory } from "./memory"; import { ArrayBufferView } from "./arraybuffer"; @@ -20,6 +20,7 @@ export declare function __runtime_instanceof(id: u32, superId: u32): bool; export class runtime { private constructor() { return unreachable(); } + /** Determines whether a managed object is considered to be an instance of the class represented by the specified runtime id. */ @unsafe static instanceof(ref: usize, id: u32): bool { // keyword return ref @@ -34,17 +35,7 @@ export class runtime { /** Runtime implementation. */ export namespace runtime { - /** Adjusts an allocation to actual block size. Primarily targets TLSF. */ - export function adjust(payloadSize: usize): usize { - // round up to power of 2, e.g. with HEADER_SIZE=8: - // 0 -> 2^3 = 8 - // 1..8 -> 2^4 = 16 - // 9..24 -> 2^5 = 32 - // ... - // MAX_LENGTH -> 2^30 = 0x40000000 (MAX_SIZE_32) - return 1 << (32 - clz(payloadSize + HEADER_SIZE - 1)); - } - + /** Allocates the memory necessary to represent a managed object of the specified size. */ // @ts-ignore: decorator @unsafe export function allocate(payloadSize: usize): usize { @@ -58,6 +49,7 @@ export namespace runtime { return changetype(header) + HEADER_SIZE; } + /** Reallocates the memory of a managed object that turned out to be too small or too large. */ // @ts-ignore: decorator @unsafe export function reallocate(ref: usize, newPayloadSize: usize): usize { @@ -103,6 +95,7 @@ export namespace runtime { return ref; } + /** Discards the memory of a managed object that hasn't been registered yet. */ // @ts-ignore: decorator @unsafe export function discard(ref: usize): void { @@ -116,32 +109,53 @@ export namespace runtime { } } + /** Registers a managed object of the kind represented by the specified runtime id. */ // @ts-ignore: decorator @unsafe - export function register(ref: usize, classId: u32): usize { + export function register(ref: usize, id: u32): usize { if (!ASC_NO_ASSERT) { assert(ref > HEAP_BASE); // must be a heap object let header = changetype
(ref - HEADER_SIZE); assert(header.classId == HEADER_MAGIC); - header.classId = classId; + header.classId = id; } else { - changetype
(ref - HEADER_SIZE).classId = classId; + changetype
(ref - HEADER_SIZE).classId = id; } if (isDefined(__ref_register)) __ref_register(ref); return ref; } + /** Allocates and registers, but doesn't initialize the data of, a new `String` of the specified length. */ // @ts-ignore: decorator @unsafe - export function makeArray(capacity: i32, id: u32, alignLog2: usize, source: usize = 0): usize { + export function newString(length: i32): usize { + return runtime.register(runtime.allocate(length << 1), __runtime_id()); + } + + /** Allocates and registers, but doesn't initialize the data of, a new `ArrayBuffer` of the specified byteLength. */ + // @ts-ignore: decorator + @unsafe + export function newArrayBuffer(byteLength: i32): usize { + return runtime.register(runtime.allocate(byteLength), __runtime_id()); + } + + /** Allocates and registers, but doesn't initialize the data of, a new `Array` of the specified length and element alignment.*/ + // @ts-ignore: decorator + @unsafe + export function newArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize { + // TODO: This API isn't great, but the compiler requires it for array literals anyway, + // that is when an array literal is encountered and its data is static, this function is + // called and the static buffer provided as `data`. This function can also be used to + // create typed arrays in that `Array` also implements `ArrayBufferView` but has an + // additional `.length_` property that remains unused overhead for typed arrays. var array = runtime.register(runtime.allocate(offsetof()), id); - var bufferSize = capacity << alignLog2; - var buffer = runtime.register(runtime.allocate(capacity << alignLog2), __runtime_id()); + var bufferSize = length << alignLog2; + var buffer = runtime.register(runtime.allocate(bufferSize), __runtime_id()); changetype(array).data = changetype(buffer); // links changetype(array).dataStart = buffer; changetype(array).dataLength = bufferSize; - store(changetype(array), capacity, offsetof("length_")); - if (source) memory.copy(buffer, source, bufferSize); + store(changetype(array), length, offsetof("length_")); + if (data) memory.copy(buffer, data, bufferSize); return array; } } diff --git a/std/assembly/string.ts b/std/assembly/string.ts index 6d02e9cb..0e836f77 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -356,16 +356,16 @@ import { ArrayBufferView } from "./arraybuffer"; split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] { assert(this !== null); - if (!limit) return changetype(runtime.makeArray(0, __runtime_id(), alignof())); + if (!limit) return changetype(runtime.newArray(0, alignof(), __runtime_id())); if (separator === null) return [this]; var length: isize = this.length; var sepLen: isize = separator.length; if (limit < 0) limit = i32.MAX_VALUE; if (!sepLen) { - if (!length) return changetype(runtime.makeArray(0, __runtime_id(), alignof())); + if (!length) return changetype(runtime.newArray(0, alignof(), __runtime_id())); // split by chars length = min(length, limit); - let result = changetype(runtime.makeArray(length, __runtime_id(), alignof())); + let result = changetype(runtime.newArray(length, alignof(), __runtime_id())); let resultStart = changetype(result).dataStart; for (let i: isize = 0; i < length; ++i) { let charStr = runtime.allocate(2); @@ -379,11 +379,11 @@ import { ArrayBufferView } from "./arraybuffer"; } return result; } else if (!length) { - let result = changetype(runtime.makeArray(1, __runtime_id(), alignof())); + let result = changetype(runtime.newArray(1, alignof(), __runtime_id())); store(changetype(result).dataStart, ""); // no need to register/link return result; } - var result = changetype(runtime.makeArray(0, __runtime_id(), alignof())); + var result = changetype(runtime.newArray(0, alignof(), __runtime_id())); var end = 0, start = 0, i = 0; while ((end = this.indexOf(separator!, start)) != -1) { let len = end - start; @@ -398,7 +398,7 @@ import { ArrayBufferView } from "./arraybuffer"; start = end + sepLen; } if (!start) { - let result = changetype(runtime.makeArray(1, __runtime_id(), alignof())); + let result = changetype(runtime.newArray(1, alignof(), __runtime_id())); unchecked(result[0] = this); return result; } diff --git a/std/assembly/util/runtime.ts b/std/assembly/util/runtime.ts index c1307da4..8b98895d 100644 --- a/std/assembly/util/runtime.ts +++ b/std/assembly/util/runtime.ts @@ -34,3 +34,14 @@ export const HEADER_MAGIC: u32 = 0xA55E4B17; // @ts-ignore @lazy export const MAX_BYTELENGTH: i32 = MAX_SIZE_32 - HEADER_SIZE; + +/** Adjusts an allocation to actual block size. Primarily targets TLSF. */ +export function adjust(payloadSize: usize): usize { + // round up to power of 2, e.g. with HEADER_SIZE=8: + // 0 -> 2^3 = 8 + // 1..8 -> 2^4 = 16 + // 9..24 -> 2^5 = 32 + // ... + // MAX_LENGTH -> 2^30 = 0x40000000 (MAX_SIZE_32) + return 1 << (32 - clz(payloadSize + HEADER_SIZE - 1)); +} diff --git a/tests/compiler/call-super.optimized.wat b/tests/compiler/call-super.optimized.wat index d681e6e2..c23bee86 100644 --- a/tests/compiler/call-super.optimized.wat +++ b/tests/compiler/call-super.optimized.wat @@ -106,7 +106,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -121,7 +121,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/call-super.untouched.wat b/tests/compiler/call-super.untouched.wat index b7f7c1cf..158fa3bb 100644 --- a/tests/compiler/call-super.untouched.wat +++ b/tests/compiler/call-super.untouched.wat @@ -18,7 +18,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -117,7 +117,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -139,7 +139,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -156,7 +156,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/constructor.optimized.wat b/tests/compiler/constructor.optimized.wat index 1aa1c7c2..cd28ee7b 100644 --- a/tests/compiler/constructor.optimized.wat +++ b/tests/compiler/constructor.optimized.wat @@ -1283,7 +1283,7 @@ if i32.const 0 i32.const 88 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -1298,7 +1298,7 @@ if i32.const 0 i32.const 88 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/constructor.untouched.wat b/tests/compiler/constructor.untouched.wat index 3a430f25..2fc23bfa 100644 --- a/tests/compiler/constructor.untouched.wat +++ b/tests/compiler/constructor.untouched.wat @@ -55,7 +55,7 @@ (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -1435,7 +1435,7 @@ (func $~lib/runtime/runtime.allocate (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -1563,7 +1563,7 @@ if i32.const 0 i32.const 88 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -1580,7 +1580,7 @@ if i32.const 0 i32.const 88 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index 4bb693c9..97d6ada4 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -150,7 +150,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -165,7 +165,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index e975a0c7..4e9fdb95 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -75,7 +75,7 @@ (func $exports/Car.getNumTires (; 4 ;) (type $FUNCSIG$i) (result i32) global.get $exports/Car.TIRES ) - (func $~lib/runtime/runtime.adjust (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -174,7 +174,7 @@ (func $~lib/runtime/runtime.allocate (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -196,7 +196,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -213,7 +213,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc.optimized.wat b/tests/compiler/gc.optimized.wat index 2f247508..e3ab7c4f 100644 --- a/tests/compiler/gc.optimized.wat +++ b/tests/compiler/gc.optimized.wat @@ -49,29 +49,20 @@ (export "table" (table $0)) (export "main" (func $gc/main)) (export "runtime.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "runtime.adjust" (func $~lib/runtime/runtime.adjust)) (export "runtime.allocate" (func $~lib/runtime/runtime.allocate)) (export "runtime.reallocate" (func $~lib/runtime/runtime.reallocate)) (export "runtime.discard" (func $~lib/runtime/runtime.discard)) (export "runtime.register" (func $~lib/runtime/runtime.register)) + (export "runtime.newString" (func $~lib/runtime/runtime.newString)) + (export "runtime.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) (export ".setargc" (func $~lib/setargc)) - (export "runtime.makeArray" (func $~lib/runtime/runtime.makeArray|trampoline)) + (export "runtime.newArray" (func $~lib/runtime/runtime.newArray|trampoline)) (export "gc.implemented" (global $~lib/gc/gc.implemented)) (export "gc.collect" (func $~lib/gc/gc.collect)) (export "gc.retain" (func $~lib/gc/gc.retain)) (export "gc.release" (func $~lib/gc/gc.release)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 15 - i32.add - i32.clz - i32.sub - i32.shl - ) - (func $~lib/allocator/arena/__mem_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -133,7 +124,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -160,7 +151,7 @@ i32.const 16 i32.add ) - (func $gc/_dummy/__ref_register (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $gc/_dummy/__ref_register (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) i32.const 72 i32.const 1 local.get $0 @@ -177,7 +168,7 @@ local.get $0 global.set $gc/_dummy/register_ref ) - (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 292 @@ -185,7 +176,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -200,7 +191,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -212,7 +203,7 @@ call $gc/_dummy/__ref_register local.get $0 ) - (func $~lib/memory/memory.fill (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/memory/memory.fill (; 6 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) block $~lib/util/memory/memset|inlined.0 local.get $1 @@ -423,7 +414,7 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 1073741808 @@ -445,7 +436,7 @@ i32.const 4 call $~lib/runtime/runtime.register ) - (func $gc/_dummy/__ref_link (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $gc/_dummy/__ref_link (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) i32.const 200 i32.const 2 local.get $0 @@ -465,7 +456,7 @@ local.get $0 global.set $gc/_dummy/link_parentRef ) - (func $gc/_dummy/__ref_unlink (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $gc/_dummy/__ref_unlink (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) i32.const 232 i32.const 2 local.get $0 @@ -485,7 +476,7 @@ local.get $1 global.set $gc/_dummy/unlink_parentRef ) - (func $~lib/set/Set#clear (; 11 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 10 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -548,7 +539,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 12 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 11 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 call $~lib/runtime/runtime.allocate @@ -576,7 +567,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -607,7 +598,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/set/Set#find (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 13 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -650,7 +641,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -659,7 +650,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -794,7 +785,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -877,7 +868,7 @@ i32.store end ) - (func $~lib/gc/gc.retain (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/gc/gc.retain (; 17 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) global.get $~lib/gc/ROOT local.tee $1 @@ -893,7 +884,7 @@ call $gc/_dummy/__ref_link end ) - (func $~lib/set/Set#delete (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -953,7 +944,7 @@ call $~lib/set/Set#rehash end ) - (func $~lib/gc/gc.release (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/gc/gc.release (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) global.get $~lib/gc/ROOT local.tee $1 @@ -968,7 +959,7 @@ call $gc/_dummy/__ref_unlink end ) - (func $~lib/gc/gc.collect (; 21 ;) (type $FUNCSIG$v) + (func $~lib/gc/gc.collect (; 20 ;) (type $FUNCSIG$v) i32.const 272 i32.const 0 f64.const 0 @@ -982,7 +973,7 @@ i32.add global.set $gc/_dummy/collect_count ) - (func $gc/main (; 22 ;) (type $FUNCSIG$v) + (func $gc/main (; 21 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -1133,7 +1124,7 @@ unreachable end ) - (func $~lib/runtime/runtime.instanceof (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.instanceof (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 if (result i32) local.get $0 @@ -1146,7 +1137,7 @@ i32.const 0 end ) - (func $~lib/util/memory/memcpy (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/util/memory/memcpy (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1993,7 +1984,7 @@ i32.store8 end ) - (func $~lib/memory/memory.copy (; 25 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/memory/memory.copy (; 24 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) block $~lib/util/memory/memmove|inlined.0 @@ -2187,7 +2178,7 @@ end end ) - (func $~lib/runtime/runtime.reallocate (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2264,7 +2255,7 @@ if i32.const 0 i32.const 24 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -2292,14 +2283,14 @@ i32.store offset=4 local.get $0 ) - (func $~lib/runtime/runtime.discard (; 27 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 292 i32.le_u if i32.const 0 i32.const 24 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -2313,69 +2304,83 @@ if i32.const 0 i32.const 24 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable end ) - (func $~lib/runtime/runtime.makeArray (; 28 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newString (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + i32.const 2 + call $~lib/runtime/runtime.register + ) + (func $~lib/runtime/runtime.newArrayBuffer (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/runtime/runtime.allocate + i32.const 4 + call $~lib/runtime/runtime.register + ) + (func $~lib/runtime/runtime.newArray (; 29 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 - call $~lib/runtime/runtime.register - local.tee $4 - local.set $5 - local.get $0 local.get $2 + call $~lib/runtime/runtime.register + local.tee $2 + local.set $4 + local.get $0 + local.get $1 i32.shl - local.tee $6 + local.tee $5 call $~lib/runtime/runtime.allocate i32.const 4 call $~lib/runtime/runtime.register - local.tee $7 + local.tee $6 local.tee $1 - local.get $4 + local.get $2 i32.load - local.tee $2 + local.tee $7 i32.ne if - local.get $2 + local.get $7 if - local.get $2 - local.get $5 + local.get $7 + local.get $4 call $gc/_dummy/__ref_unlink end local.get $1 - local.get $5 + local.get $4 call $gc/_dummy/__ref_link end - local.get $4 + local.get $2 local.get $1 i32.store - local.get $4 - local.get $7 - i32.store offset=4 - local.get $4 + local.get $2 local.get $6 + i32.store offset=4 + local.get $2 + local.get $5 i32.store offset=8 - local.get $4 + local.get $2 local.get $0 i32.store offset=12 local.get $3 if - local.get $7 - local.get $3 local.get $6 + local.get $3 + local.get $5 call $~lib/memory/memory.copy end - local.get $4 + local.get $2 ) - (func $~lib/runtime/__runtime_instanceof (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/__runtime_instanceof (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $nope block $~lib/arraybuffer/ArrayBuffer block $~lib/set/Set @@ -2408,10 +2413,10 @@ end i32.const 0 ) - (func $null (; 30 ;) (type $FUNCSIG$v) + (func $null (; 31 ;) (type $FUNCSIG$v) nop ) - (func $~lib/runtime/runtime.makeArray|trampoline (; 31 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray|trampoline (; 32 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -2429,9 +2434,9 @@ local.get $1 local.get $2 local.get $3 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray ) - (func $~lib/setargc (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/setargc (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 global.set $~lib/argc ) diff --git a/tests/compiler/gc.untouched.wat b/tests/compiler/gc.untouched.wat index e3cff7fc..8ce0dac7 100644 --- a/tests/compiler/gc.untouched.wat +++ b/tests/compiler/gc.untouched.wat @@ -48,19 +48,20 @@ (export "table" (table $0)) (export "main" (func $gc/main)) (export "runtime.instanceof" (func $~lib/runtime/runtime.instanceof)) - (export "runtime.adjust" (func $~lib/runtime/runtime.adjust)) (export "runtime.allocate" (func $~lib/runtime/runtime.allocate)) (export "runtime.reallocate" (func $~lib/runtime/runtime.reallocate)) (export "runtime.discard" (func $~lib/runtime/runtime.discard)) (export "runtime.register" (func $~lib/runtime/runtime.register)) + (export "runtime.newString" (func $~lib/runtime/runtime.newString)) + (export "runtime.newArrayBuffer" (func $~lib/runtime/runtime.newArrayBuffer)) (export ".setargc" (func $~lib/setargc)) - (export "runtime.makeArray" (func $~lib/runtime/runtime.makeArray|trampoline)) + (export "runtime.newArray" (func $~lib/runtime/runtime.newArray|trampoline)) (export "gc.implemented" (global $~lib/gc/gc.implemented)) (export "gc.collect" (func $~lib/gc/gc.collect)) (export "gc.retain" (func $~lib/gc/gc.retain)) (export "gc.release" (func $~lib/gc/gc.release)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -159,7 +160,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -204,7 +205,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -221,7 +222,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2802,10 +2803,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust local.set $4 local.get $3 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -2855,7 +2856,7 @@ if i32.const 0 i32.const 24 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -2897,7 +2898,7 @@ if i32.const 0 i32.const 24 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -2914,7 +2915,7 @@ if i32.const 0 i32.const 24 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable @@ -2922,7 +2923,21 @@ local.get $1 call $~lib/memory/memory.free ) - (func $~lib/runtime/runtime.makeArray (; 33 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newString (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + i32.const 2 + call $~lib/runtime/runtime.register + ) + (func $~lib/runtime/runtime.newArrayBuffer (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/runtime/runtime.allocate + i32.const 4 + call $~lib/runtime/runtime.register + ) + (func $~lib/runtime/runtime.newArray (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -2931,16 +2946,14 @@ (local $9 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 + local.get $2 call $~lib/runtime/runtime.register local.set $4 local.get $0 - local.get $2 + local.get $1 i32.shl local.set $5 - local.get $0 - local.get $2 - i32.shl + local.get $5 call $~lib/runtime/runtime.allocate i32.const 4 call $~lib/runtime/runtime.register @@ -2986,10 +2999,10 @@ end local.get $4 ) - (func $~lib/runtime/runtime#constructor (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime#constructor (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) unreachable ) - (func $start (; 35 ;) (type $FUNCSIG$v) + (func $start (; 37 ;) (type $FUNCSIG$v) global.get $~lib/memory/HEAP_BASE i32.const 7 i32.add @@ -3004,7 +3017,7 @@ call $~lib/set/Set#constructor global.set $~lib/gc/ROOT ) - (func $~lib/runtime/__runtime_instanceof (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/__runtime_instanceof (; 38 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) block $nope block $~lib/arraybuffer/ArrayBuffer block $~lib/set/Set @@ -3036,9 +3049,9 @@ i32.const 0 return ) - (func $null (; 37 ;) (type $FUNCSIG$v) + (func $null (; 39 ;) (type $FUNCSIG$v) ) - (func $~lib/runtime/runtime.makeArray|trampoline (; 38 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray|trampoline (; 40 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -3056,9 +3069,9 @@ local.get $1 local.get $2 local.get $3 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray ) - (func $~lib/setargc (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/setargc (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 global.set $~lib/argc ) diff --git a/tests/compiler/gc/global-assign.optimized.wat b/tests/compiler/gc/global-assign.optimized.wat index a94da9a9..1a400cab 100644 --- a/tests/compiler/gc/global-assign.optimized.wat +++ b/tests/compiler/gc/global-assign.optimized.wat @@ -137,7 +137,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -152,7 +152,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/global-assign.untouched.wat b/tests/compiler/gc/global-assign.untouched.wat index 8440abb0..4500c3b9 100644 --- a/tests/compiler/gc/global-assign.untouched.wat +++ b/tests/compiler/gc/global-assign.untouched.wat @@ -38,7 +38,7 @@ (export "table" (table $0)) (export "main" (func $gc/global-assign/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -137,7 +137,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -182,7 +182,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -199,7 +199,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/global-init.optimized.wat b/tests/compiler/gc/global-init.optimized.wat index ffe8da48..c4844bf6 100644 --- a/tests/compiler/gc/global-init.optimized.wat +++ b/tests/compiler/gc/global-init.optimized.wat @@ -136,7 +136,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -151,7 +151,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/global-init.untouched.wat b/tests/compiler/gc/global-init.untouched.wat index bf5fa6c0..d23c9b56 100644 --- a/tests/compiler/gc/global-init.untouched.wat +++ b/tests/compiler/gc/global-init.untouched.wat @@ -37,7 +37,7 @@ (export "table" (table $0)) (export "main" (func $gc/global-init/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -136,7 +136,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -181,7 +181,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -198,7 +198,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/itcm/trace.optimized.wat b/tests/compiler/gc/itcm/trace.optimized.wat index c8208fe6..b758331a 100644 --- a/tests/compiler/gc/itcm/trace.optimized.wat +++ b/tests/compiler/gc/itcm/trace.optimized.wat @@ -341,7 +341,7 @@ if i32.const 0 i32.const 128 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -356,7 +356,7 @@ if i32.const 0 i32.const 128 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -1859,7 +1859,7 @@ if i32.const 0 i32.const 128 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/itcm/trace.untouched.wat b/tests/compiler/gc/itcm/trace.untouched.wat index 8cdb20ef..2db214ef 100644 --- a/tests/compiler/gc/itcm/trace.untouched.wat +++ b/tests/compiler/gc/itcm/trace.untouched.wat @@ -61,7 +61,7 @@ (export "table" (table $0)) (export "main" (func $gc/itcm/trace/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -160,7 +160,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -390,7 +390,7 @@ if i32.const 0 i32.const 128 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -407,7 +407,7 @@ if i32.const 0 i32.const 128 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2413,10 +2413,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust local.set $4 local.get $3 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -2466,7 +2466,7 @@ if i32.const 0 i32.const 128 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/rc/global-assign.optimized.wat b/tests/compiler/gc/rc/global-assign.optimized.wat index 22353b47..08203d35 100644 --- a/tests/compiler/gc/rc/global-assign.optimized.wat +++ b/tests/compiler/gc/rc/global-assign.optimized.wat @@ -143,7 +143,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -158,7 +158,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/rc/global-assign.untouched.wat b/tests/compiler/gc/rc/global-assign.untouched.wat index 960f9e08..68508f9d 100644 --- a/tests/compiler/gc/rc/global-assign.untouched.wat +++ b/tests/compiler/gc/rc/global-assign.untouched.wat @@ -36,7 +36,7 @@ (export "table" (table $0)) (export "main" (func $gc/rc/global-assign/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -135,7 +135,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -180,7 +180,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -197,7 +197,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/rc/global-init.optimized.wat b/tests/compiler/gc/rc/global-init.optimized.wat index f522db6f..e2283700 100644 --- a/tests/compiler/gc/rc/global-init.optimized.wat +++ b/tests/compiler/gc/rc/global-init.optimized.wat @@ -139,7 +139,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -154,7 +154,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/gc/rc/global-init.untouched.wat b/tests/compiler/gc/rc/global-init.untouched.wat index 2215cd0f..d960f976 100644 --- a/tests/compiler/gc/rc/global-init.untouched.wat +++ b/tests/compiler/gc/rc/global-init.untouched.wat @@ -34,7 +34,7 @@ (export "table" (table $0)) (export "main" (func $gc/rc/global-init/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -133,7 +133,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -178,7 +178,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -195,7 +195,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/getter-call.optimized.wat b/tests/compiler/getter-call.optimized.wat index 56b9ede9..da6cab35 100644 --- a/tests/compiler/getter-call.optimized.wat +++ b/tests/compiler/getter-call.optimized.wat @@ -85,7 +85,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -100,7 +100,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/getter-call.untouched.wat b/tests/compiler/getter-call.untouched.wat index d56f743a..cccd911f 100644 --- a/tests/compiler/getter-call.untouched.wat +++ b/tests/compiler/getter-call.untouched.wat @@ -20,7 +20,7 @@ (export "table" (table $0)) (export "test" (func $getter-call/test)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -119,7 +119,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -141,7 +141,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -158,7 +158,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/inlining.optimized.wat b/tests/compiler/inlining.optimized.wat index b3a3e14c..ca0bc716 100644 --- a/tests/compiler/inlining.optimized.wat +++ b/tests/compiler/inlining.optimized.wat @@ -131,7 +131,7 @@ if i32.const 0 i32.const 48 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -146,7 +146,7 @@ if i32.const 0 i32.const 48 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/inlining.untouched.wat b/tests/compiler/inlining.untouched.wat index 1803bad4..22a9c236 100644 --- a/tests/compiler/inlining.untouched.wat +++ b/tests/compiler/inlining.untouched.wat @@ -284,7 +284,7 @@ unreachable end ) - (func $~lib/runtime/runtime.adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -383,7 +383,7 @@ (func $~lib/runtime/runtime.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -405,7 +405,7 @@ if i32.const 0 i32.const 48 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -422,7 +422,7 @@ if i32.const 0 i32.const 48 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index 6da86e17..fc6baa07 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -303,7 +303,7 @@ if i32.const 0 i32.const 464 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -318,7 +318,7 @@ if i32.const 0 i32.const 464 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2451,7 +2451,7 @@ if i32.const 0 i32.const 464 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -2465,7 +2465,7 @@ if i32.const 0 i32.const 464 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 058ac0ff..258c73fa 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -135,7 +135,7 @@ unreachable unreachable ) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -234,7 +234,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -399,7 +399,7 @@ if i32.const 0 i32.const 464 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -416,7 +416,7 @@ if i32.const 0 i32.const 464 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -3534,7 +3534,7 @@ if i32.const 0 i32.const 464 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -3551,7 +3551,7 @@ if i32.const 0 i32.const 464 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/optional-typeparameters.optimized.wat b/tests/compiler/optional-typeparameters.optimized.wat index 3a7909e2..428e2993 100644 --- a/tests/compiler/optional-typeparameters.optimized.wat +++ b/tests/compiler/optional-typeparameters.optimized.wat @@ -100,7 +100,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -115,7 +115,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat index 1ca1bb2b..f7956494 100644 --- a/tests/compiler/optional-typeparameters.untouched.wat +++ b/tests/compiler/optional-typeparameters.untouched.wat @@ -27,7 +27,7 @@ (func $optional-typeparameters/testDerived (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 ) - (func $~lib/runtime/runtime.adjust (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -126,7 +126,7 @@ (func $~lib/runtime/runtime.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -148,7 +148,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -165,7 +165,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/runtime/instanceof.optimized.wat b/tests/compiler/runtime/instanceof.optimized.wat index 138d08b8..4a8c6066 100644 --- a/tests/compiler/runtime/instanceof.optimized.wat +++ b/tests/compiler/runtime/instanceof.optimized.wat @@ -143,7 +143,7 @@ if i32.const 0 i32.const 88 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -158,7 +158,7 @@ if i32.const 0 i32.const 88 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/runtime/instanceof.untouched.wat b/tests/compiler/runtime/instanceof.untouched.wat index d0f4fbdb..f88df697 100644 --- a/tests/compiler/runtime/instanceof.untouched.wat +++ b/tests/compiler/runtime/instanceof.untouched.wat @@ -45,7 +45,7 @@ (export "table" (table $0)) (export "main" (func $runtime/instanceof/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -144,7 +144,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -189,7 +189,7 @@ if i32.const 0 i32.const 88 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -206,7 +206,7 @@ if i32.const 0 i32.const 88 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index c2acc830..d63addae 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -177,7 +177,7 @@ if i32.const 0 i32.const 296 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -192,7 +192,7 @@ if i32.const 0 i32.const 296 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -202,40 +202,40 @@ i32.store local.get $0 ) - (func $~lib/runtime/runtime.makeArray (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $0 - call $~lib/runtime/runtime.register - local.set $0 - i32.const 3 local.get $1 + call $~lib/runtime/runtime.register + local.set $1 + i32.const 3 + local.get $0 i32.shl - local.tee $1 + local.tee $0 call $~lib/runtime/runtime.allocate i32.const 1 call $~lib/runtime/runtime.register local.tee $2 local.tee $3 - local.get $0 + local.get $1 i32.load i32.ne drop - local.get $0 + local.get $1 local.get $3 i32.store - local.get $0 + local.get $1 local.get $2 i32.store offset=4 - local.get $0 local.get $1 - i32.store offset=8 local.get $0 + i32.store offset=8 + local.get $1 i32.const 3 i32.store offset=12 - local.get $0 + local.get $1 ) (func $std/array-literal/Ref#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) i32.const 0 @@ -365,9 +365,9 @@ global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset - i32.const 2 i32.const 0 - call $~lib/runtime/runtime.makeArray + i32.const 2 + call $~lib/runtime/runtime.newArray local.tee $2 i32.load offset=4 local.tee $0 @@ -443,9 +443,9 @@ end i32.const 0 global.set $std/array-literal/i - i32.const 4 i32.const 2 - call $~lib/runtime/runtime.makeArray + i32.const 4 + call $~lib/runtime/runtime.newArray local.tee $2 i32.load offset=4 local.tee $0 @@ -519,9 +519,9 @@ call $~lib/env/abort unreachable end - i32.const 6 i32.const 2 - call $~lib/runtime/runtime.makeArray + i32.const 6 + call $~lib/runtime/runtime.newArray local.tee $2 i32.load offset=4 local.tee $0 @@ -547,9 +547,9 @@ call $~lib/env/abort unreachable end - i32.const 8 i32.const 2 - call $~lib/runtime/runtime.makeArray + i32.const 8 + call $~lib/runtime/runtime.newArray local.tee $2 i32.load offset=4 local.tee $0 diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 37e040cf..192f819e 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -103,7 +103,7 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $~lib/runtime/runtime.adjust (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -202,7 +202,7 @@ (func $~lib/runtime/runtime.allocate (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -233,7 +233,7 @@ if i32.const 0 i32.const 296 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -250,7 +250,7 @@ if i32.const 0 i32.const 296 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -1700,7 +1700,7 @@ end end ) - (func $~lib/runtime/runtime.makeArray (; 17 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 17 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -1709,16 +1709,14 @@ (local $9 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 + local.get $2 call $~lib/runtime/runtime.register local.set $4 local.get $0 - local.get $2 + local.get $1 i32.shl local.set $5 - local.get $0 - local.get $2 - i32.shl + local.get $5 call $~lib/runtime/runtime.allocate i32.const 1 call $~lib/runtime/runtime.register @@ -1935,10 +1933,10 @@ global.set $~lib/allocator/arena/offset block (result i32) i32.const 3 + i32.const 0 i32.const 2 i32.const 0 - i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $0 local.get $0 i32.load offset=4 @@ -2028,10 +2026,10 @@ global.set $std/array-literal/i block (result i32) i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $1 local.get $1 i32.load offset=4 @@ -2119,10 +2117,10 @@ end block (result i32) i32.const 3 - i32.const 6 i32.const 2 + i32.const 6 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $0 local.get $0 i32.load offset=4 @@ -2178,10 +2176,10 @@ end block (result i32) i32.const 3 - i32.const 8 i32.const 2 + i32.const 8 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $1 local.get $1 i32.load offset=4 diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 6ce4211e..aca7f14f 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -787,7 +787,7 @@ if i32.const 0 i32.const 80 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -802,7 +802,7 @@ if i32.const 0 i32.const 80 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2010,46 +2010,46 @@ end end ) - (func $~lib/runtime/runtime.makeArray (; 12 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 12 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 - call $~lib/runtime/runtime.register - local.set $1 - local.get $0 local.get $2 + call $~lib/runtime/runtime.register + local.set $2 + local.get $0 + local.get $1 i32.shl local.tee $4 call $~lib/runtime/runtime.allocate i32.const 2 call $~lib/runtime/runtime.register - local.tee $2 + local.tee $1 local.set $5 - local.get $1 + local.get $2 i32.load drop - local.get $1 + local.get $2 local.get $5 i32.store - local.get $1 local.get $2 - i32.store offset=4 local.get $1 + i32.store offset=4 + local.get $2 local.get $4 i32.store offset=8 - local.get $1 + local.get $2 local.get $0 i32.store offset=12 local.get $3 if - local.get $2 + local.get $1 local.get $3 local.get $4 call $~lib/memory/memory.copy end - local.get $1 + local.get $2 ) (func $~lib/array/Array#__get (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 @@ -2340,7 +2340,7 @@ if i32.const 0 i32.const 80 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -2485,10 +2485,10 @@ select local.tee $3 i32.add - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $4 i32.load offset=4 local.tee $5 @@ -2912,10 +2912,10 @@ i32.gt_s select local.tee $2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $4 i32.load offset=4 drop @@ -3403,10 +3403,10 @@ local.get $0 i32.load offset=12 local.tee $3 - i32.const 9 i32.const 2 + i32.const 9 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $4 i32.load offset=4 local.set $5 @@ -3493,10 +3493,10 @@ local.get $0 i32.load offset=12 local.tee $4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.load offset=4 local.set $5 loop $repeat|0 @@ -3567,10 +3567,10 @@ (local $4 i32) (local $5 i32) i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $4 local.get $0 i32.load offset=12 @@ -5322,10 +5322,10 @@ unreachable end local.get $0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 i32.const 0 @@ -5513,10 +5513,10 @@ (func $~lib/array/Array.create<~lib/array/Array> (; 99 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 512 - i32.const 11 i32.const 2 + i32.const 11 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 i32.const 0 @@ -5773,10 +5773,10 @@ (func $~lib/array/Array.create> (; 107 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 512 - i32.const 12 i32.const 2 + i32.const 12 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 i32.const 0 @@ -6063,10 +6063,10 @@ (func $~lib/array/Array.create<~lib/string/String> (; 115 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 400 - i32.const 15 i32.const 2 + i32.const 15 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 i32.const 0 @@ -6323,7 +6323,7 @@ if i32.const 0 i32.const 80 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -6337,7 +6337,7 @@ if i32.const 0 i32.const 80 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable @@ -10030,10 +10030,10 @@ call $~lib/array/Array#fill global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 248 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/array/isArraysEqual i32.eqz if @@ -10051,10 +10051,10 @@ call $~lib/array/Array#fill global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 320 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/array/isArraysEqual i32.eqz if @@ -10072,10 +10072,10 @@ call $~lib/array/Array#fill global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 344 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/array/isArraysEqual i32.eqz if @@ -10093,10 +10093,10 @@ call $~lib/array/Array#fill global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 368 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/array/isArraysEqual i32.eqz if @@ -10114,10 +10114,10 @@ call $~lib/array/Array#fill global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 392 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/array/isArraysEqual i32.eqz if @@ -10135,10 +10135,10 @@ call $~lib/array/Array#fill global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 488 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10157,10 +10157,10 @@ call $~lib/array/Array#fill global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 528 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10179,10 +10179,10 @@ call $~lib/array/Array#fill global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 568 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10201,10 +10201,10 @@ call $~lib/array/Array#fill global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 608 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10223,10 +10223,10 @@ call $~lib/array/Array#fill global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 648 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10572,10 +10572,10 @@ end global.get $std/array/out i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 688 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#concat drop global.get $std/array/arr @@ -10831,10 +10831,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 752 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -10842,10 +10842,10 @@ i32.const 2147483647 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 792 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10858,10 +10858,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 832 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -10869,10 +10869,10 @@ i32.const 2147483647 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 872 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10885,10 +10885,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 912 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -10896,10 +10896,10 @@ i32.const 2147483647 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 952 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10912,10 +10912,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 992 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 2 @@ -10923,10 +10923,10 @@ i32.const 2147483647 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1032 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10939,10 +10939,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1072 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -10950,10 +10950,10 @@ i32.const 4 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1112 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10966,10 +10966,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1152 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -10977,10 +10977,10 @@ i32.const 4 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1192 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10993,10 +10993,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1232 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -11004,10 +11004,10 @@ i32.const 4 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1272 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11020,10 +11020,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1312 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -11031,10 +11031,10 @@ i32.const 2147483647 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1352 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11047,10 +11047,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1392 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -11058,10 +11058,10 @@ i32.const -1 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1432 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11074,10 +11074,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1472 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -11085,10 +11085,10 @@ i32.const -2 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1512 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11101,10 +11101,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1552 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -11112,10 +11112,10 @@ i32.const -1 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1592 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11128,10 +11128,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1632 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -11139,10 +11139,10 @@ i32.const 2147483647 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1672 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11967,10 +11967,10 @@ i32.const 2147483647 call $~lib/array/Array#splice i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1784 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11984,10 +11984,10 @@ end global.get $std/array/sarr i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1824 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12000,20 +12000,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1840 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 i32.const 2147483647 call $~lib/array/Array#splice i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1880 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12027,10 +12027,10 @@ end global.get $std/array/sarr i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1912 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12043,20 +12043,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1936 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 i32.const 2 call $~lib/array/Array#splice i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1976 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12070,10 +12070,10 @@ end global.get $std/array/sarr i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2000 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12086,20 +12086,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2032 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 0 i32.const 1 call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2072 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12113,10 +12113,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2096 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12129,20 +12129,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2128 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -1 i32.const 2147483647 call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2168 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12156,10 +12156,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2192 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12172,20 +12172,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2224 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 i32.const 2147483647 call $~lib/array/Array#splice i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2264 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12199,10 +12199,10 @@ end global.get $std/array/sarr i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2288 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12215,20 +12215,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2320 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 i32.const 1 call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2360 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12242,10 +12242,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2384 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12258,20 +12258,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2416 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -7 i32.const 1 call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2456 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12285,10 +12285,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2480 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12301,20 +12301,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2512 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 i32.const -1 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2552 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12328,10 +12328,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2568 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12344,20 +12344,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2608 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 1 i32.const -2 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2648 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12371,10 +12371,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2664 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12387,20 +12387,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2704 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 4 i32.const 0 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2744 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12414,10 +12414,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2760 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12430,20 +12430,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2800 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 i32.const 0 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2840 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12457,10 +12457,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2856 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12473,20 +12473,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2896 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 i32.const 5 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2936 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12500,10 +12500,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2952 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13604,10 +13604,10 @@ call $~lib/array/Array#sort global.get $std/array/f32ArrayTyped i32.const 8 - i32.const 9 i32.const 2 + i32.const 9 i32.const 3304 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/array/isArraysEqual i32.eqz if @@ -13640,10 +13640,10 @@ call $~lib/array/Array#sort global.get $std/array/f64ArrayTyped i32.const 8 - i32.const 10 i32.const 3 + i32.const 10 i32.const 3464 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/array/isArraysEqual i32.eqz if @@ -13677,10 +13677,10 @@ drop global.get $std/array/i32ArrayTyped i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 3616 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13715,10 +13715,10 @@ drop global.get $std/array/u32ArrayTyped i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 3728 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13751,10 +13751,10 @@ call $std/array/assertSortedDefault global.get $std/array/reversed1 i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 4056 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13770,10 +13770,10 @@ call $std/array/assertSortedDefault global.get $std/array/reversed2 i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 4080 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13931,10 +13931,10 @@ local.get $0 call $std/array/assertSorted<~lib/array/Array> i32.const 2 - i32.const 16 i32.const 0 + i32.const 16 i32.const 4552 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#join_bool i32.const 4576 call $~lib/string/String.__eq @@ -13948,10 +13948,10 @@ unreachable end i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 5120 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 4200 call $~lib/array/Array#join i32.const 5152 @@ -13966,10 +13966,10 @@ unreachable end i32.const 3 - i32.const 8 i32.const 2 + i32.const 8 i32.const 5240 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 5216 call $~lib/array/Array#join i32.const 5152 @@ -13984,10 +13984,10 @@ unreachable end i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 5320 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 5296 call $~lib/array/Array#join i32.const 5344 @@ -14002,10 +14002,10 @@ unreachable end i32.const 6 - i32.const 10 i32.const 3 + i32.const 10 i32.const 6672 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#join_flt i32.const 6736 call $~lib/string/String.__eq @@ -14019,10 +14019,10 @@ unreachable end i32.const 3 - i32.const 15 i32.const 2 + i32.const 15 i32.const 6888 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 4200 call $~lib/array/Array<~lib/string/String>#join i32.const 6832 @@ -14037,10 +14037,10 @@ unreachable end i32.const 3 - i32.const 20 i32.const 2 + i32.const 20 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $1 i32.load offset=4 local.tee $0 @@ -14120,10 +14120,10 @@ unreachable end i32.const 3 - i32.const 21 i32.const 0 + i32.const 21 i32.const 7128 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#join_int i32.const 7152 call $~lib/string/String.__eq @@ -14137,10 +14137,10 @@ unreachable end i32.const 3 - i32.const 22 i32.const 1 + i32.const 22 i32.const 7208 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#join_int i32.const 7232 call $~lib/string/String.__eq @@ -14154,10 +14154,10 @@ unreachable end i32.const 3 - i32.const 17 i32.const 3 + i32.const 17 i32.const 7312 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#join_int i32.const 7352 call $~lib/string/String.__eq @@ -14171,10 +14171,10 @@ unreachable end i32.const 4 - i32.const 23 i32.const 3 + i32.const 23 i32.const 7464 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#join_int i32.const 7512 call $~lib/string/String.__eq @@ -14201,10 +14201,10 @@ unreachable end i32.const 4 - i32.const 15 i32.const 2 + i32.const 15 i32.const 7744 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array<~lib/string/String | null>#toString i32.const 7776 call $~lib/string/String.__eq @@ -14218,25 +14218,25 @@ unreachable end i32.const 2 - i32.const 11 i32.const 2 + i32.const 11 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 local.tee $1 i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 7832 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.store local.get $1 i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 7856 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.store offset=4 local.get $0 global.set $std/array/subarr32 @@ -14254,25 +14254,25 @@ unreachable end i32.const 2 - i32.const 24 i32.const 2 + i32.const 24 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 local.tee $1 i32.const 2 - i32.const 7 i32.const 0 + i32.const 7 i32.const 7936 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.store local.get $1 i32.const 2 - i32.const 7 i32.const 0 + i32.const 7 i32.const 7960 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.store offset=4 local.get $0 global.set $std/array/subarr8 @@ -14290,25 +14290,25 @@ unreachable end i32.const 1 - i32.const 26 i32.const 2 + i32.const 26 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 local.set $1 i32.const 1 - i32.const 25 i32.const 2 + i32.const 25 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $2 i32.load offset=4 i32.const 1 - i32.const 8 i32.const 2 + i32.const 8 i32.const 8056 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.store local.get $1 local.get $2 diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 06e87096..c975237c 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -297,7 +297,7 @@ (export "table" (table $0)) (export "main" (func $std/array/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -396,7 +396,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -684,7 +684,7 @@ if i32.const 0 i32.const 80 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -701,7 +701,7 @@ if i32.const 0 i32.const 80 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2437,7 +2437,7 @@ end end ) - (func $~lib/runtime/runtime.makeArray (; 25 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 25 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -2446,16 +2446,14 @@ (local $9 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 + local.get $2 call $~lib/runtime/runtime.register local.set $4 local.get $0 - local.get $2 + local.get $1 i32.shl local.set $5 - local.get $0 - local.get $2 - i32.shl + local.get $5 call $~lib/runtime/runtime.allocate i32.const 2 call $~lib/runtime/runtime.register @@ -2806,10 +2804,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust local.set $4 local.get $3 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -2859,7 +2857,7 @@ if i32.const 0 i32.const 80 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -3074,10 +3072,10 @@ local.get $2 local.get $3 i32.add - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $4 local.get $4 i32.load offset=4 @@ -3620,10 +3618,10 @@ select local.set $2 local.get $2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $6 local.get $6 i32.load offset=4 @@ -4200,10 +4198,10 @@ i32.load offset=12 local.set $2 local.get $2 - i32.const 9 i32.const 2 + i32.const 9 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $3 local.get $3 i32.load offset=4 @@ -4315,10 +4313,10 @@ i32.load offset=12 local.set $2 local.get $2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $3 local.get $3 i32.load offset=4 @@ -4405,10 +4403,10 @@ (local $5 i32) (local $6 i32) i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $2 block $break|0 block @@ -7195,10 +7193,10 @@ unreachable end local.get $0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $1 local.get $1 i32.load offset=4 @@ -7449,10 +7447,10 @@ unreachable end local.get $0 - i32.const 11 i32.const 2 + i32.const 11 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $1 local.get $1 i32.load offset=4 @@ -7882,10 +7880,10 @@ unreachable end local.get $0 - i32.const 12 i32.const 2 + i32.const 12 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $1 local.get $1 i32.load offset=4 @@ -8846,10 +8844,10 @@ unreachable end local.get $0 - i32.const 15 i32.const 2 + i32.const 15 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $1 local.get $1 i32.load offset=4 @@ -9604,7 +9602,7 @@ if i32.const 0 i32.const 80 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -9621,7 +9619,7 @@ if i32.const 0 i32.const 80 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable @@ -14674,10 +14672,10 @@ drop global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 248 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14697,10 +14695,10 @@ drop global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 320 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14720,10 +14718,10 @@ drop global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 344 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14743,10 +14741,10 @@ drop global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 368 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14766,10 +14764,10 @@ drop global.get $std/array/arr8 i32.const 5 - i32.const 7 i32.const 0 + i32.const 7 i32.const 392 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14789,10 +14787,10 @@ drop global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 488 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14812,10 +14810,10 @@ drop global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 528 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14835,10 +14833,10 @@ drop global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 568 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14858,10 +14856,10 @@ drop global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 608 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14881,10 +14879,10 @@ drop global.get $std/array/arr32 i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 648 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15230,10 +15228,10 @@ end global.get $std/array/out i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 688 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#concat drop global.get $std/array/arr @@ -15503,10 +15501,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 752 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -15514,10 +15512,10 @@ global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 792 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15530,10 +15528,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 832 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -15541,10 +15539,10 @@ global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 872 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15557,10 +15555,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 912 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -15568,10 +15566,10 @@ global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 952 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15584,10 +15582,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 992 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 2 @@ -15595,10 +15593,10 @@ global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1032 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15611,10 +15609,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1072 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -15622,10 +15620,10 @@ i32.const 4 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1112 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15638,10 +15636,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1152 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -15649,10 +15647,10 @@ i32.const 4 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1192 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15665,10 +15663,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1232 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -15676,10 +15674,10 @@ i32.const 4 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1272 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15692,10 +15690,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1312 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -15703,10 +15701,10 @@ global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1352 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15719,10 +15717,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1392 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -15730,10 +15728,10 @@ i32.const -1 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1432 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15746,10 +15744,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1472 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -15757,10 +15755,10 @@ i32.const -2 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1512 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15773,10 +15771,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1552 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -15784,10 +15782,10 @@ i32.const -1 call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1592 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15800,10 +15798,10 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1632 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -15811,10 +15809,10 @@ global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#copyWithin i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1672 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16675,10 +16673,10 @@ global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#splice i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1784 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16692,10 +16690,10 @@ end global.get $std/array/sarr i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1824 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16708,20 +16706,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1840 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#splice i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1880 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16735,10 +16733,10 @@ end global.get $std/array/sarr i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1912 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16751,20 +16749,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1936 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 i32.const 2 call $~lib/array/Array#splice i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 1976 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16778,10 +16776,10 @@ end global.get $std/array/sarr i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2000 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16794,20 +16792,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2032 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 0 i32.const 1 call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2072 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16821,10 +16819,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2096 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16837,20 +16835,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2128 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -1 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2168 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16864,10 +16862,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2192 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16880,20 +16878,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2224 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 global.get $~lib/builtins/i32.MAX_VALUE call $~lib/array/Array#splice i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2264 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16907,10 +16905,10 @@ end global.get $std/array/sarr i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2288 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16923,20 +16921,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2320 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 i32.const 1 call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2360 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16950,10 +16948,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2384 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16966,20 +16964,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2416 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -7 i32.const 1 call $~lib/array/Array#splice i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2456 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16993,10 +16991,10 @@ end global.get $std/array/sarr i32.const 4 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2480 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17009,20 +17007,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2512 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 i32.const -1 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2552 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17036,10 +17034,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2568 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17052,20 +17050,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2608 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 1 i32.const -2 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2648 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17079,10 +17077,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2664 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17095,20 +17093,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2704 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 4 i32.const 0 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2744 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17122,10 +17120,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2760 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17138,20 +17136,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2800 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 i32.const 0 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2840 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17165,10 +17163,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2856 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17181,20 +17179,20 @@ unreachable end i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2896 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 i32.const 5 call $~lib/array/Array#splice i32.const 0 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2936 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17208,10 +17206,10 @@ end global.get $std/array/sarr i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 2952 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18410,10 +18408,10 @@ drop global.get $std/array/f32ArrayTyped i32.const 8 - i32.const 9 i32.const 2 + i32.const 9 i32.const 3304 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18435,10 +18433,10 @@ drop global.get $std/array/f64ArrayTyped i32.const 8 - i32.const 10 i32.const 3 + i32.const 10 i32.const 3464 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18460,10 +18458,10 @@ drop global.get $std/array/i32ArrayTyped i32.const 5 - i32.const 4 i32.const 2 + i32.const 4 i32.const 3616 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18485,10 +18483,10 @@ drop global.get $std/array/u32ArrayTyped i32.const 5 - i32.const 8 i32.const 2 + i32.const 8 i32.const 3728 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18521,10 +18519,10 @@ call $std/array/assertSortedDefault global.get $std/array/reversed1 i32.const 1 - i32.const 4 i32.const 2 + i32.const 4 i32.const 4056 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18540,10 +18538,10 @@ call $std/array/assertSortedDefault global.get $std/array/reversed2 i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 4080 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18693,10 +18691,10 @@ call $std/array/assertSorted<~lib/string/String>|trampoline end i32.const 2 - i32.const 16 i32.const 0 + i32.const 16 i32.const 4552 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 4528 call $~lib/array/Array#join i32.const 4576 @@ -18711,10 +18709,10 @@ unreachable end i32.const 3 - i32.const 4 i32.const 2 + i32.const 4 i32.const 5120 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 4200 call $~lib/array/Array#join i32.const 5152 @@ -18729,10 +18727,10 @@ unreachable end i32.const 3 - i32.const 8 i32.const 2 + i32.const 8 i32.const 5240 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 5216 call $~lib/array/Array#join i32.const 5152 @@ -18747,10 +18745,10 @@ unreachable end i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 5320 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 5296 call $~lib/array/Array#join i32.const 5344 @@ -18765,10 +18763,10 @@ unreachable end i32.const 6 - i32.const 10 i32.const 3 + i32.const 10 i32.const 6672 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 5472 call $~lib/array/Array#join i32.const 6736 @@ -18783,10 +18781,10 @@ unreachable end i32.const 3 - i32.const 15 i32.const 2 + i32.const 15 i32.const 6888 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray i32.const 4200 call $~lib/array/Array<~lib/string/String>#join i32.const 6832 @@ -18802,10 +18800,10 @@ end block (result i32) i32.const 3 - i32.const 20 i32.const 2 + i32.const 20 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $0 local.get $0 i32.load offset=4 @@ -18921,10 +18919,10 @@ unreachable end i32.const 3 - i32.const 21 i32.const 0 + i32.const 21 i32.const 7128 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#toString i32.const 7152 call $~lib/string/String.__eq @@ -18938,10 +18936,10 @@ unreachable end i32.const 3 - i32.const 22 i32.const 1 + i32.const 22 i32.const 7208 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#toString i32.const 7232 call $~lib/string/String.__eq @@ -18955,10 +18953,10 @@ unreachable end i32.const 3 - i32.const 17 i32.const 3 + i32.const 17 i32.const 7312 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#toString i32.const 7352 call $~lib/string/String.__eq @@ -18972,10 +18970,10 @@ unreachable end i32.const 4 - i32.const 23 i32.const 3 + i32.const 23 i32.const 7464 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array#toString i32.const 7512 call $~lib/string/String.__eq @@ -19002,10 +19000,10 @@ unreachable end i32.const 4 - i32.const 15 i32.const 2 + i32.const 15 i32.const 7744 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/array/Array<~lib/string/String>#toString i32.const 7776 call $~lib/string/String.__eq @@ -19020,10 +19018,10 @@ end block (result i32) i32.const 2 - i32.const 11 i32.const 2 + i32.const 11 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $1 local.get $1 i32.load offset=4 @@ -19031,10 +19029,10 @@ local.get $0 block (result i32) i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 7832 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $2 local.get $2 local.get $1 @@ -19045,10 +19043,10 @@ local.get $0 block (result i32) i32.const 2 - i32.const 4 i32.const 2 + i32.const 4 i32.const 7856 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $2 local.get $2 local.get $1 @@ -19074,10 +19072,10 @@ end block (result i32) i32.const 2 - i32.const 24 i32.const 2 + i32.const 24 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $0 local.get $0 i32.load offset=4 @@ -19085,10 +19083,10 @@ local.get $1 block (result i32) i32.const 2 - i32.const 7 i32.const 0 + i32.const 7 i32.const 7936 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $2 local.get $2 local.get $0 @@ -19099,10 +19097,10 @@ local.get $1 block (result i32) i32.const 2 - i32.const 7 i32.const 0 + i32.const 7 i32.const 7960 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $2 local.get $2 local.get $0 @@ -19128,10 +19126,10 @@ end block (result i32) i32.const 1 - i32.const 26 i32.const 2 + i32.const 26 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $0 local.get $0 i32.load offset=4 @@ -19140,10 +19138,10 @@ block (result i32) block (result i32) i32.const 1 - i32.const 25 i32.const 2 + i32.const 25 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $2 local.get $2 i32.load offset=4 @@ -19151,10 +19149,10 @@ local.get $3 block (result i32) i32.const 1 - i32.const 8 i32.const 2 + i32.const 8 i32.const 8056 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $4 local.get $4 local.get $2 diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 003898b7..bf53788a 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -327,7 +327,7 @@ if i32.const 0 i32.const 64 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -342,7 +342,7 @@ if i32.const 0 i32.const 64 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -1535,7 +1535,7 @@ i32.store offset=8 local.get $0 ) - (func $~lib/runtime/runtime.makeArray (; 10 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.newArray (; 10 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) i32.const 16 @@ -1830,7 +1830,7 @@ i32.const 0 call $~lib/arraybuffer/ArrayBufferView#constructor global.set $std/arraybuffer/arr8 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray drop global.get $std/arraybuffer/arr8 if (result i32) diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 263760de..fbb25abc 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -29,7 +29,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -128,7 +128,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -407,7 +407,7 @@ if i32.const 0 i32.const 64 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -424,7 +424,7 @@ if i32.const 0 i32.const 64 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2618,22 +2618,20 @@ local.set $0 local.get $0 ) - (func $~lib/runtime/runtime.makeArray (; 19 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 19 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 + local.get $2 call $~lib/runtime/runtime.register local.set $4 local.get $0 - local.get $2 + local.get $1 i32.shl local.set $5 - local.get $0 - local.get $2 - i32.shl + local.get $5 call $~lib/runtime/runtime.allocate i32.const 2 call $~lib/runtime/runtime.register @@ -3020,10 +3018,10 @@ call $~lib/typedarray/Uint8Array#constructor global.set $std/arraybuffer/arr8 i32.const 2 - i32.const 5 i32.const 2 + i32.const 5 i32.const 152 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> i32.eqz i32.eqz diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 25724f18..c3794503 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -165,7 +165,7 @@ if i32.const 0 i32.const 64 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -180,7 +180,7 @@ if i32.const 0 i32.const 64 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index cd1db6b2..7b254100 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -35,7 +35,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -134,7 +134,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -413,7 +413,7 @@ if i32.const 0 i32.const 64 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -430,7 +430,7 @@ if i32.const 0 i32.const 64 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 116af7fe..ada313ec 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -89,7 +89,7 @@ if i32.const 0 i32.const 48 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -104,7 +104,7 @@ if i32.const 0 i32.const 48 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 44257c38..b304c8c1 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -27,7 +27,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/runtime.adjust (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -126,7 +126,7 @@ (func $~lib/runtime/runtime.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -148,7 +148,7 @@ if i32.const 0 i32.const 48 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -165,7 +165,7 @@ if i32.const 0 i32.const 48 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 40217a4d..311e4697 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -135,7 +135,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -150,7 +150,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index b103b77c..fe4484c0 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -36,7 +36,7 @@ (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -135,7 +135,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -166,7 +166,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -183,7 +183,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/new.optimized.wat b/tests/compiler/std/new.optimized.wat index 9d1e7808..2ca7f049 100644 --- a/tests/compiler/std/new.optimized.wat +++ b/tests/compiler/std/new.optimized.wat @@ -84,7 +84,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -99,7 +99,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 37689c95..93369e9d 100644 --- a/tests/compiler/std/new.untouched.wat +++ b/tests/compiler/std/new.untouched.wat @@ -20,7 +20,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -119,7 +119,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -141,7 +141,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -158,7 +158,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/object-literal.optimized.wat b/tests/compiler/std/object-literal.optimized.wat index bdb62aad..8632d9c5 100644 --- a/tests/compiler/std/object-literal.optimized.wat +++ b/tests/compiler/std/object-literal.optimized.wat @@ -118,7 +118,7 @@ if i32.const 0 i32.const 64 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -133,7 +133,7 @@ if i32.const 0 i32.const 64 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/object-literal.untouched.wat b/tests/compiler/std/object-literal.untouched.wat index 11eb9ba4..903da28a 100644 --- a/tests/compiler/std/object-literal.untouched.wat +++ b/tests/compiler/std/object-literal.untouched.wat @@ -23,7 +23,7 @@ (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -122,7 +122,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -153,7 +153,7 @@ if i32.const 0 i32.const 64 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -170,7 +170,7 @@ if i32.const 0 i32.const 64 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 06e9f5d7..d4a70cfc 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -167,7 +167,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -182,7 +182,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 287acddd..39f3e963 100644 --- a/tests/compiler/std/operator-overloading.untouched.wat +++ b/tests/compiler/std/operator-overloading.untouched.wat @@ -88,7 +88,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -187,7 +187,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -209,7 +209,7 @@ if i32.const 0 i32.const 16 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -226,7 +226,7 @@ if i32.const 0 i32.const 16 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/runtime.optimized.wat b/tests/compiler/std/runtime.optimized.wat index 29b95e4e..cc017260 100644 --- a/tests/compiler/std/runtime.optimized.wat +++ b/tests/compiler/std/runtime.optimized.wat @@ -2560,7 +2560,7 @@ if i32.const 0 i32.const 232 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -2597,7 +2597,7 @@ if i32.const 0 i32.const 232 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -2612,7 +2612,7 @@ if i32.const 0 i32.const 232 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable @@ -2628,7 +2628,7 @@ if i32.const 0 i32.const 232 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -2643,7 +2643,7 @@ if i32.const 0 i32.const 232 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2694,7 +2694,7 @@ else i32.const 0 i32.const 24 - i32.const 41 + i32.const 40 i32.const 2 call $~lib/env/abort unreachable @@ -2805,7 +2805,7 @@ if i32.const 0 i32.const 24 - i32.const 56 + i32.const 55 i32.const 0 call $~lib/env/abort unreachable @@ -2817,7 +2817,7 @@ if i32.const 0 i32.const 24 - i32.const 57 + i32.const 56 i32.const 0 call $~lib/env/abort unreachable @@ -2831,7 +2831,7 @@ if i32.const 0 i32.const 24 - i32.const 58 + i32.const 57 i32.const 0 call $~lib/env/abort unreachable @@ -2843,7 +2843,7 @@ if i32.const 0 i32.const 24 - i32.const 59 + i32.const 58 i32.const 0 call $~lib/env/abort unreachable @@ -2858,7 +2858,7 @@ if i32.const 0 i32.const 24 - i32.const 61 + i32.const 60 i32.const 0 call $~lib/env/abort unreachable @@ -2874,7 +2874,7 @@ if i32.const 0 i32.const 24 - i32.const 63 + i32.const 62 i32.const 0 call $~lib/env/abort unreachable @@ -2890,7 +2890,7 @@ if i32.const 0 i32.const 24 - i32.const 66 + i32.const 65 i32.const 0 call $~lib/env/abort unreachable @@ -2906,7 +2906,7 @@ if i32.const 0 i32.const 24 - i32.const 70 + i32.const 69 i32.const 0 call $~lib/env/abort unreachable @@ -2922,7 +2922,7 @@ if i32.const 0 i32.const 24 - i32.const 72 + i32.const 71 i32.const 0 call $~lib/env/abort unreachable @@ -2934,7 +2934,7 @@ if i32.const 0 i32.const 24 - i32.const 73 + i32.const 72 i32.const 0 call $~lib/env/abort unreachable @@ -2951,7 +2951,7 @@ if i32.const 0 i32.const 24 - i32.const 76 + i32.const 75 i32.const 0 call $~lib/env/abort unreachable @@ -2967,7 +2967,7 @@ if i32.const 0 i32.const 24 - i32.const 77 + i32.const 76 i32.const 0 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/runtime.ts b/tests/compiler/std/runtime.ts index 5db24ad3..596da401 100644 --- a/tests/compiler/std/runtime.ts +++ b/tests/compiler/std/runtime.ts @@ -1,6 +1,5 @@ import "allocator/tlsf"; -// import { classId, ADJUSTOBLOCK, ALLOCATE, REALLOCATE, REGISTER, DISCARD, HEADER, HEADER_SIZE, HEADER_MAGIC } from "runtime"; -import { HEADER, HEADER_SIZE, HEADER_MAGIC } from "util/runtime"; +import { HEADER, HEADER_SIZE, HEADER_MAGIC, adjust } from "util/runtime"; import { runtime, __runtime_id } from "runtime"; @start export function main(): void {} @@ -36,16 +35,16 @@ function isPowerOf2(x: i32): bool { return x != 0 && (x & (x - 1)) == 0; } -assert(runtime.adjust(0) > 0); +assert(adjust(0) > 0); for (let i = 0; i < 9000; ++i) { - assert(isPowerOf2(runtime.adjust(i))); + assert(isPowerOf2(adjust(i))); } -var barrier1 = runtime.adjust(0); +var barrier1 = adjust(0); var barrier2 = barrier1 + 1; -while (runtime.adjust(barrier2 + 1) == runtime.adjust(barrier2)) ++barrier2; +while (adjust(barrier2 + 1) == adjust(barrier2)) ++barrier2; var barrier3 = barrier2 + 1; -while (runtime.adjust(barrier3 + 1) == runtime.adjust(barrier3)) ++barrier3; +while (adjust(barrier3 + 1) == adjust(barrier3)) ++barrier3; trace("barrier1", 1, barrier1); trace("barrier2", 1, barrier2); diff --git a/tests/compiler/std/runtime.untouched.wat b/tests/compiler/std/runtime.untouched.wat index 15a904e7..9f8966c4 100644 --- a/tests/compiler/std/runtime.untouched.wat +++ b/tests/compiler/std/runtime.untouched.wat @@ -60,7 +60,7 @@ (export "table" (table $0)) (export "main" (func $std/runtime/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -1458,7 +1458,7 @@ (func $~lib/runtime/runtime.allocate (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -3235,10 +3235,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust local.set $4 local.get $3 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -3288,7 +3288,7 @@ if i32.const 0 i32.const 232 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -3330,7 +3330,7 @@ if i32.const 0 i32.const 232 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -3347,7 +3347,7 @@ if i32.const 0 i32.const 232 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable @@ -3364,7 +3364,7 @@ if i32.const 0 i32.const 232 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -3381,7 +3381,7 @@ if i32.const 0 i32.const 232 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -3416,20 +3416,20 @@ if i32.const 0 i32.const 24 - i32.const 33 + i32.const 32 i32.const 0 call $~lib/env/abort unreachable end i32.const 0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.const 0 i32.gt_u i32.eqz if i32.const 0 i32.const 24 - i32.const 39 + i32.const 38 i32.const 0 call $~lib/env/abort unreachable @@ -3444,13 +3444,13 @@ i32.eqz br_if $break|0 local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $std/runtime/isPowerOf2 i32.eqz if i32.const 0 i32.const 24 - i32.const 41 + i32.const 40 i32.const 2 call $~lib/env/abort unreachable @@ -3465,7 +3465,7 @@ unreachable end i32.const 0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust global.set $std/runtime/barrier1 global.get $std/runtime/barrier1 i32.const 1 @@ -3476,9 +3476,9 @@ global.get $std/runtime/barrier2 i32.const 1 i32.add - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust global.get $std/runtime/barrier2 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.eq if global.get $std/runtime/barrier2 @@ -3498,9 +3498,9 @@ global.get $std/runtime/barrier3 i32.const 1 i32.add - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust global.get $std/runtime/barrier3 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.eq if global.get $std/runtime/barrier3 @@ -3553,7 +3553,7 @@ if i32.const 0 i32.const 24 - i32.const 56 + i32.const 55 i32.const 0 call $~lib/env/abort unreachable @@ -3566,7 +3566,7 @@ if i32.const 0 i32.const 24 - i32.const 57 + i32.const 56 i32.const 0 call $~lib/env/abort unreachable @@ -3580,7 +3580,7 @@ if i32.const 0 i32.const 24 - i32.const 58 + i32.const 57 i32.const 0 call $~lib/env/abort unreachable @@ -3593,7 +3593,7 @@ if i32.const 0 i32.const 24 - i32.const 59 + i32.const 58 i32.const 0 call $~lib/env/abort unreachable @@ -3609,7 +3609,7 @@ if i32.const 0 i32.const 24 - i32.const 61 + i32.const 60 i32.const 0 call $~lib/env/abort unreachable @@ -3626,7 +3626,7 @@ if i32.const 0 i32.const 24 - i32.const 63 + i32.const 62 i32.const 0 call $~lib/env/abort unreachable @@ -3643,7 +3643,7 @@ if i32.const 0 i32.const 24 - i32.const 66 + i32.const 65 i32.const 0 call $~lib/env/abort unreachable @@ -3662,7 +3662,7 @@ if i32.const 0 i32.const 24 - i32.const 70 + i32.const 69 i32.const 0 call $~lib/env/abort unreachable @@ -3679,7 +3679,7 @@ if i32.const 0 i32.const 24 - i32.const 72 + i32.const 71 i32.const 0 call $~lib/env/abort unreachable @@ -3692,7 +3692,7 @@ if i32.const 0 i32.const 24 - i32.const 73 + i32.const 72 i32.const 0 call $~lib/env/abort unreachable @@ -3708,7 +3708,7 @@ if i32.const 0 i32.const 24 - i32.const 76 + i32.const 75 i32.const 0 call $~lib/env/abort unreachable @@ -3721,7 +3721,7 @@ if i32.const 0 i32.const 24 - i32.const 77 + i32.const 76 i32.const 0 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 1e8d43f0..8360089e 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -131,7 +131,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -146,7 +146,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index ac8c6708..08ad6ba6 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -36,7 +36,7 @@ (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -135,7 +135,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -166,7 +166,7 @@ if i32.const 0 i32.const 24 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -183,7 +183,7 @@ if i32.const 0 i32.const 24 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 37b088cc..1beb7f4e 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -1437,7 +1437,7 @@ if i32.const 0 i32.const 280 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index c57c7254..9b09b240 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -71,7 +71,7 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $~lib/runtime/runtime.adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -1881,10 +1881,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust local.set $4 local.get $3 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -1928,7 +1928,7 @@ if i32.const 0 i32.const 280 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index f1dd5e16..5fc94736 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -1464,7 +1464,7 @@ if i32.const 0 i32.const 136 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -1479,7 +1479,7 @@ if i32.const 0 i32.const 136 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string-utf8.untouched.wat b/tests/compiler/std/string-utf8.untouched.wat index a9fca170..6c138802 100644 --- a/tests/compiler/std/string-utf8.untouched.wat +++ b/tests/compiler/std/string-utf8.untouched.wat @@ -453,7 +453,7 @@ i32.store8 local.get $1 ) - (func $~lib/runtime/runtime.adjust (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -468,7 +468,7 @@ (func $~lib/runtime/runtime.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -1929,7 +1929,7 @@ if i32.const 0 i32.const 136 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -1946,7 +1946,7 @@ if i32.const 0 i32.const 136 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 350e4bce..2895b8fc 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -444,7 +444,7 @@ if i32.const 0 i32.const 184 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -459,7 +459,7 @@ if i32.const 0 i32.const 184 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2912,7 +2912,7 @@ i32.const 1 call $~lib/runtime/runtime.register ) - (func $~lib/runtime/runtime.makeArray (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3235,7 +3235,7 @@ if i32.const 0 i32.const 184 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -3363,7 +3363,7 @@ if i32.const 0 i32.const 2 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray return end local.get $1 @@ -3371,7 +3371,7 @@ if i32.const 1 i32.const 2 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $1 i32.load offset=4 local.get $0 @@ -3406,7 +3406,7 @@ if i32.const 1 i32.const 2 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $0 i32.load offset=4 i32.const 120 @@ -3420,7 +3420,7 @@ if i32.const 0 i32.const 1 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray return end local.get $3 @@ -3431,7 +3431,7 @@ select local.tee $4 i32.const 2 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $3 i32.load offset=4 local.set $5 @@ -3475,7 +3475,7 @@ end i32.const 0 i32.const 2 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $2 loop $continue|1 local.get $1 @@ -3543,7 +3543,7 @@ if i32.const 1 i32.const 2 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.tee $1 i32.load offset=4 local.tee $2 @@ -5177,7 +5177,7 @@ if i32.const 0 i32.const 184 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -5191,7 +5191,7 @@ if i32.const 0 i32.const 184 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index e9c94dc2..db326424 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -249,7 +249,7 @@ i32.eqz end ) - (func $~lib/runtime/runtime.adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -348,7 +348,7 @@ (func $~lib/runtime/runtime.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -379,7 +379,7 @@ if i32.const 0 i32.const 184 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -396,7 +396,7 @@ if i32.const 0 i32.const 184 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -3451,7 +3451,7 @@ (func $~lib/collector/dummy/__ref_unlink (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/runtime.makeArray (; 37 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 37 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3460,16 +3460,14 @@ (local $9 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 + local.get $2 call $~lib/runtime/runtime.register local.set $4 local.get $0 - local.get $2 + local.get $1 i32.shl local.set $5 - local.get $0 - local.get $2 - i32.shl + local.get $5 call $~lib/runtime/runtime.allocate i32.const 3 call $~lib/runtime/runtime.register @@ -3797,10 +3795,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust local.set $4 local.get $3 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -3850,7 +3848,7 @@ if i32.const 0 i32.const 184 - i32.const 85 + i32.const 77 i32.const 10 call $~lib/env/abort unreachable @@ -4071,7 +4069,7 @@ i32.const 2 i32.const 2 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray return end local.get $1 @@ -4083,7 +4081,7 @@ i32.const 2 i32.const 2 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $3 local.get $3 i32.load offset=4 @@ -4122,10 +4120,10 @@ i32.eqz if i32.const 0 - i32.const 1 i32.const 2 + i32.const 1 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray return end local.get $6 @@ -4141,7 +4139,7 @@ i32.const 2 i32.const 2 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $4 local.get $4 i32.load offset=4 @@ -4201,7 +4199,7 @@ i32.const 2 i32.const 2 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $3 local.get $3 i32.load offset=4 @@ -4215,7 +4213,7 @@ i32.const 2 i32.const 2 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $9 i32.const 0 local.set $10 @@ -4301,7 +4299,7 @@ i32.const 2 i32.const 2 i32.const 0 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray local.set $3 local.get $3 i32.const 0 @@ -6549,7 +6547,7 @@ if i32.const 0 i32.const 184 - i32.const 110 + i32.const 103 i32.const 6 call $~lib/env/abort unreachable @@ -6566,7 +6564,7 @@ if i32.const 0 i32.const 184 - i32.const 112 + i32.const 105 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 0b2c17e8..056e44ad 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -144,7 +144,7 @@ if i32.const 0 i32.const 72 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -159,7 +159,7 @@ if i32.const 0 i32.const 72 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index a00be986..4111d4bc 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -79,7 +79,7 @@ end local.get $2 ) - (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -178,7 +178,7 @@ (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -200,7 +200,7 @@ if i32.const 0 i32.const 72 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -217,7 +217,7 @@ if i32.const 0 i32.const 72 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 0991f7ee..3c9c57bc 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -439,7 +439,7 @@ if i32.const 0 i32.const 136 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -454,7 +454,7 @@ if i32.const 0 i32.const 136 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -2984,46 +2984,46 @@ end end ) - (func $~lib/runtime/runtime.makeArray (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 35 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 - call $~lib/runtime/runtime.register - local.set $1 - local.get $0 local.get $2 + call $~lib/runtime/runtime.register + local.set $2 + local.get $0 + local.get $1 i32.shl local.tee $4 call $~lib/runtime/runtime.allocate i32.const 2 call $~lib/runtime/runtime.register - local.tee $2 + local.tee $1 local.set $5 - local.get $1 + local.get $2 i32.load drop - local.get $1 + local.get $2 local.get $5 i32.store - local.get $1 local.get $2 - i32.store offset=4 local.get $1 + i32.store offset=4 + local.get $2 local.get $4 i32.store offset=8 - local.get $1 + local.get $2 local.get $0 i32.store offset=12 local.get $3 if - local.get $2 + local.get $1 local.get $3 local.get $4 call $~lib/memory/memory.copy end - local.get $1 + local.get $2 ) (func $~lib/typedarray/Int8Array#__get (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 @@ -12929,10 +12929,10 @@ call $~lib/typedarray/Int8Array#fill global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 240 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -12950,10 +12950,10 @@ call $~lib/typedarray/Int8Array#fill global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 312 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -12971,10 +12971,10 @@ call $~lib/typedarray/Int8Array#fill global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 336 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -12992,10 +12992,10 @@ call $~lib/typedarray/Int8Array#fill global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 360 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13013,10 +13013,10 @@ call $~lib/typedarray/Int8Array#fill global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 384 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13079,10 +13079,10 @@ end global.get $std/typedarray/sub8 i32.const 3 - i32.const 15 i32.const 0 + i32.const 15 i32.const 408 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13095,10 +13095,10 @@ end global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 432 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13139,10 +13139,10 @@ call $~lib/typedarray/Int32Array#fill global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 456 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13160,10 +13160,10 @@ call $~lib/typedarray/Int32Array#fill global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 496 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13181,10 +13181,10 @@ call $~lib/typedarray/Int32Array#fill global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 536 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13202,10 +13202,10 @@ call $~lib/typedarray/Int32Array#fill global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 576 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13223,10 +13223,10 @@ call $~lib/typedarray/Int32Array#fill global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 616 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13291,10 +13291,10 @@ end global.get $std/typedarray/sub32 i32.const 3 - i32.const 16 i32.const 2 + i32.const 16 i32.const 656 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13307,10 +13307,10 @@ end global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 688 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 31eca951..8007f40d 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -110,7 +110,7 @@ (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/runtime/adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -209,7 +209,7 @@ (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/runtime.adjust + call $~lib/util/runtime/adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -497,7 +497,7 @@ if i32.const 0 i32.const 136 - i32.const 123 + i32.const 117 i32.const 6 call $~lib/env/abort unreachable @@ -514,7 +514,7 @@ if i32.const 0 i32.const 136 - i32.const 125 + i32.const 119 i32.const 6 call $~lib/env/abort unreachable @@ -3869,7 +3869,7 @@ end end ) - (func $~lib/runtime/runtime.makeArray (; 56 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.newArray (; 56 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3878,16 +3878,14 @@ (local $9 i32) i32.const 16 call $~lib/runtime/runtime.allocate - local.get $1 + local.get $2 call $~lib/runtime/runtime.register local.set $4 local.get $0 - local.get $2 + local.get $1 i32.shl local.set $5 - local.get $0 - local.get $2 - i32.shl + local.get $5 call $~lib/runtime/runtime.allocate i32.const 2 call $~lib/runtime/runtime.register @@ -18752,10 +18750,10 @@ drop global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 240 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18774,10 +18772,10 @@ drop global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 312 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18796,10 +18794,10 @@ drop global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 336 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18818,10 +18816,10 @@ drop global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 360 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18840,10 +18838,10 @@ drop global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 384 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18906,10 +18904,10 @@ end global.get $std/typedarray/sub8 i32.const 3 - i32.const 15 i32.const 0 + i32.const 15 i32.const 408 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18922,10 +18920,10 @@ end global.get $std/typedarray/arr8 i32.const 5 - i32.const 15 i32.const 0 + i32.const 15 i32.const 432 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18968,10 +18966,10 @@ drop global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 456 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -18990,10 +18988,10 @@ drop global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 496 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19012,10 +19010,10 @@ drop global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 536 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19034,10 +19032,10 @@ drop global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 576 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19056,10 +19054,10 @@ drop global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 616 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19126,10 +19124,10 @@ end global.get $std/typedarray/sub32 i32.const 3 - i32.const 16 i32.const 2 + i32.const 16 i32.const 656 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19142,10 +19140,10 @@ end global.get $std/typedarray/arr32 i32.const 5 - i32.const 16 i32.const 2 + i32.const 16 i32.const 688 - call $~lib/runtime/runtime.makeArray + call $~lib/runtime/runtime.newArray call $std/typedarray/isInt32ArrayEqual i32.eqz if