From 1ada8548300de94d2b39f7486dabd77d7c198c7a Mon Sep 17 00:00:00 2001 From: dcode Date: Mon, 1 Apr 2019 22:23:11 +0200 Subject: [PATCH] some cleanup --- src/builtins.ts | 10 +- src/program.ts | 10 +- std/assembly/array.ts | 50 +- std/assembly/arraybuffer.ts | 42 +- std/assembly/dataview.ts | 4 +- std/assembly/fixedarray.ts | 8 +- std/assembly/gc.ts | 15 +- std/assembly/runtime.ts | 293 +-- std/assembly/string.ts | 97 +- std/assembly/typedarray.ts | 7 +- std/assembly/util/number.ts | 29 +- tests/compiler/call-super.optimized.wat | 52 +- tests/compiler/call-super.untouched.wat | 56 +- tests/compiler/constructor.optimized.wat | 52 +- tests/compiler/constructor.untouched.wat | 56 +- tests/compiler/exports.optimized.wat | 20 +- tests/compiler/exports.untouched.wat | 24 +- tests/compiler/gc.optimized.wat | 1344 ++++++++++++- tests/compiler/gc.ts | 2 +- tests/compiler/gc.untouched.wat | 1733 +++++++++++++++- tests/compiler/gc/global-assign.optimized.wat | 20 +- tests/compiler/gc/global-assign.untouched.wat | 20 +- tests/compiler/gc/global-init.optimized.wat | 20 +- tests/compiler/gc/global-init.untouched.wat | 20 +- tests/compiler/gc/itcm/trace.optimized.wat | 44 +- tests/compiler/gc/itcm/trace.untouched.wat | 101 +- .../gc/rc/global-assign.optimized.wat | 20 +- .../gc/rc/global-assign.untouched.wat | 20 +- .../compiler/gc/rc/global-init.optimized.wat | 16 +- .../compiler/gc/rc/global-init.untouched.wat | 20 +- tests/compiler/getter-call.optimized.wat | 12 +- tests/compiler/getter-call.untouched.wat | 20 +- tests/compiler/inlining.optimized.wat | 20 +- tests/compiler/inlining.untouched.wat | 24 +- tests/compiler/number.optimized.wat | 36 +- tests/compiler/number.untouched.wat | 113 +- .../optional-typeparameters.optimized.wat | 20 +- .../optional-typeparameters.untouched.wat | 24 +- tests/compiler/std/array-access.optimized.wat | 2 +- tests/compiler/std/array-access.untouched.wat | 2 +- .../compiler/std/array-literal.optimized.wat | 38 +- .../compiler/std/array-literal.untouched.wat | 42 +- tests/compiler/std/array.optimized.wat | 430 ++-- tests/compiler/std/array.untouched.wat | 1772 +++++++---------- tests/compiler/std/arraybuffer.optimized.wat | 64 +- tests/compiler/std/arraybuffer.untouched.wat | 117 +- tests/compiler/std/dataview.optimized.wat | 42 +- tests/compiler/std/dataview.untouched.wat | 91 +- tests/compiler/std/date.optimized.wat | 12 +- tests/compiler/std/date.untouched.wat | 20 +- tests/compiler/std/map.optimized.wat | 60 +- tests/compiler/std/map.untouched.wat | 87 +- tests/compiler/std/new.optimized.wat | 12 +- tests/compiler/std/new.untouched.wat | 20 +- .../compiler/std/object-literal.optimized.wat | 24 +- .../compiler/std/object-literal.untouched.wat | 28 +- .../std/operator-overloading.optimized.wat | 24 +- .../std/operator-overloading.untouched.wat | 28 +- tests/compiler/std/runtime.optimized.wat | 72 +- tests/compiler/std/runtime.ts | 29 +- tests/compiler/std/runtime.untouched.wat | 155 +- tests/compiler/std/set.optimized.wat | 60 +- tests/compiler/std/set.untouched.wat | 87 +- tests/compiler/std/static-array.optimized.wat | 10 +- tests/compiler/std/static-array.untouched.wat | 31 +- tests/compiler/std/string-utf8.optimized.wat | 24 +- tests/compiler/std/string-utf8.untouched.wat | 42 +- tests/compiler/std/string.optimized.wat | 541 ++--- tests/compiler/std/string.untouched.wat | 642 +++--- tests/compiler/std/symbol.optimized.wat | 32 +- tests/compiler/std/symbol.untouched.wat | 80 +- tests/compiler/std/typedarray.optimized.wat | 262 +-- tests/compiler/std/typedarray.ts | 4 +- tests/compiler/std/typedarray.untouched.wat | 521 ++--- 74 files changed, 6072 insertions(+), 3909 deletions(-) diff --git a/src/builtins.ts b/src/builtins.ts index 131adfba..3fc6030d 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -479,11 +479,11 @@ export namespace BuiltinSymbols { // std/runtime.ts export const classId = "~lib/runtime/classId"; export const iterateRoots = "~lib/runtime/iterateRoots"; - export const allocate = "~lib/runtime/allocate"; - export const reallocate = "~lib/runtime/reallocate"; - export const register = "~lib/runtime/register"; - export const discard = "~lib/runtime/discard"; - export const makeArray = "~lib/runtime/makeArray"; + export const runtime_allocate = "~lib/runtime/runtime.allocate"; + 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"; // std/typedarray.ts export const Int8Array = "~lib/typedarray/Int8Array"; diff --git a/src/program.ts b/src/program.ts index 3441e1c2..bbe534f2 100644 --- a/src/program.ts +++ b/src/program.ts @@ -820,7 +820,7 @@ export class Program extends DiagnosticEmitter { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.abortInstance = this.resolver.resolveFunction(element, null); } - if (element = this.lookupGlobal(BuiltinSymbols.allocate)) { + if (element = this.lookupGlobal(BuiltinSymbols.runtime_allocate)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.allocateInstance = this.resolver.resolveFunction(element, null); } @@ -828,19 +828,19 @@ export class Program extends DiagnosticEmitter { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.memoryAllocateInstance = this.resolver.resolveFunction(element, null); } - if (element = this.lookupGlobal(BuiltinSymbols.reallocate)) { + if (element = this.lookupGlobal(BuiltinSymbols.runtime_reallocate)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.reallocateInstance = this.resolver.resolveFunction(element, null); } - if (element = this.lookupGlobal(BuiltinSymbols.discard)) { + if (element = this.lookupGlobal(BuiltinSymbols.runtime_discard)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.discardInstance = this.resolver.resolveFunction(element, null); } - if (element = this.lookupGlobal(BuiltinSymbols.register)) { + if (element = this.lookupGlobal(BuiltinSymbols.runtime_register)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.registerInstance = this.resolver.resolveFunction(element, null); } - if (element = this.lookupGlobal(BuiltinSymbols.makeArray)) { + if (element = this.lookupGlobal(BuiltinSymbols.runtime_makeArray)) { assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); this.makeArrayInstance = this.resolver.resolveFunction(element, null); } diff --git a/std/assembly/array.ts b/std/assembly/array.ts index 7a3a26f0..a2a2c32c 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -1,7 +1,7 @@ /// -import { ALLOCATE, REALLOCATE, DISCARD, REGISTER, MAX_BYTELENGTH, MAKEARRAY, ArrayBufferView, classId } from "./runtime"; -import { ArrayBuffer } from "./arraybuffer"; +import { runtime, classId } from "./runtime"; +import { ArrayBuffer, ArrayBufferView } from "./arraybuffer"; import { COMPARATOR, SORT } from "./util/sort"; import { itoa, dtoa, itoa_stream, dtoa_stream, MAX_DOUBLE_LENGTH } from "./util/number"; import { isArray as builtin_isArray } from "./builtins"; @@ -10,10 +10,10 @@ import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_EMPTYARRAY, E_HOLEYARRAY } from " /** Ensures that the given array has _at least_ the specified capacity. */ function ensureCapacity(array: ArrayBufferView, minCapacity: i32, alignLog2: u32): void { if (minCapacity > array.dataLength >>> alignLog2) { - if (minCapacity > (MAX_BYTELENGTH >>> alignLog2)) throw new RangeError(E_INVALIDLENGTH); + if (minCapacity > (runtime.MAX_BYTELENGTH >>> alignLog2)) throw new RangeError(E_INVALIDLENGTH); let oldData = array.data; let newByteLength = minCapacity << alignLog2; - let newData = REALLOCATE(changetype(oldData), newByteLength); // registers on move + let newData = runtime.reallocate(changetype(oldData), newByteLength); // registers on move if (newData !== changetype(oldData)) { array.data = changetype(newData); // links array.dataStart = newData; @@ -40,8 +40,8 @@ export class Array extends ArrayBufferView { } static create(capacity: i32 = 0): Array { - if (capacity > MAX_BYTELENGTH >>> alignof()) throw new RangeError(E_INVALIDLENGTH); - var array = MAKEARRAY(capacity); + if (capacity > runtime.MAX_BYTELENGTH >>> alignof()) throw new RangeError(E_INVALIDLENGTH); + var array = changetype>(runtime.makeArray(capacity, classId>(), alignof())); memory.fill(array.dataStart, 0, array.dataLength); array.length_ = 0; // ! return array; @@ -231,7 +231,7 @@ export class Array extends ArrayBufferView { concat(other: Array): Array { var thisLen = this.length_; var otherLen = select(0, other.length_, other === null); - var out = MAKEARRAY(thisLen + otherLen); + var out = changetype>(runtime.makeArray(thisLen + otherLen, classId>(), alignof())); var outStart = out.dataStart; var thisSize = thisLen << alignof(); if (isManaged()) { @@ -319,7 +319,7 @@ export class Array extends ArrayBufferView { map(callbackfn: (value: T, index: i32, array: Array) => U): Array { var length = this.length_; - var out = MAKEARRAY(length); + var out = changetype>(runtime.makeArray(length, classId>(), alignof())); var outStart = out.dataStart; for (let index = 0; index < min(length, this.length_); ++index) { let value = load(this.dataStart + (index << alignof())); @@ -345,7 +345,7 @@ export class Array extends ArrayBufferView { } filter(callbackfn: (value: T, index: i32, array: Array) => bool): Array { - var result = MAKEARRAY(0); + var result = changetype>(runtime.makeArray(0, classId>(), alignof())); 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); @@ -433,7 +433,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 = MAKEARRAY(length); + var slice = changetype>(runtime.makeArray(length, classId>(), alignof())); var sliceBase = slice.dataStart; var thisBase = this.dataStart + (begin << alignof()); if (isManaged()) { @@ -465,7 +465,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 = MAKEARRAY(deleteCount); + var result = changetype>(runtime.makeArray(deleteCount, classId>(), alignof())); var resultStart = result.dataStart; var thisStart = this.dataStart; var thisBase = thisStart + (start << alignof()); @@ -560,7 +560,7 @@ export class Array extends ArrayBufferView { var sepLen = separator.length; var valueLen = 5; // max possible length of element len("false") var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = ALLOCATE(estLen << 1); + var result = runtime.allocate(estLen << 1); var offset = 0; var value: bool; for (let i = 0; i < lastIndex; ++i) { @@ -592,10 +592,10 @@ export class Array extends ArrayBufferView { if (estLen > offset) { let trimmed = changetype(result).substring(0, offset); - DISCARD(result); + runtime.discard(result); return trimmed; // registered in .substring } - return REGISTER(result); + return changetype(runtime.register(result, classId())); } private join_int(separator: string = ","): string { @@ -608,7 +608,7 @@ export class Array extends ArrayBufferView { var sepLen = separator.length; const valueLen = (sizeof() <= 4 ? 10 : 20) + i32(isSigned()); var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = ALLOCATE(estLen << 1); + var result = runtime.allocate(estLen << 1); var offset = 0; var value: T; for (let i = 0; i < lastIndex; ++i) { @@ -629,10 +629,10 @@ export class Array extends ArrayBufferView { offset += itoa_stream(result, offset, value); if (estLen > offset) { let trimmed = changetype(result).substring(0, offset); - DISCARD(result); + runtime.discard(result); return trimmed; // registered in .substring } - return REGISTER(result); + return changetype(runtime.register(result, classId())); } private join_flt(separator: string = ","): string { @@ -649,7 +649,7 @@ export class Array extends ArrayBufferView { const valueLen = MAX_DOUBLE_LENGTH; var sepLen = separator.length; var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = ALLOCATE(estLen << 1); + var result = runtime.allocate(estLen << 1); var offset = 0; var value: T; for (let i = 0; i < lastIndex; ++i) { @@ -674,10 +674,10 @@ export class Array extends ArrayBufferView { ); if (estLen > offset) { let trimmed = changetype(result).substring(0, offset); - DISCARD(result); + runtime.discard(result); return trimmed; // registered in .substring } - return REGISTER(result); + return changetype(runtime.register(result, classId())); } private join_str(separator: string = ","): string { @@ -694,7 +694,7 @@ export class Array extends ArrayBufferView { if (value !== null) estLen += value.length; } var offset = 0; - var result = ALLOCATE((estLen + sepLen * lastIndex) << 1); + var result = runtime.allocate((estLen + sepLen * lastIndex) << 1); for (let i = 0; i < lastIndex; ++i) { value = load(dataStart + (i << alignof())); if (value !== null) { @@ -723,7 +723,7 @@ export class Array extends ArrayBufferView { changetype(value).length << 1 ); } - return REGISTER(result); + return changetype(runtime.register(result, classId())); } private join_arr(separator: string = ","): string { @@ -760,7 +760,7 @@ export class Array extends ArrayBufferView { const valueLen = 15; // max possible length of element len("[object Object]") var sepLen = separator.length; var estLen = (valueLen + sepLen) * lastIndex + valueLen; - var result = ALLOCATE(estLen << 1); + var result = runtime.allocate(estLen << 1); var offset = 0; var value: T; for (let i = 0; i < lastIndex; ++i) { @@ -792,10 +792,10 @@ export class Array extends ArrayBufferView { } if (estLen > offset) { let out = changetype(result).substring(0, offset); - DISCARD(result); + runtime.discard(result); return out; // registered in .substring } - return REGISTER(result); + return changetype(runtime.register(result, classId())); } toString(): string { diff --git a/std/assembly/arraybuffer.ts b/std/assembly/arraybuffer.ts index 2461cdd8..558983e0 100644 --- a/std/assembly/arraybuffer.ts +++ b/std/assembly/arraybuffer.ts @@ -1,6 +1,34 @@ -import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, MAX_BYTELENGTH } from "./runtime"; +import { runtime, HEADER, HEADER_SIZE, classId } from "./runtime"; import { E_INVALIDLENGTH } from "./util/error"; +export abstract class ArrayBufferView { + + @unsafe data: ArrayBuffer; + @unsafe dataStart: usize; + @unsafe dataLength: u32; + + protected constructor(length: i32, alignLog2: i32) { + if (length > runtime.MAX_BYTELENGTH >>> alignLog2) throw new RangeError(E_INVALIDLENGTH); + var buffer = new ArrayBuffer(length = length << alignLog2); + this.data = buffer; + this.dataStart = changetype(buffer); + this.dataLength = length; + } + + get byteOffset(): i32 { + return (this.dataStart - changetype(this.data)); + } + + get byteLength(): i32 { + return this.dataLength; + } + + get length(): i32 { + ERROR("missing implementation: subclasses must implement ArrayBufferView#length"); + return unreachable(); + } +} + @sealed export class ArrayBuffer { static isView(value: T): bool { @@ -22,24 +50,24 @@ import { E_INVALIDLENGTH } from "./util/error"; } constructor(length: i32) { - if (length > MAX_BYTELENGTH) throw new RangeError(E_INVALIDLENGTH); - var buffer = ALLOCATE(length); + if (length > runtime.MAX_BYTELENGTH) throw new RangeError(E_INVALIDLENGTH); + var buffer = runtime.allocate(length); memory.fill(changetype(buffer), 0, length); - return REGISTER(buffer); + return changetype(runtime.register(buffer, classId())); } get byteLength(): i32 { return changetype
(changetype(this) - HEADER_SIZE).payloadSize; } - slice(begin: i32 = 0, end: i32 = MAX_BYTELENGTH): ArrayBuffer { + slice(begin: i32 = 0, end: i32 = runtime.MAX_BYTELENGTH): ArrayBuffer { var length = this.byteLength; begin = begin < 0 ? max(length + begin, 0) : min(begin, length); end = end < 0 ? max(length + end , 0) : min(end , length); var outSize = max(end - begin, 0); - var out = ALLOCATE(outSize); + var out = runtime.allocate(outSize); memory.copy(out, changetype(this) + begin, outSize); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } toString(): string { diff --git a/std/assembly/dataview.ts b/std/assembly/dataview.ts index 0e285c46..144c1cd1 100644 --- a/std/assembly/dataview.ts +++ b/std/assembly/dataview.ts @@ -1,4 +1,4 @@ -import { MAX_BYTELENGTH } from "./runtime"; +import { runtime } from "./runtime"; import { ArrayBuffer } from "./arraybuffer"; import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH } from "./util/error"; @@ -17,7 +17,7 @@ export class DataView { ) { if (byteLength === i32.MIN_VALUE) byteLength = buffer.byteLength - byteOffset; // FIXME if ( - i32(byteLength > MAX_BYTELENGTH) | + i32(byteLength > runtime.MAX_BYTELENGTH) | i32(byteOffset + byteLength > buffer.byteLength) ) throw new RangeError(E_INVALIDLENGTH); this.data = buffer; // links diff --git a/std/assembly/fixedarray.ts b/std/assembly/fixedarray.ts index cd1891ed..e63ecab0 100644 --- a/std/assembly/fixedarray.ts +++ b/std/assembly/fixedarray.ts @@ -1,4 +1,4 @@ -import { ALLOCATE, REGISTER, MAX_BYTELENGTH, HEADER, HEADER_SIZE, classId } from "./runtime"; +import { runtime, classId, HEADER, HEADER_SIZE } from "./runtime"; import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_HOLEYARRAY } from "./util/error"; // NOTE: DO NOT USE YET! @@ -10,16 +10,16 @@ export class FixedArray { [key: number]: T; constructor(length: i32) { - if (length > MAX_BYTELENGTH >>> alignof()) throw new RangeError(E_INVALIDLENGTH); + if (length > runtime.MAX_BYTELENGTH >>> alignof()) throw new RangeError(E_INVALIDLENGTH); if (isReference()) { if (!isNullable()) { if (length) throw new Error(E_HOLEYARRAY); } } var outSize = length << alignof(); - var out = ALLOCATE(outSize); + var out = runtime.allocate(outSize); memory.fill(out, 0, outSize); - return REGISTER>(out); + return changetype>(runtime.register(out, classId>())); } get length(): i32 { diff --git a/std/assembly/gc.ts b/std/assembly/gc.ts index ddd9a0d0..c1195c2d 100644 --- a/std/assembly/gc.ts +++ b/std/assembly/gc.ts @@ -20,7 +20,9 @@ export namespace gc { else throw new Error(E_NOTIMPLEMENTED); } - /** Retains a reference, making sure that it doesn't become collected. */ + /** Retains a managed object externally, making sure that it doesn't become collected. */ + // @ts-ignore: decorator + @unsafe export function retain(ref: usize): void { var root = GC_ROOT; if (!root.has(ref)) { @@ -28,21 +30,20 @@ export namespace gc { if (implemented) { if (isDefined(__ref_link)) __ref_link(ref, changetype(root)); else if (isDefined(__ref_retain)) __ref_retain(ref); - else assert(false); } } } - /** Releases a reference, allowing it to become collected. */ + /** Releases a managed object externally, allowing it to become collected. */ + // @ts-ignore: decorator + @unsafe export function release(ref: usize): void { var root = GC_ROOT; if (root.has(ref)) { root.delete(ref); if (implemented) { - if (isDefined(__ref_link)) { - if (isDefined(__ref_unlink)) __ref_unlink(ref, changetype(root)); - } else if (isDefined(__ref_retain)) __ref_release(ref); - else assert(false); + if (isDefined(__ref_unlink)) __ref_unlink(ref, changetype(root)); + else if (isDefined(__ref_release)) __ref_release(ref); } } } diff --git a/std/assembly/runtime.ts b/std/assembly/runtime.ts index 152aab2b..f019c881 100644 --- a/std/assembly/runtime.ts +++ b/std/assembly/runtime.ts @@ -1,12 +1,9 @@ // 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. However, -// most of the garbage collector interface must still be implemented explicitly in standard library -// components, because common abstractions for both tracing and reference counting would result in -// unnecessary overhead (e.g. tracing needs parent references while rc does not etc.). +// and garbage collection to the standard library, making sure it all plays well together. import { AL_MASK, MAX_SIZE_32 } from "./util/allocator"; import { HEAP_BASE, memory } from "./memory"; -import { Array } from "./array"; +import { ArrayBufferView } from "./arraybuffer"; /** * The common runtime object header prepended to all managed objects. Has a size of 16 bytes in @@ -48,208 +45,122 @@ export declare function classId(): u32; @unsafe @builtin export declare function iterateRoots(fn: (ref: usize) => void): void; -/** Adjusts an allocation to actual block size. Primarily targets TLSF. */ -export function ADJUSTOBLOCK(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)); -} +/** Runtime implementation. */ +export namespace runtime { -/** - * Allocates a runtime object that might eventually make its way into GC'ed userland as a - * managed object. Implicitly prepends the common runtime header to the allocation. - */ -// @ts-ignore: decorator -@unsafe @inline -export function ALLOCATE(payloadSize: usize): usize { - return allocate(payloadSize); -} + /** Maximum byte length of any buffer-like object. */ + // @ts-ignore + @lazy + export const MAX_BYTELENGTH: i32 = MAX_SIZE_32 - HEADER_SIZE; -function allocate(payloadSize: usize): usize { - var header = changetype
(memory.allocate(ADJUSTOBLOCK(payloadSize))); - header.classId = HEADER_MAGIC; - header.payloadSize = payloadSize; - if (isDefined(__ref_collect)) { - header.reserved1 = 0; - header.reserved2 = 0; + /** 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)); } - return changetype(header) + HEADER_SIZE; -} -/** - * Changes the size of a previously allocated, but not yet registered, runtime object, for - * example when a pre-allocated buffer turned out to be too small or too large. This works by - * aligning dynamic allocations to actual block size internally so in the best case REALLOCATE - * only updates payload size while in the worst case moves the object to a larger block. - */ -// @ts-ignore: decorator -@unsafe @inline -export function REALLOCATE(ref: usize, newPayloadSize: usize): usize { - return reallocate(ref, newPayloadSize); -} - -function reallocate(ref: usize, newPayloadSize: usize): usize { - // Background: When managed objects are allocated these aren't immediately registered with GC - // but can be used as scratch objects while unregistered. This is useful in situations where - // the object must be reallocated multiple times because its final size isn't known beforehand, - // e.g. in Array#filter, with only the final object making it into GC'ed userland. - var header = changetype
(ref - HEADER_SIZE); - var payloadSize = header.payloadSize; - if (payloadSize < newPayloadSize) { - let newAdjustedSize = ADJUSTOBLOCK(newPayloadSize); - if (select(ADJUSTOBLOCK(payloadSize), 0, ref > HEAP_BASE) < newAdjustedSize) { - // move if the allocation isn't large enough or not a heap object - let newHeader = changetype
(memory.allocate(newAdjustedSize)); - newHeader.classId = header.classId; - if (isDefined(__ref_collect)) { - newHeader.reserved1 = 0; - newHeader.reserved2 = 0; - } - let newRef = changetype(newHeader) + HEADER_SIZE; - memory.copy(newRef, ref, payloadSize); - memory.fill(newRef + payloadSize, 0, newPayloadSize - payloadSize); - if (header.classId == HEADER_MAGIC) { - // free right away if not registered yet - assert(ref > HEAP_BASE); // static objects aren't scratch objects - memory.free(changetype(header)); - } else if (isDefined(__ref_collect)) { - // if previously registered, register again - // @ts-ignore: stub - __ref_register(ref); - } - header = newHeader; - ref = newRef; - } else { - // otherwise just clear additional memory within this block - memory.fill(ref + payloadSize, 0, newPayloadSize - payloadSize); + // @ts-ignore: decorator + @unsafe + export function allocate(payloadSize: usize): usize { + var header = changetype
(memory.allocate(adjust(payloadSize))); + header.classId = HEADER_MAGIC; + header.payloadSize = payloadSize; + if (isDefined(__ref_collect)) { + header.reserved1 = 0; + header.reserved2 = 0; } - } else { - // if the size is the same or less, just update the header accordingly. - // unused space is cleared when grown, so no need to do this here. + return changetype(header) + HEADER_SIZE; } - header.payloadSize = newPayloadSize; - return ref; -} -/** - * Registers a runtime object of kind T. Sets the internal class id within the runtime header - * and asserts that the object hasn't been registered yet. If a tracing garbage collector is - * present that requires initial insertion, the macro usually forwards a call to it. Once a - * runtime object has been registed (makes it into userland), it cannot be DISCARD'ed anymore. - */ -// @ts-ignore: decorator -@unsafe @inline -export function REGISTER(ref: usize): T { - if (!isReference()) ERROR("reference expected"); - return changetype(register(ref, classId())); -} - -function register(ref: usize, classId: 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; - } else { - changetype
(ref - HEADER_SIZE).classId = classId; - } - // @ts-ignore: stub - if (isDefined(__ref_register)) __ref_register(ref); - return ref; -} - -/** - * Discards a runtime object that has not been registed and turned out to be unnecessary. - * Essentially undoes the forgoing ALLOCATE. Should be avoided where possible. - */ -// @ts-ignore: decorator -@unsafe @inline -export function DISCARD(ref: usize): void { - discard(ref); -} - -function discard(ref: usize): void { - if (!ASC_NO_ASSERT) { - assert(ref > HEAP_BASE); // must be a heap object - let header = changetype
(ref - HEADER_SIZE); - assert(header.classId == HEADER_MAGIC); - memory.free(changetype(header)); - } else { - memory.free(changetype(ref - HEADER_SIZE)); - } -} - -/** - * Makes a new array and optionally initializes is with existing data from source. Used by the - * compiler to either wrap static array data in a new instance or pre-initialize the memory used - * by an array literal. Does not zero the backing buffer! - */ -// @ts-ignore: decorator -@unsafe @inline -export function MAKEARRAY(capacity: i32, source: usize = 0): Array { - return changetype>(makeArray(capacity, classId(), alignof(), source)); -} - -function makeArray(capacity: i32, cid: u32, alignLog2: usize, source: usize): usize { - var array = register(allocate(offsetof()), cid); - var bufferSize = capacity << alignLog2; - var buffer = register(allocate(capacity << alignLog2), classId()); - 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); - return array; -} - -import { ArrayBuffer } from "./arraybuffer"; -import { E_INVALIDLENGTH } from "./util/error"; - -/** Maximum byte length of any buffer. */ -// @ts-ignore: decorator -@lazy -export const MAX_BYTELENGTH: i32 = MAX_SIZE_32 - HEADER_SIZE; - -/** Hard wired ArrayBufferView interface. */ -export abstract class ArrayBufferView { - - /** Backing buffer. */ // @ts-ignore: decorator @unsafe - data: ArrayBuffer; + export function reallocate(ref: usize, newPayloadSize: usize): usize { + // Background: When managed objects are allocated these aren't immediately registered with GC + // but can be used as scratch objects while unregistered. This is useful in situations where + // the object must be reallocated multiple times because its final size isn't known beforehand, + // e.g. in Array#filter, with only the final object making it into GC'ed userland. + var header = changetype
(ref - HEADER_SIZE); + var payloadSize = header.payloadSize; + if (payloadSize < newPayloadSize) { + let newAdjustedSize = adjust(newPayloadSize); + if (select(adjust(payloadSize), 0, ref > HEAP_BASE) < newAdjustedSize) { + // move if the allocation isn't large enough or not a heap object + let newHeader = changetype
(memory.allocate(newAdjustedSize)); + newHeader.classId = header.classId; + if (isDefined(__ref_collect)) { + newHeader.reserved1 = 0; + newHeader.reserved2 = 0; + } + let newRef = changetype(newHeader) + HEADER_SIZE; + memory.copy(newRef, ref, payloadSize); + memory.fill(newRef + payloadSize, 0, newPayloadSize - payloadSize); + if (header.classId == HEADER_MAGIC) { + // free right away if not registered yet + assert(ref > HEAP_BASE); // static objects aren't scratch objects + memory.free(changetype(header)); + } else if (isDefined(__ref_collect)) { + // if previously registered, register again + // @ts-ignore: stub + __ref_register(ref); + } + header = newHeader; + ref = newRef; + } else { + // otherwise just clear additional memory within this block + memory.fill(ref + payloadSize, 0, newPayloadSize - payloadSize); + } + } else { + // if the size is the same or less, just update the header accordingly. + // unused space is cleared when grown, so no need to do this here. + } + header.payloadSize = newPayloadSize; + return ref; + } - /** Data start offset in memory. */ // @ts-ignore: decorator @unsafe - dataStart: usize; + export function discard(ref: usize): void { + if (!ASC_NO_ASSERT) { + assert(ref > HEAP_BASE); // must be a heap object + let header = changetype
(ref - HEADER_SIZE); + assert(header.classId == HEADER_MAGIC); + memory.free(changetype(header)); + } else { + memory.free(changetype(ref - HEADER_SIZE)); + } + } - /** Data length in memory, counted from `dataStart`. */ // @ts-ignore: decorator @unsafe - dataLength: u32; - - protected constructor(length: i32, alignLog2: i32) { - if (length > MAX_BYTELENGTH >>> alignLog2) throw new RangeError(E_INVALIDLENGTH); - var buffer = new ArrayBuffer(length = length << alignLog2); - this.data = buffer; - this.dataStart = changetype(buffer); - this.dataLength = length; + export function register(ref: usize, classId: 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; + } else { + changetype
(ref - HEADER_SIZE).classId = classId; + } + if (isDefined(__ref_register)) __ref_register(ref); + return ref; } - get byteOffset(): i32 { - return (this.dataStart - changetype(this.data)); - } - - get byteLength(): i32 { - return this.dataLength; - } - - get length(): i32 { - ERROR("missing implementation: subclasses must implement ArrayBufferView#length"); - return unreachable(); + // @ts-ignore: decorator + @unsafe + export function makeArray(capacity: i32, cid: u32, alignLog2: usize, source: usize = 0): usize { + var array = runtime.register(runtime.allocate(offsetof()), cid); + var bufferSize = capacity << alignLog2; + var buffer = runtime.register(runtime.allocate(capacity << alignLog2), classId()); + 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); + return array; } } diff --git a/std/assembly/string.ts b/std/assembly/string.ts index cdf4e4c9..e96155af 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -1,7 +1,8 @@ /// -import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, MAKEARRAY, ArrayBufferView } from "./runtime"; import { MAX_SIZE_32 } from "./util/allocator"; +import { runtime, HEADER, HEADER_SIZE, classId } from "./runtime"; +import { ArrayBufferView } from "./arraybuffer"; import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./util/string"; import { E_INVALIDLENGTH } from "./util/error"; @@ -15,15 +16,15 @@ import { E_INVALIDLENGTH } from "./util/error"; // TODO Add and handle second argument static fromCharCode(code: i32): String { - var out = ALLOCATE(2); + var out = runtime.allocate(2); store(out, code); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } static fromCodePoint(code: i32): String { assert(code <= 0x10FFFF); var sur = code > 0xFFFF; - var out = ALLOCATE((i32(sur) + 1) << 1); + var out = runtime.allocate((i32(sur) + 1) << 1); if (!sur) { store(out, code); } else { @@ -32,15 +33,15 @@ import { E_INVALIDLENGTH } from "./util/error"; let lo: u32 = (code & 0x3FF) + 0xDC00; store(out, (hi << 16) | lo); } - return REGISTER(out); + return changetype(runtime.register(out, classId())); } @operator("[]") charAt(pos: i32): String { assert(this !== null); if (pos >= this.length) return changetype(""); - var out = ALLOCATE(2); + var out = runtime.allocate(2); store(out, load(changetype(this) + (pos << 1))); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } charCodeAt(pos: i32): i32 { @@ -57,8 +58,8 @@ import { E_INVALIDLENGTH } from "./util/error"; return ((first - 0xD800) << 10) + (second - 0xDC00) + 0x10000; } - @operator("+") private static __concat(left: string, right: string): string { - return select(left, "null", left !== null).concat(right); + @operator("+") private static __concat(left: String, right: String): String { + return select(left, changetype("null"), left !== null).concat(right); } concat(other: String): String { @@ -67,10 +68,10 @@ import { E_INVALIDLENGTH } from "./util/error"; var otherSize: isize = other.length << 1; var outSize: usize = thisSize + otherSize; if (outSize == 0) return changetype(""); - var out = ALLOCATE(outSize); + var out = runtime.allocate(outSize); memory.copy(out, changetype(this), thisSize); memory.copy(out + thisSize, changetype(other), otherSize); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } endsWith(searchString: String, endPosition: i32 = String.MAX_LENGTH): bool { @@ -180,9 +181,9 @@ import { E_INVALIDLENGTH } from "./util/error"; if (intStart < 0) intStart = max(size + intStart, 0); var resultLength = min(max(end, 0), size - intStart); if (resultLength <= 0) return changetype(""); - var out = ALLOCATE(resultLength << 1); + var out = runtime.allocate(resultLength << 1); memory.copy(out, changetype(this) + intStart, resultLength); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } substring(start: i32, end: i32 = i32.MAX_VALUE): String { @@ -195,9 +196,9 @@ import { E_INVALIDLENGTH } from "./util/error"; len = toPos - fromPos; if (!len) return changetype(""); if (!fromPos && toPos == this.length << 1) return this; - var out = ALLOCATE(len); + var out = runtime.allocate(len); memory.copy(out, changetype(this) + fromPos, len); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } trim(): String { @@ -223,9 +224,9 @@ import { E_INVALIDLENGTH } from "./util/error"; } if (!size) return changetype(""); if (!start && size == length << 1) return this; - var out = ALLOCATE(size); + var out = runtime.allocate(size); memory.copy(out, changetype(this) + offset, size); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } @inline @@ -253,9 +254,9 @@ import { E_INVALIDLENGTH } from "./util/error"; if (!offset) return this; size -= offset; if (!size) return changetype(""); - var out = ALLOCATE(size); + var out = runtime.allocate(size); memory.copy(out, changetype(this) + offset, size); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } trimEnd(): String { @@ -272,9 +273,9 @@ import { E_INVALIDLENGTH } from "./util/error"; } if (!size) return changetype(""); if (size == originalSize) return this; - var out = ALLOCATE(size); + var out = runtime.allocate(size); memory.copy(out, changetype(this), size); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } padStart(targetLength: i32, padString: string = " "): String { @@ -284,7 +285,7 @@ import { E_INVALIDLENGTH } from "./util/error"; var padSize = padString.length << 1; if (targetSize < thisSize || !padSize) return this; var prependSize = targetSize - thisSize; - var out = ALLOCATE(targetSize); + var out = runtime.allocate(targetSize); if (prependSize > padSize) { let repeatCount = (prependSize - 2) / padSize; let restBase = repeatCount * padSize; @@ -295,7 +296,7 @@ import { E_INVALIDLENGTH } from "./util/error"; memory.copy(out, changetype(padString), prependSize); } memory.copy(out + prependSize, changetype(this), thisSize); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } padEnd(targetLength: i32, padString: string = " "): String { @@ -305,7 +306,7 @@ import { E_INVALIDLENGTH } from "./util/error"; var padSize = padString.length << 1; if (targetSize < thisSize || !padSize) return this; var appendSize = targetSize - thisSize; - var out = ALLOCATE(targetSize); + var out = runtime.allocate(targetSize); memory.copy(out, changetype(this), thisSize); if (appendSize > padSize) { let repeatCount = (appendSize - 2) / padSize; @@ -316,7 +317,7 @@ import { E_INVALIDLENGTH } from "./util/error"; } else { memory.copy(out + thisSize, changetype(padString), appendSize); } - return REGISTER(out); + return changetype(runtime.register(out, classId())); } repeat(count: i32 = 0): String { @@ -330,9 +331,9 @@ import { E_INVALIDLENGTH } from "./util/error"; if (count == 0 || !length) return changetype(""); if (count == 1) return this; - var out = ALLOCATE((length * count) << 1); + var out = runtime.allocate((length * count) << 1); memory.repeat(out, changetype(this), length << 1, count); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } slice(beginIndex: i32, endIndex: i32 = i32.MAX_VALUE): String { @@ -341,48 +342,48 @@ import { E_INVALIDLENGTH } from "./util/error"; var end = endIndex < 0 ? max(endIndex + len, 0) : min(endIndex, len); len = end - begin; if (len <= 0) return changetype(""); - var out = ALLOCATE(len << 1); + var out = runtime.allocate(len << 1); memory.copy(out, changetype(this) + (begin << 1), len << 1); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] { assert(this !== null); - if (!limit) return MAKEARRAY(0); + if (!limit) return changetype(runtime.makeArray(0, classId(), alignof())); 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 MAKEARRAY(0); + if (!length) return changetype(runtime.makeArray(0, classId(), alignof())); // split by chars length = min(length, limit); - let result = MAKEARRAY(length); + let result = changetype(runtime.makeArray(length, classId(), alignof())); let resultStart = changetype(result).dataStart; for (let i: isize = 0; i < length; ++i) { - let charStr = REGISTER(ALLOCATE(2)); - store(changetype(charStr), load(changetype(this) + (i << 1))); - store(resultStart + (i << alignof()), charStr); // result[i] = charStr + let charStr = runtime.allocate(2); + store(charStr, load(changetype(this) + (i << 1))); + store(resultStart + (i << alignof()), charStr); // result[i] = charStr + runtime.register(charStr, classId()); if (isManaged()) { if (isDefined(__ref_link)) __ref_link(changetype(charStr), changetype(result)); - else if (isDefined(__ref_retain)) __ref_retain(changetype(charStr)); - else assert(false); + if (isDefined(__ref_retain)) __ref_retain(changetype(charStr)); } } return result; } else if (!length) { - let result = MAKEARRAY(1); + let result = changetype(runtime.makeArray(1, classId(), alignof())); store(changetype(result).dataStart, ""); // no need to register/link return result; } - var result = MAKEARRAY(0); + var result = changetype(runtime.makeArray(0, classId(), alignof())); var end = 0, start = 0, i = 0; while ((end = this.indexOf(separator!, start)) != -1) { let len = end - start; if (len > 0) { - let out = ALLOCATE(len << 1); + let out = runtime.allocate(len << 1); memory.copy(out, changetype(this) + (start << 1), len << 1); - result.push(REGISTER(out)); + result.push(changetype(runtime.register(out, classId()))); } else { result.push(changetype("")); } @@ -390,15 +391,15 @@ import { E_INVALIDLENGTH } from "./util/error"; start = end + sepLen; } if (!start) { - let result = MAKEARRAY(1); + let result = changetype(runtime.makeArray(1, classId(), alignof())); unchecked(result[0] = this); return result; } var len = length - start; if (len > 0) { - let out = ALLOCATE(len << 1); + let out = runtime.allocate(len << 1); memory.copy(out, changetype(this) + (start << 1), len << 1); - result.push(REGISTER(out)); + result.push(changetype(runtime.register(out, classId()))); } else { result.push(changetype("")); } @@ -433,8 +434,8 @@ import { E_INVALIDLENGTH } from "./util/error"; return len; } - static fromUTF8(ptr: usize, len: usize): string { - if (len < 1) return changetype(""); + static fromUTF8(ptr: usize, len: usize): String { + if (len < 1) return changetype(""); var ptrPos = 0; var buf = memory.allocate(len << 1); var bufPos = 0; @@ -470,10 +471,10 @@ import { E_INVALIDLENGTH } from "./util/error"; } } assert(ptrPos == len); - var out = ALLOCATE(bufPos); + var out = runtime.allocate(bufPos); memory.copy(changetype(out), buf, bufPos); memory.free(buf); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } toUTF8(): usize { diff --git a/std/assembly/typedarray.ts b/std/assembly/typedarray.ts index 6c450fb1..44deb819 100644 --- a/std/assembly/typedarray.ts +++ b/std/assembly/typedarray.ts @@ -1,4 +1,5 @@ -import { ALLOCATE, REGISTER, ArrayBufferView } from "./runtime"; +import { runtime, classId } from "./runtime"; +import { ArrayBufferView } from "./arraybuffer"; import { COMPARATOR, SORT as SORT_IMPL } from "./util/sort"; import { E_INDEXOUTOFRANGE } from "./util/error"; @@ -960,13 +961,13 @@ function SUBARRAY( else begin = min(begin, length); if (end < 0) end = max(length + end, begin); else end = max(min(end, length), begin); - var out = REGISTER(ALLOCATE(offsetof())); + var out = runtime.allocate(offsetof()); var data = array.data; var dataStart = array.dataStart; changetype(out).data = data; // links changetype(out).dataStart = dataStart + (begin << alignof()); changetype(out).dataLength = (end - begin) << alignof(); - return out; + return changetype(runtime.register(out, classId())); } // @ts-ignore: decorator diff --git a/std/assembly/util/number.ts b/std/assembly/util/number.ts index 11278c70..4cb4608d 100644 --- a/std/assembly/util/number.ts +++ b/std/assembly/util/number.ts @@ -1,4 +1,5 @@ -import { ALLOCATE, REGISTER, DISCARD, ArrayBufferView } from "../runtime"; +import { runtime, classId } from "../runtime"; +import { ArrayBufferView } from "../arraybuffer"; import { CharCode } from "./string"; // @ts-ignore: decorator @@ -262,10 +263,10 @@ export function utoa32(value: u32): String { if (!value) return "0"; var decimals = decimalCount32(value); - var out = ALLOCATE(decimals << 1); + var out = runtime.allocate(decimals << 1); utoa32_core(changetype(out), value, decimals); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } export function itoa32(value: i32): String { @@ -275,12 +276,12 @@ export function itoa32(value: i32): String { if (sign) value = -value; var decimals = decimalCount32(value) + u32(sign); - var out = ALLOCATE(decimals << 1); + var out = runtime.allocate(decimals << 1); utoa32_core(changetype(out), value, decimals); if (sign) store(changetype(out), CharCode.MINUS); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } export function utoa64(value: u64): String { @@ -290,14 +291,14 @@ export function utoa64(value: u64): String { if (value <= u32.MAX_VALUE) { let val32 = value; let decimals = decimalCount32(val32); - out = ALLOCATE(decimals << 1); + out = runtime.allocate(decimals << 1); utoa32_core(out, val32, decimals); } else { let decimals = decimalCount64(value); - out = ALLOCATE(decimals << 1); + out = runtime.allocate(decimals << 1); utoa64_core(changetype(out), value, decimals); } - return REGISTER(out); + return changetype(runtime.register(out, classId())); } export function itoa64(value: i64): String { @@ -310,16 +311,16 @@ export function itoa64(value: i64): String { if (value <= u32.MAX_VALUE) { let val32 = value; let decimals = decimalCount32(val32) + u32(sign); - out = ALLOCATE(decimals << 1); + out = runtime.allocate(decimals << 1); utoa32_core(changetype(out), val32, decimals); } else { let decimals = decimalCount64(value) + u32(sign); - out = ALLOCATE(decimals << 1); + out = runtime.allocate(decimals << 1); utoa64_core(changetype(out), value, decimals); } if (sign) store(changetype(out), CharCode.MINUS); - return REGISTER(out); + return changetype(runtime.register(out, classId())); } export function itoa(value: T): String { @@ -624,10 +625,10 @@ export function dtoa(value: f64): String { if (isNaN(value)) return "NaN"; return select("-Infinity", "Infinity", value < 0); } - var temp = ALLOCATE(MAX_DOUBLE_LENGTH << 1); + var temp = runtime.allocate(MAX_DOUBLE_LENGTH << 1); var length = dtoa_core(temp, value); - var result = changetype(temp).substring(0, length); - DISCARD(temp); + var result = changetype(temp).substring(0, length); // registers + runtime.discard(temp); return result; } diff --git a/tests/compiler/call-super.optimized.wat b/tests/compiler/call-super.optimized.wat index 43fea1ad..4ccab138 100644 --- a/tests/compiler/call-super.optimized.wat +++ b/tests/compiler/call-super.optimized.wat @@ -77,7 +77,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -98,7 +98,7 @@ i32.const 8 i32.add ) - (func $~lib/runtime/register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 84 @@ -106,8 +106,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -121,8 +121,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -136,9 +136,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -161,9 +161,9 @@ (func $call-super/B#constructor (; 5 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register call $call-super/A#constructor local.tee $0 i32.const 2 @@ -225,16 +225,16 @@ (func $call-super/D#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -302,9 +302,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -327,9 +327,9 @@ (func $call-super/test3 (; 10 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register call $call-super/E#constructor local.tee $0 i32.const 2 @@ -362,16 +362,16 @@ (func $call-super/H#constructor (; 11 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -415,16 +415,16 @@ (func $call-super/J#constructor (; 13 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/call-super.untouched.wat b/tests/compiler/call-super.untouched.wat index b5175c2d..6bc65dd1 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/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -114,10 +114,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -130,7 +130,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 5 ;) (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 global.get $~lib/memory/HEAP_BASE @@ -139,8 +139,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -156,8 +156,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -172,9 +172,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -202,9 +202,9 @@ local.get $0 else i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end call $call-super/A#constructor local.set $0 @@ -276,9 +276,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -292,9 +292,9 @@ local.get $0 else i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end call $call-super/C#constructor local.set $0 @@ -367,9 +367,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -396,9 +396,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -446,9 +446,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -461,9 +461,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -511,9 +511,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -526,9 +526,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/constructor.optimized.wat b/tests/compiler/constructor.optimized.wat index 6990d26b..df9f379b 100644 --- a/tests/compiler/constructor.optimized.wat +++ b/tests/compiler/constructor.optimized.wat @@ -1167,7 +1167,7 @@ local.get $1 call $~lib/allocator/tlsf/Root#use ) - (func $~lib/runtime/allocate (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -1499,7 +1499,7 @@ local.get $0 call $~lib/collector/itcm/ManagedObjectList#push ) - (func $~lib/runtime/register (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 156 @@ -1507,8 +1507,8 @@ if i32.const 0 i32.const 88 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -1522,8 +1522,8 @@ if i32.const 0 i32.const 88 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -1542,9 +1542,9 @@ global.get $constructor/b if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1552,9 +1552,9 @@ end if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1562,46 +1562,46 @@ (func $start:constructor (; 28 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register global.set $constructor/emptyCtor i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 1 i32.store local.get $0 global.set $constructor/emptyCtorWithFieldInit i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store local.get $0 global.set $constructor/emptyCtorWithFieldNoInit i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.register global.set $constructor/none i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 1 i32.store local.get $0 global.set $constructor/justFieldInit i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -1618,15 +1618,15 @@ br $__inlined_func$constructor/CtorConditionallyReturns#constructor end i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end global.set $constructor/ctorConditionallyReturns i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 12 - call $~lib/runtime/register + call $~lib/runtime/runtime.register global.set $constructor/ctorAllocates call $constructor/CtorConditionallyAllocates#constructor global.set $constructor/ctorConditionallyAllocates diff --git a/tests/compiler/constructor.untouched.wat b/tests/compiler/constructor.untouched.wat index c43d2cb4..18e3224c 100644 --- a/tests/compiler/constructor.untouched.wat +++ b/tests/compiler/constructor.untouched.wat @@ -58,7 +58,7 @@ (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -1438,10 +1438,10 @@ call $~lib/allocator/tlsf/__mem_allocate return ) - (func $~lib/runtime/allocate (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -1853,7 +1853,7 @@ local.get $2 call $~lib/collector/itcm/ManagedObjectList#push ) - (func $~lib/runtime/register (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -1862,8 +1862,8 @@ if i32.const 0 i32.const 88 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -1879,8 +1879,8 @@ if i32.const 0 i32.const 88 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -1896,9 +1896,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1911,9 +1911,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1929,9 +1929,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1946,9 +1946,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1961,9 +1961,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1979,9 +1979,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2007,9 +2007,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2023,9 +2023,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 12 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2044,9 +2044,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2057,9 +2057,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index b2e7924f..55ce6dba 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -124,7 +124,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 16 call $~lib/allocator/arena/__mem_allocate @@ -138,7 +138,7 @@ i32.const 8 i32.add ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 48 @@ -146,8 +146,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -161,8 +161,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -229,9 +229,9 @@ local.get $0 i32.eqz if - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -257,9 +257,9 @@ local.get $0 i32.eqz if - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index 96704ef4..36d55435 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -71,7 +71,7 @@ (func $exports/Car.getNumTires (; 4 ;) (type $FUNCSIG$i) (result i32) global.get $exports/Car.TIRES ) - (func $~lib/runtime/ADJUSTOBLOCK (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -167,10 +167,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -183,7 +183,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -192,8 +192,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -209,8 +209,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -225,9 +225,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -260,9 +260,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/gc.optimized.wat b/tests/compiler/gc.optimized.wat index 730674c6..c4c8cb6c 100644 --- a/tests/compiler/gc.optimized.wat +++ b/tests/compiler/gc.optimized.wat @@ -6,7 +6,9 @@ (type $FUNCSIG$iii (func (param i32 i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (type $FUNCSIG$i (func (result i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64))) @@ -40,18 +42,37 @@ (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/gc/gc.implemented i32 (i32.const 1)) (global $~lib/argc (mut i32) (i32.const 0)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/gc/GC_ROOT (mut i32) (i32.const 0)) (global $~lib/started (mut i32) (i32.const 0)) (global $~lib/capabilities i32 (i32.const 2)) (export "memory" (memory $0)) (export "table" (table $0)) (export "main" (func $gc/main)) + (export "runtime.MAX_BYTELENGTH" (global $~lib/runtime/runtime.MAX_BYTELENGTH)) + (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 ".setargc" (func $~lib/setargc)) + (export "runtime.makeArray" (func $~lib/runtime/runtime.makeArray|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/allocator/arena/__mem_allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (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) (local $1 i32) (local $2 i32) (local $3 i32) @@ -113,7 +134,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -140,10 +161,10 @@ i32.const 16 i32.add ) - (func $gc/Ref~iterate (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $gc/Ref~iterate (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $gc/_dummy/__ref_register (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $gc/_dummy/__ref_register (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) i32.const 72 i32.const 1 local.get $0 @@ -160,7 +181,7 @@ local.get $0 global.set $gc/_dummy/register_ref ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 292 @@ -168,8 +189,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -183,8 +204,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -195,7 +216,7 @@ call $gc/_dummy/__ref_register local.get $0 ) - (func $~lib/set/Set~iterate (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set~iterate (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) i32.const 1 global.set $~lib/argc local.get $0 @@ -211,7 +232,7 @@ local.get $1 call_indirect (type $FUNCSIG$vi) ) - (func $~lib/memory/memory.fill (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/memory/memory.fill (; 9 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) block $~lib/util/memory/memset|inlined.0 local.get $1 @@ -422,7 +443,7 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 1073741808 @@ -430,21 +451,21 @@ if i32.const 0 i32.const 144 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end local.get $0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 call $~lib/memory/memory.fill local.get $1 i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) - (func $gc/_dummy/__ref_link (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $gc/_dummy/__ref_link (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) i32.const 200 i32.const 2 local.get $0 @@ -464,7 +485,7 @@ local.get $0 global.set $gc/_dummy/link_parentRef ) - (func $gc/_dummy/__ref_unlink (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $gc/_dummy/__ref_unlink (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) i32.const 232 i32.const 2 local.get $0 @@ -484,7 +505,7 @@ local.get $1 global.set $gc/_dummy/unlink_parentRef ) - (func $~lib/set/Set#clear (; 12 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 13 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -547,12 +568,12 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 13 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#constructor (; 14 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -575,7 +596,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and @@ -606,7 +627,7 @@ i32.const 16777619 i32.mul ) - (func $~lib/set/Set#find (; 15 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load local.get $0 @@ -649,7 +670,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -658,7 +679,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -793,7 +814,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -876,7 +897,7 @@ i32.store end ) - (func $~lib/gc/gc.retain (; 19 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/gc/gc.retain (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) global.get $~lib/gc/GC_ROOT local.tee $1 @@ -892,7 +913,7 @@ call $gc/_dummy/__ref_link end ) - (func $~lib/set/Set#delete (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#delete (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 @@ -952,7 +973,7 @@ call $~lib/set/Set#rehash end ) - (func $~lib/gc/gc.release (; 21 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/gc/gc.release (; 22 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) global.get $~lib/gc/GC_ROOT local.tee $1 @@ -967,7 +988,7 @@ call $gc/_dummy/__ref_unlink end ) - (func $~lib/gc/gc.collect (; 22 ;) (type $FUNCSIG$v) + (func $~lib/gc/gc.collect (; 23 ;) (type $FUNCSIG$v) i32.const 272 i32.const 0 f64.const 0 @@ -981,7 +1002,7 @@ i32.add global.set $gc/_dummy/collect_count ) - (func $gc/main (; 23 ;) (type $FUNCSIG$v) + (func $gc/main (; 24 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) (local $2 i32) @@ -999,9 +1020,9 @@ global.set $~lib/started end i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $2 global.get $gc/_dummy/link_count local.set $3 @@ -1132,7 +1153,1260 @@ unreachable end ) - (func $null (; 24 ;) (type $FUNCSIG$v) + (func $~lib/util/memory/memcpy (; 25 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + loop $continue|0 + local.get $1 + i32.const 3 + i32.and + local.get $2 + local.get $2 + select + if + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + local.get $0 + i32.const 3 + i32.and + i32.eqz + if + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $1 + i32.const 8 + i32.add + local.set $1 + local.get $0 + i32.const 8 + i32.add + local.set $0 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + local.get $0 + i32.const 4 + i32.add + local.set $0 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $1 + i32.const 2 + i32.add + local.set $1 + local.get $0 + i32.const 2 + i32.add + local.set $0 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + local.get $0 + i32.const 3 + i32.and + local.tee $3 + i32.const 1 + i32.ne + if + local.get $3 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + local.get $1 + i32.load + local.set $5 + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.load + local.tee $3 + i32.const 8 + i32.shl + local.get $5 + i32.const 24 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $1 + i32.const 5 + i32.add + i32.load + local.tee $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $1 + i32.const 9 + i32.add + i32.load + local.tee $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 13 + i32.add + i32.load + local.tee $5 + i32.const 8 + i32.shl + local.get $3 + i32.const 24 + i32.shr_u + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $5 + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $0 + local.get $1 + i32.const 2 + i32.add + i32.load + local.tee $3 + i32.const 16 + i32.shl + local.get $5 + i32.const 16 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $1 + i32.const 6 + i32.add + i32.load + local.tee $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $1 + i32.const 10 + i32.add + i32.load + local.tee $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 14 + i32.add + i32.load + local.tee $5 + i32.const 16 + i32.shl + local.get $3 + i32.const 16 + i32.shr_u + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $5 + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $0 + local.get $1 + i32.const 3 + i32.add + i32.load + local.tee $3 + i32.const 24 + i32.shl + local.get $5 + i32.const 8 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $1 + i32.const 7 + i32.add + i32.load + local.tee $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $1 + i32.const 11 + i32.add + i32.load + local.tee $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 15 + i32.add + i32.load + local.tee $5 + i32.const 24 + i32.shl + local.get $3 + i32.const 8 + i32.shr_u + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + end + local.get $2 + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $0 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 26 ;) (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 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $1 + local.get $2 + i32.add + local.get $0 + i32.le_u + local.tee $3 + i32.eqz + if + local.get $0 + local.get $2 + i32.add + local.get $1 + i32.le_u + local.set $3 + end + local.get $3 + if + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $2 + if + local.get $0 + local.tee $3 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $4 + i32.const 1 + i32.add + local.set $1 + local.get $3 + local.get $4 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $0 + local.get $2 + i32.add + i32.const 7 + i32.and + if + local.get $2 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $2 + i32.const 8 + i32.ge_u + if + local.get $2 + i32.const 8 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $2 + if + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + local.get $0 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/runtime/runtime.reallocate (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 16 + i32.sub + local.tee $4 + i32.load offset=4 + local.tee $2 + local.get $1 + i32.lt_u + if + i32.const 1 + i32.const 32 + local.get $1 + i32.const 15 + i32.add + i32.clz + i32.sub + i32.shl + local.tee $3 + local.set $5 + i32.const 1 + i32.const 32 + local.get $2 + i32.const 15 + i32.add + i32.clz + i32.sub + i32.shl + i32.const 0 + local.get $0 + i32.const 292 + i32.gt_u + select + local.get $3 + i32.lt_u + if + local.get $5 + call $~lib/allocator/arena/__mem_allocate + local.tee $3 + local.get $4 + i32.load + i32.store + local.get $3 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 0 + i32.store offset=12 + local.get $3 + i32.const 16 + i32.add + local.tee $5 + local.get $0 + local.get $2 + call $~lib/memory/memory.copy + local.get $2 + local.get $5 + i32.add + local.get $1 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + local.get $4 + i32.load + i32.const -1520547049 + i32.eq + if + local.get $0 + i32.const 292 + i32.le_u + if + i32.const 0 + i32.const 24 + i32.const 107 + i32.const 10 + call $~lib/env/abort + unreachable + end + else + local.get $0 + call $gc/_dummy/__ref_register + end + local.get $3 + local.set $4 + local.get $5 + local.set $0 + else + local.get $0 + local.get $2 + i32.add + local.get $1 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + end + end + local.get $4 + local.get $1 + i32.store offset=4 + local.get $0 + ) + (func $~lib/runtime/runtime.discard (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 292 + i32.le_u + if + i32.const 0 + i32.const 24 + i32.const 132 + i32.const 6 + call $~lib/env/abort + unreachable + end + local.get $0 + i32.const 16 + i32.sub + i32.load + i32.const -1520547049 + i32.ne + if + i32.const 0 + i32.const 24 + i32.const 134 + i32.const 6 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/runtime/runtime.makeArray (; 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 + i32.shl + local.tee $6 + call $~lib/runtime/runtime.allocate + i32.const 5 + call $~lib/runtime/runtime.register + local.tee $7 + local.tee $1 + local.get $4 + i32.load + local.tee $2 + i32.ne + if + local.get $2 + if + local.get $2 + local.get $5 + call $gc/_dummy/__ref_unlink + end + local.get $1 + local.get $5 + call $gc/_dummy/__ref_link + end + local.get $4 + local.get $1 + i32.store + local.get $4 + local.get $7 + i32.store offset=4 + local.get $4 + local.get $6 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $7 + local.get $3 + local.get $6 + call $~lib/memory/memory.copy + end + local.get $4 + ) + (func $null (; 30 ;) (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) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + i32.const 3 + i32.sub + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + i32.const 0 + local.set $3 + end + local.get $0 + local.get $1 + local.get $2 + local.get $3 + call $~lib/runtime/runtime.makeArray + ) + (func $~lib/setargc (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.set $~lib/argc + ) ) diff --git a/tests/compiler/gc.ts b/tests/compiler/gc.ts index 32d06673..7be2ec77 100644 --- a/tests/compiler/gc.ts +++ b/tests/compiler/gc.ts @@ -1,5 +1,5 @@ import { link_count, unlink_count, collect_count } from "./gc/_dummy"; -export { gc }; +export { runtime, gc }; class Ref {} diff --git a/tests/compiler/gc.untouched.wat b/tests/compiler/gc.untouched.wat index e41cb420..354568f1 100644 --- a/tests/compiler/gc.untouched.wat +++ b/tests/compiler/gc.untouched.wat @@ -8,6 +8,7 @@ (type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64))) (type $FUNCSIG$viii (func (param i32 i32 i32))) (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) + (type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64))) (memory $0 1) @@ -36,7 +37,7 @@ (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) (global $~lib/gc/gc.implemented i32 (i32.const 1)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/gc/GC_ROOT (mut i32) (i32.const 0)) (global $~lib/started (mut i32) (i32.const 0)) (global $~lib/memory/HEAP_BASE i32 (i32.const 292)) @@ -44,12 +45,20 @@ (export "memory" (memory $0)) (export "table" (table $0)) (export "main" (func $gc/main)) + (export "runtime.MAX_BYTELENGTH" (global $~lib/runtime/runtime.MAX_BYTELENGTH)) + (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 ".setargc" (func $~lib/setargc)) + (export "runtime.makeArray" (func $~lib/runtime/runtime.makeArray|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/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -145,10 +154,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -189,7 +198,7 @@ local.get $0 global.set $gc/_dummy/register_ref ) - (func $~lib/runtime/register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -198,8 +207,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -215,8 +224,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -232,9 +241,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -518,36 +527,27 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 i32.const 144 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 5 - call $~lib/runtime/register - end + local.get $2 + i32.const 5 + call $~lib/runtime/runtime.register ) (func $gc/_dummy/__ref_link (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) i32.const 200 @@ -664,9 +664,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1355,7 +1355,1648 @@ unreachable end ) - (func $start (; 30 ;) (type $FUNCSIG$v) + (func $~lib/util/memory/memcpy (; 30 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + local.get $2 + end + if + block + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + end + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + block + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + block + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + block + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + block + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 31 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $1 + local.get $2 + i32.add + local.get $0 + i32.le_u + local.tee $5 + if (result i32) + local.get $5 + else + local.get $0 + local.get $2 + i32.add + local.get $1 + i32.le_u + end + if + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $0 + i32.const 7 + i32.and + if + block + local.get $2 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $2 + i32.const 8 + i32.ge_u + if + block + local.get $0 + local.get $1 + i64.load + i64.store + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $2 + if + block + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + end + br $continue|2 + end + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $0 + local.get $2 + i32.add + i32.const 7 + i32.and + if + block + local.get $2 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + end + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $2 + i32.const 8 + i32.ge_u + if + block + local.get $2 + i32.const 8 + i32.sub + local.set $2 + local.get $0 + local.get $2 + i32.add + local.get $1 + local.get $2 + i32.add + i64.load + i64.store + end + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $2 + if + local.get $0 + local.get $2 + i32.const 1 + i32.sub + local.tee $2 + i32.add + local.get $1 + local.get $2 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/allocator/arena/__mem_free (; 32 ;) (type $FUNCSIG$vi) (param $0 i32) + nop + ) + (func $~lib/memory/memory.free (; 33 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + call $~lib/allocator/arena/__mem_free + ) + (func $~lib/runtime/runtime.reallocate (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + local.set $2 + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + local.get $1 + i32.lt_u + if + local.get $1 + call $~lib/runtime/runtime.adjust + local.set $4 + local.get $3 + call $~lib/runtime/runtime.adjust + i32.const 0 + local.get $0 + global.get $~lib/memory/HEAP_BASE + i32.gt_u + select + local.get $4 + i32.lt_u + if + local.get $4 + call $~lib/memory/memory.allocate + local.set $5 + local.get $5 + local.get $2 + i32.load + i32.store + local.get $5 + i32.const 0 + i32.store offset=8 + local.get $5 + i32.const 0 + i32.store offset=12 + local.get $5 + global.get $~lib/runtime/HEADER_SIZE + i32.add + local.set $6 + local.get $6 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $1 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $2 + i32.load + global.get $~lib/runtime/HEADER_MAGIC + i32.eq + if + local.get $0 + global.get $~lib/memory/HEAP_BASE + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 107 + i32.const 10 + call $~lib/env/abort + unreachable + end + local.get $2 + call $~lib/memory/memory.free + else + local.get $0 + call $gc/_dummy/__ref_register + end + local.get $5 + local.set $2 + local.get $6 + local.set $0 + else + local.get $0 + local.get $3 + i32.add + i32.const 0 + local.get $1 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + end + else + nop + end + local.get $2 + local.get $1 + i32.store offset=4 + local.get $0 + ) + (func $~lib/runtime/runtime.discard (; 35 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + global.get $~lib/memory/HEAP_BASE + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 132 + i32.const 6 + call $~lib/env/abort + unreachable + end + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + local.set $1 + local.get $1 + i32.load + global.get $~lib/runtime/HEADER_MAGIC + i32.eq + i32.eqz + if + i32.const 0 + i32.const 24 + i32.const 134 + i32.const 6 + call $~lib/env/abort + unreachable + end + local.get $1 + call $~lib/memory/memory.free + ) + (func $~lib/runtime/runtime.makeArray (; 36 ;) (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) + (local $8 i32) + (local $9 i32) + i32.const 16 + call $~lib/runtime/runtime.allocate + local.get $1 + call $~lib/runtime/runtime.register + local.set $4 + local.get $0 + local.get $2 + i32.shl + local.set $5 + local.get $0 + local.get $2 + i32.shl + call $~lib/runtime/runtime.allocate + i32.const 5 + call $~lib/runtime/runtime.register + local.set $6 + local.get $4 + local.tee $7 + local.get $6 + local.tee $8 + local.get $7 + i32.load + local.tee $9 + i32.ne + if (result i32) + local.get $9 + if + local.get $9 + local.get $7 + call $gc/_dummy/__ref_unlink + end + local.get $8 + local.get $7 + call $gc/_dummy/__ref_link + local.get $8 + else + local.get $8 + end + i32.store + local.get $4 + local.get $6 + i32.store offset=4 + local.get $4 + local.get $5 + i32.store offset=8 + local.get $4 + local.get $0 + i32.store offset=12 + local.get $3 + if + local.get $6 + local.get $3 + local.get $5 + call $~lib/memory/memory.copy + end + local.get $4 + ) + (func $start (; 37 ;) (type $FUNCSIG$v) global.get $~lib/memory/HEAP_BASE i32.const 7 i32.add @@ -1370,6 +3011,30 @@ call $~lib/set/Set#constructor global.set $~lib/gc/GC_ROOT ) - (func $null (; 31 ;) (type $FUNCSIG$v) + (func $null (; 38 ;) (type $FUNCSIG$v) + ) + (func $~lib/runtime/runtime.makeArray|trampoline (; 39 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + block $1of1 + block $0of1 + block $outOfRange + global.get $~lib/argc + i32.const 3 + i32.sub + br_table $0of1 $1of1 $outOfRange + end + unreachable + end + i32.const 0 + local.set $3 + end + local.get $0 + local.get $1 + local.get $2 + local.get $3 + call $~lib/runtime/runtime.makeArray + ) + (func $~lib/setargc (; 40 ;) (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 ddb3eb33..17e8b604 100644 --- a/tests/compiler/gc/global-assign.optimized.wat +++ b/tests/compiler/gc/global-assign.optimized.wat @@ -93,7 +93,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.allocate (; 3 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 16 call $~lib/allocator/arena/__mem_allocate @@ -133,7 +133,7 @@ local.get $0 global.set $gc/_dummy/register_ref ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 152 @@ -141,8 +141,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -156,8 +156,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -173,8 +173,8 @@ global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset - call $~lib/runtime/allocate - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + call $~lib/runtime/runtime.register global.set $gc/global-assign/global global.get $gc/global-assign/global global.set $gc/global-assign/globalRef @@ -207,8 +207,8 @@ call $~lib/env/abort unreachable end - call $~lib/runtime/allocate - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + call $~lib/runtime/runtime.register global.set $gc/global-assign/global global.get $gc/_dummy/register_count i32.const 2 diff --git a/tests/compiler/gc/global-assign.untouched.wat b/tests/compiler/gc/global-assign.untouched.wat index 3855c7c7..ec6c1281 100644 --- a/tests/compiler/gc/global-assign.untouched.wat +++ b/tests/compiler/gc/global-assign.untouched.wat @@ -37,7 +37,7 @@ (export "table" (table $0)) (export "main" (func $gc/global-assign/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -133,10 +133,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -177,7 +177,7 @@ local.get $0 global.set $gc/_dummy/register_ref ) - (func $~lib/runtime/register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -186,8 +186,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -203,8 +203,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -220,9 +220,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/gc/global-init.optimized.wat b/tests/compiler/gc/global-init.optimized.wat index 19f0472c..afe176a7 100644 --- a/tests/compiler/gc/global-init.optimized.wat +++ b/tests/compiler/gc/global-init.optimized.wat @@ -92,7 +92,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.allocate (; 3 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 16 call $~lib/allocator/arena/__mem_allocate @@ -132,7 +132,7 @@ local.get $0 global.set $gc/_dummy/register_ref ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 148 @@ -140,8 +140,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -155,8 +155,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -172,8 +172,8 @@ global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset - call $~lib/runtime/allocate - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + call $~lib/runtime/runtime.register global.set $gc/global-init/global global.get $gc/_dummy/register_count i32.const 1 @@ -204,8 +204,8 @@ call $~lib/env/abort unreachable end - call $~lib/runtime/allocate - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + call $~lib/runtime/runtime.register global.set $gc/global-init/global global.get $gc/_dummy/register_count i32.const 2 diff --git a/tests/compiler/gc/global-init.untouched.wat b/tests/compiler/gc/global-init.untouched.wat index c25cf7eb..5b418b44 100644 --- a/tests/compiler/gc/global-init.untouched.wat +++ b/tests/compiler/gc/global-init.untouched.wat @@ -36,7 +36,7 @@ (export "table" (table $0)) (export "main" (func $gc/global-init/main)) (export ".capabilities" (global $~lib/capabilities)) - (func $~lib/runtime/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -132,10 +132,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -176,7 +176,7 @@ local.get $0 global.set $gc/_dummy/register_ref ) - (func $~lib/runtime/register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -185,8 +185,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -202,8 +202,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -219,9 +219,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/gc/itcm/trace.optimized.wat b/tests/compiler/gc/itcm/trace.optimized.wat index 3d64b6aa..92fe62ac 100644 --- a/tests/compiler/gc/itcm/trace.optimized.wat +++ b/tests/compiler/gc/itcm/trace.optimized.wat @@ -65,7 +65,7 @@ (data (i32.const 1384) "\01\00\00\00\1e") (data (i32.const 1400) "#\00 \00a\00r\00r\00[\000\00]\00 \00=\00 \00n\00u\00l\00l") (table $0 10 funcref) - (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/collector/itcm/step~anonymous|0 $~lib/collector/itcm/step~anonymous|1 $~lib/collector/itcm/step~anonymous|0 $gc/itcm/trace/Ref~iterate $~lib/string/String~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate) + (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/collector/itcm/step~anonymous|0 $~lib/collector/itcm/step~anonymous|1 $~lib/collector/itcm/step~anonymous|0 $gc/itcm/trace/Ref~iterate $~lib/string/String~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate) (global $~lib/collector/itcm/state (mut i32) (i32.const 0)) (global $~lib/collector/itcm/fromSpace (mut i32) (i32.const 0)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) @@ -609,7 +609,7 @@ end end ) - (func $~lib/runtime/allocate (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -675,7 +675,7 @@ local.get $0 call $~lib/collector/itcm/ManagedObjectList#push ) - (func $~lib/runtime/register (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 1432 @@ -683,8 +683,8 @@ if i32.const 0 i32.const 1056 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -698,8 +698,8 @@ if i32.const 0 i32.const 1056 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -921,7 +921,7 @@ end end ) - (func $~lib/runtime/ArrayBufferView~iterate (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/arraybuffer/ArrayBufferView~iterate (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i32.load local.tee $0 @@ -971,24 +971,24 @@ call $~lib/collector/itcm/ManagedObject#makeGray end ) - (func $~lib/runtime/ArrayBufferView#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 i32.const 4 call $~lib/memory/memory.fill local.get $1 i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $1 local.get $0 i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2103,7 +2103,7 @@ end end ) - (func $~lib/runtime/reallocate (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -2170,8 +2170,8 @@ if i32.const 0 i32.const 1056 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -2211,7 +2211,7 @@ local.get $0 i32.load local.tee $2 - call $~lib/runtime/reallocate + call $~lib/runtime/runtime.reallocate local.set $1 local.get $1 local.get $2 @@ -2293,9 +2293,9 @@ f64.const 0 call $~lib/env/trace i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -2310,10 +2310,10 @@ f64.const 0 call $~lib/env/trace i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/runtime/runtime.register + call $~lib/arraybuffer/ArrayBufferView#constructor local.tee $0 i32.const 0 i32.store offset=12 diff --git a/tests/compiler/gc/itcm/trace.untouched.wat b/tests/compiler/gc/itcm/trace.untouched.wat index 6a84fd72..d5c8e7ae 100644 --- a/tests/compiler/gc/itcm/trace.untouched.wat +++ b/tests/compiler/gc/itcm/trace.untouched.wat @@ -39,7 +39,7 @@ (data (i32.const 1336) "\01\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 1384) "\01\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00#\00 \00a\00r\00r\00[\000\00]\00 \00=\00 \00n\00u\00l\00l\00") (table $0 10 funcref) - (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/collector/itcm/step~anonymous|0 $~lib/collector/itcm/step~anonymous|1 $~lib/collector/itcm/step~anonymous|2 $gc/itcm/trace/Ref~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate) + (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/collector/itcm/step~anonymous|0 $~lib/collector/itcm/step~anonymous|1 $~lib/collector/itcm/step~anonymous|2 $gc/itcm/trace/Ref~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate) (global $gc/itcm/trace/GC_TRACE i32 (i32.const 1)) (global $~lib/runtime/HEADER_SIZE i32 (i32.const 16)) (global $~lib/gc/gc.implemented i32 (i32.const 1)) @@ -53,7 +53,7 @@ (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) (global $gc/itcm/trace/ref (mut i32) (i32.const 0)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/argc (mut i32) (i32.const 0)) (global $gc/itcm/trace/arr (mut i32) (i32.const 0)) (global $~lib/started (mut i32) (i32.const 0)) @@ -740,7 +740,7 @@ (func $~lib/gc/gc.collect (; 20 ;) (type $FUNCSIG$v) call $~lib/collector/itcm/__ref_collect ) - (func $~lib/runtime/ADJUSTOBLOCK (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -752,10 +752,10 @@ i32.sub i32.shl ) - (func $~lib/runtime/allocate (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -816,7 +816,7 @@ local.get $2 call $~lib/collector/itcm/ManagedObjectList#push ) - (func $~lib/runtime/register (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -825,8 +825,8 @@ if i32.const 0 i32.const 1056 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -842,8 +842,8 @@ if i32.const 0 i32.const 1056 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -859,9 +859,9 @@ i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1131,38 +1131,29 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 i32.const 1208 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 6 - call $~lib/runtime/register - end + local.get $2 + i32.const 6 + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/ArrayBufferView~iterate (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/arraybuffer/ArrayBufferView~iterate (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 i32.load @@ -1222,21 +1213,21 @@ call $~lib/collector/itcm/ManagedObject#makeGray end ) - (func $~lib/runtime/ArrayBufferView#constructor (; 32 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 32 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u if i32.const 0 - i32.const 1056 - i32.const 236 - i32.const 57 + i32.const 1208 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -1252,9 +1243,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1348,13 +1339,13 @@ local.get $0 else i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 i32.const 0 @@ -2796,7 +2787,7 @@ end end ) - (func $~lib/runtime/reallocate (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2814,10 +2805,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust local.set $4 local.get $3 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -2867,8 +2858,8 @@ if i32.const 0 i32.const 1056 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -2915,7 +2906,7 @@ i32.gt_u if local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u @@ -2923,7 +2914,7 @@ i32.const 0 i32.const 1352 i32.const 13 - i32.const 64 + i32.const 72 call $~lib/env/abort unreachable end @@ -2934,15 +2925,9 @@ local.get $2 i32.shl local.set $4 - block $~lib/runtime/REALLOCATE|inlined.0 (result i32) - local.get $3 - local.set $6 - local.get $4 - local.set $5 - local.get $6 - local.get $5 - call $~lib/runtime/reallocate - end + local.get $3 + local.get $4 + call $~lib/runtime/runtime.reallocate local.set $5 local.get $5 local.get $3 diff --git a/tests/compiler/gc/rc/global-assign.optimized.wat b/tests/compiler/gc/rc/global-assign.optimized.wat index 92f2f955..800c6b02 100644 --- a/tests/compiler/gc/rc/global-assign.optimized.wat +++ b/tests/compiler/gc/rc/global-assign.optimized.wat @@ -98,7 +98,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.allocate (; 3 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 16 call $~lib/allocator/arena/__mem_allocate @@ -135,7 +135,7 @@ local.get $0 global.set $gc/rc/_dummy/register_ref ) - (func $~lib/runtime/register (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 236 @@ -143,8 +143,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -158,8 +158,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -211,8 +211,8 @@ global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset - call $~lib/runtime/allocate - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + call $~lib/runtime/runtime.register local.tee $0 call $gc/rc/_dummy/__ref_retain local.get $0 @@ -261,8 +261,8 @@ call $~lib/env/abort unreachable end - call $~lib/runtime/allocate - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + call $~lib/runtime/runtime.register local.set $0 local.get $0 global.get $gc/rc/global-assign/global diff --git a/tests/compiler/gc/rc/global-assign.untouched.wat b/tests/compiler/gc/rc/global-assign.untouched.wat index 70952dc5..96d6bc28 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/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -132,10 +132,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -171,7 +171,7 @@ local.get $0 global.set $gc/rc/_dummy/register_ref ) - (func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -180,8 +180,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -197,8 +197,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -214,9 +214,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/gc/rc/global-init.optimized.wat b/tests/compiler/gc/rc/global-init.optimized.wat index 9d4e47c4..533bec63 100644 --- a/tests/compiler/gc/rc/global-init.optimized.wat +++ b/tests/compiler/gc/rc/global-init.optimized.wat @@ -94,7 +94,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.allocate (; 3 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 16 call $~lib/allocator/arena/__mem_allocate @@ -131,7 +131,7 @@ local.get $0 global.set $gc/rc/_dummy/register_ref ) - (func $~lib/runtime/register (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 192 @@ -139,8 +139,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -154,8 +154,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -189,8 +189,8 @@ global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset - call $~lib/runtime/allocate - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + call $~lib/runtime/runtime.register local.tee $0 call $gc/rc/_dummy/__ref_retain local.get $0 diff --git a/tests/compiler/gc/rc/global-init.untouched.wat b/tests/compiler/gc/rc/global-init.untouched.wat index e36d384b..85af655f 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/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -130,10 +130,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -169,7 +169,7 @@ local.get $0 global.set $gc/rc/_dummy/register_ref ) - (func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -178,8 +178,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -195,8 +195,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -212,9 +212,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/getter-call.optimized.wat b/tests/compiler/getter-call.optimized.wat index 63396690..cf2a5171 100644 --- a/tests/compiler/getter-call.optimized.wat +++ b/tests/compiler/getter-call.optimized.wat @@ -77,7 +77,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/register (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 48 @@ -85,8 +85,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -100,8 +100,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -126,7 +126,7 @@ local.get $0 i32.const 8 i32.add - call $~lib/runtime/register + call $~lib/runtime/runtime.register drop i32.const 0 global.set $~lib/argc diff --git a/tests/compiler/getter-call.untouched.wat b/tests/compiler/getter-call.untouched.wat index 3bc9afc1..ae1eeea1 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/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -116,10 +116,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -132,7 +132,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 5 ;) (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 global.get $~lib/memory/HEAP_BASE @@ -141,8 +141,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -158,8 +158,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -173,9 +173,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/inlining.optimized.wat b/tests/compiler/inlining.optimized.wat index 59d17ecf..5291219c 100644 --- a/tests/compiler/inlining.optimized.wat +++ b/tests/compiler/inlining.optimized.wat @@ -102,7 +102,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -123,7 +123,7 @@ i32.const 8 i32.add ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 80 @@ -131,8 +131,8 @@ if i32.const 0 i32.const 48 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -146,8 +146,8 @@ if i32.const 0 i32.const 48 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -159,16 +159,16 @@ (func $inlining/test_ctor (; 7 ;) (type $FUNCSIG$v) (local $0 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/inlining.untouched.wat b/tests/compiler/inlining.untouched.wat index dd25148d..c59c4bb2 100644 --- a/tests/compiler/inlining.untouched.wat +++ b/tests/compiler/inlining.untouched.wat @@ -284,7 +284,7 @@ unreachable end ) - (func $~lib/runtime/ADJUSTOBLOCK (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -380,10 +380,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -396,7 +396,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -405,8 +405,8 @@ if i32.const 0 i32.const 48 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -422,8 +422,8 @@ if i32.const 0 i32.const 48 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -449,9 +449,9 @@ local.get $1 else i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.set $3 i32.const 2 @@ -461,9 +461,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $3 end local.get $3 diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index 2b849b70..c340505a 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -164,7 +164,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (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 @@ -295,7 +295,7 @@ i32.store16 end ) - (func $~lib/runtime/register (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 1804 @@ -303,8 +303,8 @@ if i32.const 0 i32.const 464 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -318,8 +318,8 @@ if i32.const 0 i32.const 464 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -355,7 +355,7 @@ local.tee $3 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $3 @@ -367,7 +367,7 @@ i32.store16 end local.get $2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/string/compareImpl (; 7 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -2358,7 +2358,7 @@ if i32.const 0 i32.const 1648 - i32.const 189 + i32.const 190 i32.const 4 call $~lib/env/abort unreachable @@ -2434,7 +2434,7 @@ return end local.get $3 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 local.get $2 @@ -2442,17 +2442,17 @@ local.get $3 call $~lib/memory/memory.copy local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/discard (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 1804 i32.le_u if i32.const 0 i32.const 464 - i32.const 177 - i32.const 4 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -2465,8 +2465,8 @@ if i32.const 0 i32.const 464 - i32.const 179 - i32.const 4 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end @@ -2492,7 +2492,7 @@ unreachable end i32.const 56 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $0 call $~lib/util/number/dtoa_core local.set $1 @@ -2501,7 +2501,7 @@ call $~lib/string/String#substring local.set $1 local.get $0 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $1 i32.const 1696 call $~lib/string/String.__eq diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 5b44b8a6..ccdb1731 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -135,7 +135,7 @@ unreachable unreachable ) - (func $~lib/runtime/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -231,10 +231,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -390,7 +390,7 @@ i32.store16 end ) - (func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -399,8 +399,8 @@ if i32.const 0 i32.const 464 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -416,8 +416,8 @@ if i32.const 0 i32.const 464 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -455,40 +455,32 @@ local.get $1 i32.add local.set $2 - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $2 - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/runtime/allocate - end - local.set $4 + local.get $2 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $3 block $~lib/util/number/utoa32_core|inlined.0 - local.get $4 + local.get $3 local.set $6 local.get $0 local.set $5 local.get $2 - local.set $3 + local.set $4 local.get $6 local.get $5 - local.get $3 + local.get $4 call $~lib/util/number/utoa32_lut end local.get $1 if - local.get $4 + local.get $3 i32.const 45 i32.store16 end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.0 (result i32) - local.get $4 - local.set $3 - local.get $3 - i32.const 1 - call $~lib/runtime/register - end + local.get $3 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -3424,7 +3416,7 @@ if i32.const 0 i32.const 1648 - i32.const 189 + i32.const 190 i32.const 4 call $~lib/env/abort unreachable @@ -3513,12 +3505,8 @@ local.get $0 return end - block $~lib/runtime/ALLOCATE|inlined.2 (result i32) - local.get $3 - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $3 + call $~lib/runtime/runtime.allocate local.set $10 local.get $10 local.get $0 @@ -3526,13 +3514,9 @@ i32.add local.get $3 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.1 (result i32) - local.get $10 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $10 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/allocator/arena/__mem_free (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) nop @@ -3541,7 +3525,7 @@ local.get $0 call $~lib/allocator/arena/__mem_free ) - (func $~lib/runtime/discard (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 26 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -3550,8 +3534,8 @@ if i32.const 0 i32.const 464 - i32.const 177 - i32.const 4 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -3567,8 +3551,8 @@ if i32.const 0 i32.const 464 - i32.const 179 - i32.const 4 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end @@ -3579,7 +3563,6 @@ (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 f64.const 0 f64.eq @@ -3605,31 +3588,23 @@ select return end - block $~lib/runtime/ALLOCATE|inlined.1 (result i32) - i32.const 28 - i32.const 1 - i32.shl - local.set $1 - local.get $1 - call $~lib/runtime/allocate - end - local.set $2 - local.get $2 + i32.const 28 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $1 + local.get $1 local.get $0 call $~lib/util/number/dtoa_core - local.set $3 - local.get $2 + local.set $2 + local.get $1 i32.const 0 - local.get $3 + local.get $2 call $~lib/string/String#substring - local.set $4 - block $~lib/runtime/DISCARD|inlined.0 - local.get $2 - local.set $1 - local.get $1 - call $~lib/runtime/discard - end - local.get $4 + local.set $3 + local.get $1 + call $~lib/runtime/runtime.discard + local.get $3 ) (func $~lib/number/F64#toString (; 28 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 diff --git a/tests/compiler/optional-typeparameters.optimized.wat b/tests/compiler/optional-typeparameters.optimized.wat index 841a73e2..a3b86ad0 100644 --- a/tests/compiler/optional-typeparameters.optimized.wat +++ b/tests/compiler/optional-typeparameters.optimized.wat @@ -78,7 +78,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 8 call $~lib/allocator/arena/__mem_allocate @@ -92,7 +92,7 @@ i32.const 8 i32.add ) - (func $~lib/runtime/register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 48 @@ -100,8 +100,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -115,8 +115,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -130,13 +130,13 @@ global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register global.set $optional-typeparameters/tConcrete - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register global.set $optional-typeparameters/tDerived ) (func $null (; 5 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat index ebc66d12..f818dffe 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/ADJUSTOBLOCK (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -123,10 +123,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -139,7 +139,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -148,8 +148,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -165,8 +165,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -180,9 +180,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -197,9 +197,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index c1ffc30d..7e9cbe25 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -142,7 +142,7 @@ if i32.const 0 i32.const 64 - i32.const 164 + i32.const 165 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index 84d5818a..931b163f 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -218,7 +218,7 @@ if i32.const 0 i32.const 64 - i32.const 164 + i32.const 165 i32.const 4 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 4a9ecb2b..4f65a23d 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -156,7 +156,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -183,7 +183,7 @@ i32.const 16 i32.add ) - (func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 328 @@ -191,8 +191,8 @@ if i32.const 0 i32.const 296 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -206,8 +206,8 @@ if i32.const 0 i32.const 296 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -216,21 +216,21 @@ i32.store local.get $0 ) - (func $~lib/runtime/makeArray (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.get $0 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 i32.const 3 local.get $1 i32.shl local.tee $1 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $2 local.tee $3 local.get $0 @@ -253,9 +253,9 @@ ) (func $std/array-literal/Ref#constructor (; 9 ;) (type $FUNCSIG$i) (result i32) i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array~iterate (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) @@ -296,9 +296,9 @@ ) (func $std/array-literal/RefWithCtor#constructor (; 11 ;) (type $FUNCSIG$i) (result i32) i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $start:std/array-literal (; 12 ;) (type $FUNCSIG$v) (local $0 i32) @@ -418,7 +418,7 @@ global.set $~lib/allocator/arena/offset i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $2 i32.load offset=4 local.tee $0 @@ -496,7 +496,7 @@ global.set $std/array-literal/i i32.const 5 i32.const 2 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $2 i32.load offset=4 local.tee $0 @@ -572,7 +572,7 @@ end i32.const 8 i32.const 2 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $2 i32.load offset=4 local.tee $0 @@ -600,7 +600,7 @@ end i32.const 11 i32.const 2 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray 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 c9df2d90..6c90a78f 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -126,7 +126,7 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $~lib/runtime/ADJUSTOBLOCK (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -222,10 +222,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -247,7 +247,7 @@ (func $~lib/collector/dummy/__ref_register (; 15 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/register (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -256,8 +256,8 @@ if i32.const 0 i32.const 296 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -273,8 +273,8 @@ if i32.const 0 i32.const 296 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -1723,7 +1723,7 @@ end end ) - (func $~lib/runtime/makeArray (; 21 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 21 ;) (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) @@ -1731,9 +1731,9 @@ (local $8 i32) (local $9 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $4 local.get $0 local.get $2 @@ -1742,9 +1742,9 @@ local.get $0 local.get $2 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $6 local.get $4 local.tee $7 @@ -1794,9 +1794,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1859,9 +1859,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2058,7 +2058,7 @@ i32.const 2 i32.const 0 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $0 local.get $0 i32.load offset=4 @@ -2151,7 +2151,7 @@ i32.const 5 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $1 local.get $1 i32.load offset=4 @@ -2242,7 +2242,7 @@ i32.const 8 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $0 local.get $0 i32.load offset=4 @@ -2301,7 +2301,7 @@ i32.const 11 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray 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 4b393a5e..870cc646 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -26,10 +26,10 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (memory $0 1) - (data (i32.const 8) "\01\00\00\00\1e") - (data (i32.const 24) "~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 56) "\01\00\00\00&") - (data (i32.const 72) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 8) "\01\00\00\00&") + (data (i32.const 24) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 64) "\01\00\00\00\1e") + (data (i32.const 80) "~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") (data (i32.const 112) "\01\00\00\00\06") (data (i32.const 128) "a\00b\00c") (data (i32.const 136) "\01\00\00\00\18") @@ -403,7 +403,7 @@ (data (i32.const 8040) "\02\00\00\00\04") (data (i32.const 8056) "\01") (table $0 102 funcref) - (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/string/String~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/string/String~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|2 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|16 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $start:std/array~anonymous|47 $~lib/array/Array>~iterate $~lib/string/String~iterate $~lib/array/Array>~iterate $start:std/array~anonymous|48 $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/array/Array>~iterate $~lib/array/Array>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/string/String~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate) + (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/string/String~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/string/String~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|2 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|16 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $start:std/array~anonymous|47 $~lib/array/Array>~iterate $~lib/string/String~iterate $~lib/array/Array>~iterate $start:std/array~anonymous|48 $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/array/Array>~iterate $~lib/array/Array>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/string/String~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) @@ -530,7 +530,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -782,16 +782,16 @@ end end ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 8060 i32.le_u if i32.const 0 - i32.const 24 - i32.const 153 - i32.const 4 + i32.const 80 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -804,9 +804,9 @@ i32.ne if i32.const 0 - i32.const 24 - i32.const 155 - i32.const 4 + i32.const 80 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -822,23 +822,23 @@ i32.gt_u if i32.const 0 - i32.const 72 - i32.const 25 - i32.const 43 + i32.const 24 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end local.get $0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 i32.const 0 local.get $0 call $~lib/memory/memory.fill local.get $1 i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/ArrayBufferView~iterate (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/arraybuffer/ArrayBufferView~iterate (; 8 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i32.load local.tee $0 @@ -848,7 +848,7 @@ call_indirect (type $FUNCSIG$vi) end ) - (func $~lib/runtime/ArrayBufferView#constructor (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1073741808 local.get $2 @@ -857,8 +857,8 @@ if i32.const 0 i32.const 24 - i32.const 236 - i32.const 57 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -872,9 +872,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -911,12 +911,12 @@ (func $~lib/array/Array#constructor (; 11 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register i32.const 0 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.tee $0 i32.const 0 i32.store offset=12 @@ -2031,21 +2031,21 @@ end end ) - (func $~lib/runtime/makeArray (; 15 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 15 ;) (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/allocate + call $~lib/runtime/runtime.allocate local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $1 local.get $0 local.get $2 i32.shl local.tee $4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $2 local.set $5 local.get $1 @@ -2283,7 +2283,7 @@ end i32.const 1 ) - (func $~lib/runtime/reallocate (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2360,9 +2360,9 @@ i32.le_u if i32.const 0 - i32.const 24 - i32.const 117 - i32.const 8 + i32.const 80 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -2404,7 +2404,7 @@ i32.const 0 i32.const 272 i32.const 13 - i32.const 64 + i32.const 72 call $~lib/env/abort unreachable end @@ -2415,7 +2415,7 @@ i32.const 2 i32.shl local.tee $3 - call $~lib/runtime/reallocate + call $~lib/runtime/runtime.reallocate local.set $1 local.get $1 local.get $2 @@ -2509,7 +2509,7 @@ i32.const 4 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $4 i32.load offset=4 local.tee $5 @@ -2936,7 +2936,7 @@ i32.const 4 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $4 i32.load offset=4 drop @@ -3427,7 +3427,7 @@ i32.const 34 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $4 i32.load offset=4 local.set $5 @@ -3517,7 +3517,7 @@ i32.const 4 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.load offset=4 local.set $5 loop $repeat|0 @@ -3591,7 +3591,7 @@ i32.const 4 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $4 local.get $0 i32.load offset=12 @@ -5338,7 +5338,7 @@ i32.const 0 i32.const 272 i32.const 43 - i32.const 62 + i32.const 70 call $~lib/env/abort unreachable end @@ -5346,7 +5346,7 @@ i32.const 4 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 i32.const 0 @@ -5580,7 +5580,7 @@ i32.const 68 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 i32.const 0 @@ -5877,7 +5877,7 @@ i32.const 71 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 i32.const 0 @@ -5901,9 +5901,9 @@ i32.lt_s if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 72 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $2 i32.const 511 local.get $0 @@ -6206,7 +6206,7 @@ i32.const 78 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 i32.const 0 @@ -6231,7 +6231,7 @@ return end i32.const 2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 i32.const 1 @@ -6242,7 +6242,7 @@ i32.store16 local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String#concat (; 123 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -6278,7 +6278,7 @@ return end local.get $2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $1 @@ -6291,7 +6291,7 @@ call $~lib/memory/memory.copy local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String.__concat (; 124 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -6369,7 +6369,7 @@ if i32.const 0 i32.const 4376 - i32.const 189 + i32.const 190 i32.const 4 call $~lib/env/abort unreachable @@ -6445,7 +6445,7 @@ return end local.get $3 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 local.get $2 @@ -6454,17 +6454,17 @@ call $~lib/memory/memory.copy local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/discard (; 128 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 128 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 8060 i32.le_u if i32.const 0 - i32.const 24 - i32.const 177 - i32.const 4 + i32.const 80 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -6476,9 +6476,9 @@ i32.ne if i32.const 0 - i32.const 24 - i32.const 179 - i32.const 4 + i32.const 80 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end @@ -6530,7 +6530,7 @@ local.tee $7 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $2 i32.const 0 local.set $0 @@ -6627,13 +6627,13 @@ call $~lib/string/String#substring local.set $0 local.get $2 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/decimalCount32 (; 130 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -6826,7 +6826,7 @@ local.tee $3 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $3 @@ -6839,7 +6839,7 @@ end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa_stream (; 133 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 @@ -6930,7 +6930,7 @@ local.tee $7 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $2 i32.const 0 local.set $0 @@ -6995,13 +6995,13 @@ call $~lib/string/String#substring local.set $0 local.get $2 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 135 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -7022,14 +7022,14 @@ local.tee $1 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $1 call $~lib/util/number/utoa32_lut local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa_stream (; 137 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 @@ -7100,7 +7100,7 @@ local.tee $7 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $2 i32.const 0 local.set $0 @@ -7165,13 +7165,13 @@ call $~lib/string/String#substring local.set $0 local.get $2 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 139 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -8172,7 +8172,7 @@ return end i32.const 56 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 call $~lib/util/number/dtoa_core @@ -8182,7 +8182,7 @@ call $~lib/string/String#substring local.set $1 local.get $2 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $1 ) (func $~lib/util/number/dtoa_stream (; 144 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) @@ -8299,7 +8299,7 @@ local.tee $6 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 i32.const 0 local.set $0 @@ -8364,13 +8364,13 @@ call $~lib/string/String#substring local.set $0 local.get $1 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/string/String>#join_str (; 146 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -8452,7 +8452,7 @@ i32.add i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $2 i32.const 0 local.set $3 @@ -8540,7 +8540,7 @@ end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/string/String>#join (; 147 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -8549,9 +8549,9 @@ ) (func $std/array/Ref#constructor (; 148 ;) (type $FUNCSIG$i) (result i32) i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 87 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join_ref (; 149 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -8594,7 +8594,7 @@ local.tee $6 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 i32.const 0 local.set $0 @@ -8678,13 +8678,13 @@ call $~lib/string/String#substring local.set $0 local.get $1 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#toString (; 150 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -8789,7 +8789,7 @@ local.tee $6 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 i32.const 0 local.set $0 @@ -8850,13 +8850,13 @@ call $~lib/string/String#substring local.set $0 local.get $1 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa_stream (; 153 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 @@ -8931,7 +8931,7 @@ local.tee $6 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 i32.const 0 local.set $0 @@ -8996,13 +8996,13 @@ call $~lib/string/String#substring local.set $0 local.get $1 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/decimalCount64 (; 155 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 @@ -9176,7 +9176,7 @@ local.tee $3 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $1 local.get $3 @@ -9187,7 +9187,7 @@ local.tee $1 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $1 @@ -9195,7 +9195,7 @@ end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa_stream (; 158 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) @@ -9280,7 +9280,7 @@ local.tee $6 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 i32.const 0 local.set $0 @@ -9345,13 +9345,13 @@ call $~lib/string/String#substring local.set $0 local.get $1 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa64 (; 160 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) @@ -9389,7 +9389,7 @@ local.tee $4 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $3 local.get $2 local.get $4 @@ -9402,7 +9402,7 @@ local.tee $2 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $3 local.get $0 local.get $2 @@ -9416,7 +9416,7 @@ end local.get $3 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa_stream (; 161 ;) (type $FUNCSIG$iiij) (param $0 i32) (param $1 i32) (param $2 i64) (result i32) (local $3 i32) @@ -9524,7 +9524,7 @@ local.tee $6 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 i32.const 0 local.set $0 @@ -9589,13 +9589,13 @@ call $~lib/string/String#substring local.set $0 local.get $1 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/string/String | null>#toString (; 163 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -9770,7 +9770,7 @@ local.tee $6 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 i32.const 0 local.set $0 @@ -9831,13 +9831,13 @@ call $~lib/string/String#substring local.set $0 local.get $1 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $0 return end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/array/Array>#join_arr (; 167 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -10191,17 +10191,17 @@ unreachable end i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register drop i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register i32.const 1 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor drop global.get $std/array/arr8 i32.const 1 @@ -10213,7 +10213,7 @@ i32.const 8 i32.const 0 i32.const 248 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/array/isArraysEqual i32.eqz if @@ -10234,7 +10234,7 @@ i32.const 8 i32.const 0 i32.const 320 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/array/isArraysEqual i32.eqz if @@ -10255,7 +10255,7 @@ i32.const 8 i32.const 0 i32.const 344 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/array/isArraysEqual i32.eqz if @@ -10276,7 +10276,7 @@ i32.const 8 i32.const 0 i32.const 368 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/array/isArraysEqual i32.eqz if @@ -10297,7 +10297,7 @@ i32.const 8 i32.const 0 i32.const 392 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/array/isArraysEqual i32.eqz if @@ -10318,7 +10318,7 @@ i32.const 10 i32.const 2 i32.const 488 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10340,7 +10340,7 @@ i32.const 10 i32.const 2 i32.const 528 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10362,7 +10362,7 @@ i32.const 10 i32.const 2 i32.const 568 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10384,7 +10384,7 @@ i32.const 10 i32.const 2 i32.const 608 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10406,7 +10406,7 @@ i32.const 10 i32.const 2 i32.const 648 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -10755,7 +10755,7 @@ i32.const 4 i32.const 2 i32.const 688 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#concat drop global.get $std/array/arr @@ -11014,7 +11014,7 @@ i32.const 4 i32.const 2 i32.const 752 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -11025,7 +11025,7 @@ i32.const 4 i32.const 2 i32.const 792 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11041,7 +11041,7 @@ i32.const 4 i32.const 2 i32.const 832 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -11052,7 +11052,7 @@ i32.const 4 i32.const 2 i32.const 872 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11068,7 +11068,7 @@ i32.const 4 i32.const 2 i32.const 912 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -11079,7 +11079,7 @@ i32.const 4 i32.const 2 i32.const 952 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11095,7 +11095,7 @@ i32.const 4 i32.const 2 i32.const 992 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 2 @@ -11106,7 +11106,7 @@ i32.const 4 i32.const 2 i32.const 1032 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11122,7 +11122,7 @@ i32.const 4 i32.const 2 i32.const 1072 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -11133,7 +11133,7 @@ i32.const 4 i32.const 2 i32.const 1112 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11149,7 +11149,7 @@ i32.const 4 i32.const 2 i32.const 1152 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -11160,7 +11160,7 @@ i32.const 4 i32.const 2 i32.const 1192 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11176,7 +11176,7 @@ i32.const 4 i32.const 2 i32.const 1232 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -11187,7 +11187,7 @@ i32.const 4 i32.const 2 i32.const 1272 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11203,7 +11203,7 @@ i32.const 4 i32.const 2 i32.const 1312 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -11214,7 +11214,7 @@ i32.const 4 i32.const 2 i32.const 1352 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11230,7 +11230,7 @@ i32.const 4 i32.const 2 i32.const 1392 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -11241,7 +11241,7 @@ i32.const 4 i32.const 2 i32.const 1432 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11257,7 +11257,7 @@ i32.const 4 i32.const 2 i32.const 1472 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -11268,7 +11268,7 @@ i32.const 4 i32.const 2 i32.const 1512 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11284,7 +11284,7 @@ i32.const 4 i32.const 2 i32.const 1552 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -11295,7 +11295,7 @@ i32.const 4 i32.const 2 i32.const 1592 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -11311,7 +11311,7 @@ i32.const 4 i32.const 2 i32.const 1632 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -11322,7 +11322,7 @@ i32.const 4 i32.const 2 i32.const 1672 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12150,7 +12150,7 @@ i32.const 4 i32.const 2 i32.const 1784 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12167,7 +12167,7 @@ i32.const 4 i32.const 2 i32.const 1824 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12183,7 +12183,7 @@ i32.const 4 i32.const 2 i32.const 1840 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 @@ -12193,7 +12193,7 @@ i32.const 4 i32.const 2 i32.const 1880 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12210,7 +12210,7 @@ i32.const 4 i32.const 2 i32.const 1912 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12226,7 +12226,7 @@ i32.const 4 i32.const 2 i32.const 1936 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 @@ -12236,7 +12236,7 @@ i32.const 4 i32.const 2 i32.const 1976 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12253,7 +12253,7 @@ i32.const 4 i32.const 2 i32.const 2000 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12269,7 +12269,7 @@ i32.const 4 i32.const 2 i32.const 2032 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 0 @@ -12279,7 +12279,7 @@ i32.const 4 i32.const 2 i32.const 2072 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12296,7 +12296,7 @@ i32.const 4 i32.const 2 i32.const 2096 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12312,7 +12312,7 @@ i32.const 4 i32.const 2 i32.const 2128 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -1 @@ -12322,7 +12322,7 @@ i32.const 4 i32.const 2 i32.const 2168 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12339,7 +12339,7 @@ i32.const 4 i32.const 2 i32.const 2192 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12355,7 +12355,7 @@ i32.const 4 i32.const 2 i32.const 2224 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 @@ -12365,7 +12365,7 @@ i32.const 4 i32.const 2 i32.const 2264 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12382,7 +12382,7 @@ i32.const 4 i32.const 2 i32.const 2288 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12398,7 +12398,7 @@ i32.const 4 i32.const 2 i32.const 2320 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 @@ -12408,7 +12408,7 @@ i32.const 4 i32.const 2 i32.const 2360 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12425,7 +12425,7 @@ i32.const 4 i32.const 2 i32.const 2384 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12441,7 +12441,7 @@ i32.const 4 i32.const 2 i32.const 2416 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -7 @@ -12451,7 +12451,7 @@ i32.const 4 i32.const 2 i32.const 2456 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12468,7 +12468,7 @@ i32.const 4 i32.const 2 i32.const 2480 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12484,7 +12484,7 @@ i32.const 4 i32.const 2 i32.const 2512 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 @@ -12494,7 +12494,7 @@ i32.const 4 i32.const 2 i32.const 2552 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12511,7 +12511,7 @@ i32.const 4 i32.const 2 i32.const 2568 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12527,7 +12527,7 @@ i32.const 4 i32.const 2 i32.const 2608 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 1 @@ -12537,7 +12537,7 @@ i32.const 4 i32.const 2 i32.const 2648 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12554,7 +12554,7 @@ i32.const 4 i32.const 2 i32.const 2664 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12570,7 +12570,7 @@ i32.const 4 i32.const 2 i32.const 2704 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 4 @@ -12580,7 +12580,7 @@ i32.const 4 i32.const 2 i32.const 2744 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12597,7 +12597,7 @@ i32.const 4 i32.const 2 i32.const 2760 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12613,7 +12613,7 @@ i32.const 4 i32.const 2 i32.const 2800 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 @@ -12623,7 +12623,7 @@ i32.const 4 i32.const 2 i32.const 2840 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12640,7 +12640,7 @@ i32.const 4 i32.const 2 i32.const 2856 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12656,7 +12656,7 @@ i32.const 4 i32.const 2 i32.const 2896 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 @@ -12666,7 +12666,7 @@ i32.const 4 i32.const 2 i32.const 2936 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -12683,7 +12683,7 @@ i32.const 4 i32.const 2 i32.const 2952 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13787,7 +13787,7 @@ i32.const 34 i32.const 2 i32.const 3304 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/array/isArraysEqual i32.eqz if @@ -13823,7 +13823,7 @@ i32.const 58 i32.const 3 i32.const 3464 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/array/isArraysEqual i32.eqz if @@ -13860,7 +13860,7 @@ i32.const 4 i32.const 2 i32.const 3616 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13898,7 +13898,7 @@ i32.const 10 i32.const 2 i32.const 3728 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13934,7 +13934,7 @@ i32.const 4 i32.const 2 i32.const 4056 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -13953,7 +13953,7 @@ i32.const 4 i32.const 2 i32.const 4080 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -14114,7 +14114,7 @@ i32.const 81 i32.const 0 i32.const 4552 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#join_bool i32.const 4576 call $~lib/string/String.__eq @@ -14131,7 +14131,7 @@ i32.const 4 i32.const 2 i32.const 5120 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 4200 call $~lib/array/Array#join i32.const 5152 @@ -14149,7 +14149,7 @@ i32.const 10 i32.const 2 i32.const 5240 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 5216 call $~lib/array/Array#join i32.const 5152 @@ -14167,7 +14167,7 @@ i32.const 4 i32.const 2 i32.const 5320 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 5296 call $~lib/array/Array#join i32.const 5344 @@ -14185,7 +14185,7 @@ i32.const 58 i32.const 3 i32.const 6672 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#join_flt i32.const 6736 call $~lib/string/String.__eq @@ -14202,7 +14202,7 @@ i32.const 78 i32.const 2 i32.const 6888 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 4200 call $~lib/array/Array<~lib/string/String>#join i32.const 6832 @@ -14220,7 +14220,7 @@ i32.const 88 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $1 i32.load offset=4 local.tee $0 @@ -14303,7 +14303,7 @@ i32.const 90 i32.const 0 i32.const 7128 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#join_int i32.const 7152 call $~lib/string/String.__eq @@ -14320,7 +14320,7 @@ i32.const 92 i32.const 1 i32.const 7208 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#join_int i32.const 7232 call $~lib/string/String.__eq @@ -14337,7 +14337,7 @@ i32.const 83 i32.const 3 i32.const 7312 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#join_int i32.const 7352 call $~lib/string/String.__eq @@ -14354,7 +14354,7 @@ i32.const 94 i32.const 3 i32.const 7464 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#join_int i32.const 7512 call $~lib/string/String.__eq @@ -14384,7 +14384,7 @@ i32.const 78 i32.const 2 i32.const 7744 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array<~lib/string/String | null>#toString i32.const 7776 call $~lib/string/String.__eq @@ -14401,7 +14401,7 @@ i32.const 68 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 local.tee $1 @@ -14409,14 +14409,14 @@ i32.const 4 i32.const 2 i32.const 7832 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.store local.get $1 i32.const 2 i32.const 4 i32.const 2 i32.const 7856 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.store offset=4 local.get $0 global.set $std/array/subarr32 @@ -14437,7 +14437,7 @@ i32.const 96 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 local.tee $1 @@ -14445,14 +14445,14 @@ i32.const 8 i32.const 0 i32.const 7936 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.store local.get $1 i32.const 2 i32.const 8 i32.const 0 i32.const 7960 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.store offset=4 local.get $0 global.set $std/array/subarr8 @@ -14473,7 +14473,7 @@ i32.const 100 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $0 i32.load offset=4 local.set $1 @@ -14481,14 +14481,14 @@ i32.const 98 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.tee $2 i32.load offset=4 i32.const 1 i32.const 10 i32.const 2 i32.const 8056 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray 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 09f40665..6fdba93e 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -29,8 +29,8 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (memory $0 1) - (data (i32.const 8) "\01\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 56) "\01\00\00\00&\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\01\00\00\00&\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 64) "\01\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") (data (i32.const 112) "\01\00\00\00\06\00\00\00\00\00\00\00\00\00\00\00a\00b\00c\00") (data (i32.const 136) "\01\00\00\00\18\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 176) "\02\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\01\02\03\04\05") @@ -222,9 +222,9 @@ (data (i32.const 8016) "\02\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00") (data (i32.const 8040) "\02\00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00") (table $0 102 funcref) - (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/array/P~iterate $~lib/typedarray/Uint8Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|4 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|18 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|30 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|34 $start:std/array~anonymous|35 $start:std/array~anonymous|36 $start:std/array~anonymous|37 $start:std/array~anonymous|38 $start:std/array~anonymous|39 $start:std/array~anonymous|40 $start:std/array~anonymous|41 $start:std/array~anonymous|42 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $start:std/array~anonymous|47 $~lib/array/Array>~iterate $std/array/Proxy~iterate $~lib/array/Array>~iterate $start:std/array~anonymous|48 $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/array/Array<~lib/string/String>~iterate $~lib/array/Array<~lib/string/String>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/array/Ref~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate) + (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/array/P~iterate $~lib/typedarray/Uint8Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|4 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|18 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $~lib/array/Array~iterate $~lib/array/Array~iterate $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|30 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|34 $start:std/array~anonymous|35 $start:std/array~anonymous|36 $start:std/array~anonymous|37 $start:std/array~anonymous|38 $start:std/array~anonymous|39 $start:std/array~anonymous|40 $start:std/array~anonymous|41 $start:std/array~anonymous|42 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $start:std/array~anonymous|47 $~lib/array/Array>~iterate $std/array/Proxy~iterate $~lib/array/Array>~iterate $start:std/array~anonymous|48 $~lib/array/Array<~lib/string/String | null>~iterate $~lib/array/Array<~lib/string/String | null>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/array/Array<~lib/string/String>~iterate $~lib/array/Array<~lib/string/String>~iterate $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/array/Ref~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate $~lib/array/Array<~lib/array/Array<~lib/array/Array>>~iterate) (global $~lib/runtime/HEADER_SIZE i32 (i32.const 16)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) @@ -300,7 +300,7 @@ (func $~lib/string/String~iterate (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) ) - (func $~lib/runtime/ADJUSTOBLOCK (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -396,10 +396,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -681,7 +681,7 @@ (func $~lib/collector/dummy/__ref_register (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/register (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -689,9 +689,9 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 153 - i32.const 4 + i32.const 80 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -706,9 +706,9 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 155 - i32.const 4 + i32.const 80 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -721,38 +721,29 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 - i32.const 72 - i32.const 25 - i32.const 43 + i32.const 24 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 2 - call $~lib/runtime/register - end + local.get $2 + i32.const 2 + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/ArrayBufferView~iterate (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/arraybuffer/ArrayBufferView~iterate (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 i32.load @@ -772,21 +763,21 @@ (func $~lib/collector/dummy/__ref_unlink (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/ArrayBufferView#constructor (; 15 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 15 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u if i32.const 0 i32.const 24 - i32.const 236 - i32.const 57 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -802,9 +793,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -862,13 +853,13 @@ local.get $0 else i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 i32.const 0 @@ -905,9 +896,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -926,7 +917,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Uint8Array#constructor (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -934,13 +925,13 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) @@ -2490,7 +2481,7 @@ end end ) - (func $~lib/runtime/makeArray (; 32 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 32 ;) (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) @@ -2498,9 +2489,9 @@ (local $8 i32) (local $9 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $4 local.get $0 local.get $2 @@ -2509,9 +2500,9 @@ local.get $0 local.get $2 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $6 local.get $4 local.tee $7 @@ -2849,7 +2840,7 @@ local.get $0 call $~lib/allocator/arena/__mem_free ) - (func $~lib/runtime/reallocate (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2867,10 +2858,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust local.set $4 local.get $3 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -2919,9 +2910,9 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 117 - i32.const 8 + i32.const 80 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -2968,7 +2959,7 @@ i32.gt_u if local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u @@ -2976,7 +2967,7 @@ i32.const 0 i32.const 272 i32.const 13 - i32.const 64 + i32.const 72 call $~lib/env/abort unreachable end @@ -2987,15 +2978,9 @@ local.get $2 i32.shl local.set $4 - block $~lib/runtime/REALLOCATE|inlined.0 (result i32) - local.get $3 - local.set $6 - local.get $4 - local.set $5 - local.get $6 - local.get $5 - call $~lib/runtime/reallocate - end + local.get $3 + local.get $4 + call $~lib/runtime/runtime.reallocate local.set $5 local.get $5 local.get $3 @@ -3127,8 +3112,6 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) local.get $0 i32.load offset=12 local.set $2 @@ -3140,34 +3123,28 @@ i32.eq select local.set $3 - block $~lib/runtime/MAKEARRAY|inlined.0 (result i32) - local.get $2 - local.get $3 - i32.add - local.set $5 - i32.const 0 - local.set $4 - local.get $5 - i32.const 4 - i32.const 2 - local.get $4 - call $~lib/runtime/makeArray - end - local.set $6 - local.get $6 + local.get $2 + local.get $3 + i32.add + i32.const 4 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $4 + local.get $4 i32.load offset=4 - local.set $7 + local.set $5 local.get $2 i32.const 2 i32.shl - local.set $8 - local.get $7 + local.set $6 + local.get $5 local.get $0 i32.load offset=4 - local.get $8 + local.get $6 call $~lib/memory/memory.copy - local.get $7 - local.get $8 + local.get $5 + local.get $6 i32.add local.get $1 i32.load offset=4 @@ -3175,7 +3152,7 @@ i32.const 2 i32.shl call $~lib/memory/memory.copy - local.get $6 + local.get $4 ) (func $~lib/array/Array#copyWithin (; 55 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) @@ -3694,17 +3671,11 @@ i32.gt_s select local.set $2 - block $~lib/runtime/MAKEARRAY|inlined.1 (result i32) - local.get $2 - local.set $5 - i32.const 0 - local.set $4 - local.get $5 - i32.const 4 - i32.const 2 - local.get $4 - call $~lib/runtime/makeArray - end + local.get $2 + i32.const 4 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray local.set $6 local.get $6 i32.load offset=4 @@ -4288,32 +4259,26 @@ local.get $0 i32.load offset=12 local.set $2 - block $~lib/runtime/MAKEARRAY|inlined.0 (result i32) - local.get $2 - local.set $4 - i32.const 0 - local.set $3 - local.get $4 - i32.const 34 - i32.const 2 - local.get $3 - call $~lib/runtime/makeArray - end - local.set $5 - local.get $5 + local.get $2 + i32.const 34 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $3 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 local.get $2 - local.tee $4 + local.tee $6 local.get $0 i32.load offset=12 local.tee $7 - local.get $4 + local.get $6 local.get $7 i32.lt_s select @@ -4323,38 +4288,38 @@ block local.get $0 i32.load offset=4 - local.get $3 + local.get $5 i32.const 2 i32.shl i32.add i32.load - local.set $4 - local.get $6 - local.get $3 + local.set $6 + local.get $4 + local.get $5 i32.const 2 i32.shl i32.add block (result f32) i32.const 3 global.set $~lib/argc - local.get $4 - local.get $3 + local.get $6 + local.get $5 local.get $0 local.get $1 call_indirect (type $FUNCSIG$fiii) end f32.store end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $5 + local.get $3 ) (func $~lib/array/Array#get:length (; 93 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -4409,32 +4374,26 @@ local.get $0 i32.load offset=12 local.set $2 - block $~lib/runtime/MAKEARRAY|inlined.2 (result i32) - local.get $2 - local.set $4 - i32.const 0 - local.set $3 - local.get $4 - i32.const 4 - i32.const 2 - local.get $3 - call $~lib/runtime/makeArray - end - local.set $5 - local.get $5 + local.get $2 + i32.const 4 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $3 + local.get $3 i32.load offset=4 - local.set $6 + local.set $4 block $break|0 i32.const 0 - local.set $3 + local.set $5 loop $repeat|0 - local.get $3 + local.get $5 local.get $2 - local.tee $4 + local.tee $6 local.get $0 i32.load offset=12 local.tee $7 - local.get $4 + local.get $6 local.get $7 i32.lt_s select @@ -4444,38 +4403,38 @@ block local.get $0 i32.load offset=4 - local.get $3 + local.get $5 i32.const 2 i32.shl i32.add i32.load - local.set $4 - local.get $6 - local.get $3 + local.set $6 + local.get $4 + local.get $5 i32.const 2 i32.shl i32.add block (result i32) i32.const 3 global.set $~lib/argc - local.get $4 - local.get $3 + local.get $6 + local.get $5 local.get $0 local.get $1 call_indirect (type $FUNCSIG$iiii) end i32.store end - local.get $3 + local.get $5 i32.const 1 i32.add - local.set $3 + local.set $5 br $repeat|0 unreachable end unreachable end - local.get $5 + local.get $3 ) (func $start:std/array~anonymous|23 (; 98 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) global.get $std/array/i @@ -4505,29 +4464,23 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/runtime/MAKEARRAY|inlined.3 (result i32) - i32.const 0 - local.set $3 - i32.const 0 - local.set $2 - local.get $3 - i32.const 4 - i32.const 2 - local.get $2 - call $~lib/runtime/makeArray - end - local.set $4 + i32.const 0 + i32.const 4 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $2 block $break|0 block i32.const 0 - local.set $2 + local.set $3 local.get $0 i32.load offset=12 - local.set $3 + local.set $4 end loop $repeat|0 - local.get $2 local.get $3 + local.get $4 local.tee $5 local.get $0 i32.load offset=12 @@ -4542,7 +4495,7 @@ block local.get $0 i32.load offset=4 - local.get $2 + local.get $3 i32.const 2 i32.shl i32.add @@ -4552,7 +4505,7 @@ i32.const 3 global.set $~lib/argc local.get $5 - local.get $2 + local.get $3 local.get $0 local.get $1 call_indirect (type $FUNCSIG$iiii) @@ -4560,22 +4513,22 @@ i32.const 0 i32.ne if - local.get $4 + local.get $2 local.get $5 call $~lib/array/Array#push drop end end - local.get $2 + local.get $3 i32.const 1 i32.add - local.set $2 + local.set $3 br $repeat|0 unreachable end unreachable end - local.get $4 + local.get $2 ) (func $start:std/array~anonymous|26 (; 102 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $2 @@ -7296,10 +7249,8 @@ ) (func $~lib/array/Array.create (; 154 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.const 2 i32.shr_u i32.gt_u @@ -7307,32 +7258,26 @@ i32.const 0 i32.const 272 i32.const 43 - i32.const 62 + i32.const 70 call $~lib/env/abort unreachable end - block $~lib/runtime/MAKEARRAY|inlined.4 (result i32) - local.get $0 - local.set $2 - i32.const 0 - local.set $1 - local.get $2 - i32.const 4 - i32.const 2 - local.get $1 - call $~lib/runtime/makeArray - end - local.set $3 - local.get $3 + local.get $0 + i32.const 4 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $1 + local.get $1 i32.load offset=4 i32.const 0 - local.get $3 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $3 + local.get $1 i32.const 0 i32.store offset=12 - local.get $3 + local.get $1 ) (func $std/array/createReverseOrderedArray (; 155 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -7604,10 +7549,8 @@ ) (func $~lib/array/Array.create<~lib/array/Array> (; 167 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.const 2 i32.shr_u i32.gt_u @@ -7615,32 +7558,26 @@ i32.const 0 i32.const 272 i32.const 43 - i32.const 62 + i32.const 70 call $~lib/env/abort unreachable end - block $~lib/runtime/MAKEARRAY<~lib/array/Array>|inlined.0 (result i32) - local.get $0 - local.set $2 - i32.const 0 - local.set $1 - local.get $2 - i32.const 68 - i32.const 2 - local.get $1 - call $~lib/runtime/makeArray - end - local.set $3 - local.get $3 + local.get $0 + i32.const 68 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $1 + local.get $1 i32.load offset=4 i32.const 0 - local.get $3 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $3 + local.get $1 i32.const 0 i32.store offset=12 - local.get $3 + local.get $1 ) (func $~lib/array/Array<~lib/array/Array>#__unchecked_set (; 168 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -8094,10 +8031,8 @@ ) (func $~lib/array/Array.create> (; 181 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.const 2 i32.shr_u i32.gt_u @@ -8105,41 +8040,35 @@ i32.const 0 i32.const 272 i32.const 43 - i32.const 62 + i32.const 70 call $~lib/env/abort unreachable end - block $~lib/runtime/MAKEARRAY>|inlined.0 (result i32) - local.get $0 - local.set $2 - i32.const 0 - local.set $1 - local.get $2 - i32.const 71 - i32.const 2 - local.get $1 - call $~lib/runtime/makeArray - end - local.set $3 - local.get $3 + local.get $0 + i32.const 71 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $1 + local.get $1 i32.load offset=4 i32.const 0 - local.get $3 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $3 + local.get $1 i32.const 0 i32.store offset=12 - local.get $3 + local.get $1 ) (func $std/array/Proxy#constructor (; 182 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 i32.eqz if i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 72 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -9161,10 +9090,8 @@ ) (func $~lib/array/Array.create<~lib/string/String> (; 210 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) local.get $0 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.const 2 i32.shr_u i32.gt_u @@ -9172,36 +9099,29 @@ i32.const 0 i32.const 272 i32.const 43 - i32.const 62 + i32.const 70 call $~lib/env/abort unreachable end - block $~lib/runtime/MAKEARRAY<~lib/string/String>|inlined.0 (result i32) - local.get $0 - local.set $2 - i32.const 0 - local.set $1 - local.get $2 - i32.const 78 - i32.const 2 - local.get $1 - call $~lib/runtime/makeArray - end - local.set $3 - local.get $3 + local.get $0 + i32.const 78 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $1 + local.get $1 i32.load offset=4 i32.const 0 - local.get $3 + local.get $1 i32.load offset=8 call $~lib/memory/memory.fill - local.get $3 + local.get $1 i32.const 0 i32.store offset=12 - local.get $3 + local.get $1 ) (func $~lib/string/String#charAt (; 211 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 i32.const 0 i32.ne @@ -9209,7 +9129,7 @@ if i32.const 0 i32.const 4376 - i32.const 39 + i32.const 40 i32.const 4 call $~lib/env/abort unreachable @@ -9222,14 +9142,10 @@ i32.const 4200 return end - block $~lib/runtime/ALLOCATE|inlined.1 (result i32) - i32.const 2 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + i32.const 2 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 local.get $0 local.get $1 i32.const 1 @@ -9237,20 +9153,15 @@ i32.add i32.load16_u i32.store16 - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 1 - call $~lib/runtime/register - end + local.get $2 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String#concat (; 212 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $1 i32.const 0 i32.eq @@ -9279,30 +9190,22 @@ i32.const 4200 return end - block $~lib/runtime/ALLOCATE|inlined.2 (result i32) - local.get $4 - local.set $5 - local.get $5 - call $~lib/runtime/allocate - end - local.set $6 - local.get $6 + local.get $4 + call $~lib/runtime/runtime.allocate + local.set $5 + local.get $5 local.get $0 local.get $2 call $~lib/memory/memory.copy - local.get $6 + local.get $5 local.get $2 i32.add local.get $1 local.get $3 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.1 (result i32) - local.get $6 - local.set $5 - local.get $5 - i32.const 1 - call $~lib/runtime/register - end + local.get $5 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String.__concat (; 213 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -9856,7 +9759,7 @@ if i32.const 0 i32.const 4376 - i32.const 189 + i32.const 190 i32.const 4 call $~lib/env/abort unreachable @@ -9945,12 +9848,8 @@ local.get $0 return end - block $~lib/runtime/ALLOCATE|inlined.4 (result i32) - local.get $3 - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $3 + call $~lib/runtime/runtime.allocate local.set $10 local.get $10 local.get $0 @@ -9958,15 +9857,11 @@ i32.add local.get $3 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.2 (result i32) - local.get $10 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $10 + i32.const 1 + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/discard (; 229 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 229 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -9974,9 +9869,9 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 177 - i32.const 4 + i32.const 80 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -9991,9 +9886,9 @@ i32.eqz if i32.const 0 - i32.const 24 - i32.const 179 - i32.const 4 + i32.const 80 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end @@ -10010,7 +9905,6 @@ (local $8 i32) (local $9 i32) (local $10 i32) - (local $11 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -10051,47 +9945,43 @@ local.get $5 i32.add local.set $6 - block $~lib/runtime/ALLOCATE|inlined.3 (result i32) - local.get $6 - i32.const 1 - i32.shl - local.set $7 - local.get $7 - call $~lib/runtime/allocate - end - local.set $8 + local.get $6 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $7 i32.const 0 - local.set $9 + local.set $8 block $break|0 i32.const 0 - local.set $7 + local.set $10 loop $repeat|0 - local.get $7 + local.get $10 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $7 + local.get $10 i32.add i32.load8_u - local.set $10 + local.set $9 i32.const 4 - local.get $10 + local.get $9 i32.const 0 i32.ne i32.eqz i32.add local.set $5 + local.get $7 local.get $8 - local.get $9 i32.const 1 i32.shl i32.add i32.const 4472 i32.const 4496 - local.get $10 + local.get $9 i32.const 0 i32.ne select @@ -10099,14 +9989,14 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $9 + local.get $8 local.get $5 i32.add - local.set $9 + local.set $8 local.get $4 if + local.get $7 local.get $8 - local.get $9 i32.const 1 i32.shl i32.add @@ -10115,16 +10005,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $9 + local.get $8 local.get $4 i32.add - local.set $9 + local.set $8 end end - local.get $7 + local.get $10 i32.const 1 i32.add - local.set $7 + local.set $10 br $repeat|0 unreachable end @@ -10134,22 +10024,22 @@ local.get $2 i32.add i32.load8_u - local.set $10 + local.set $9 i32.const 4 - local.get $10 + local.get $9 i32.const 0 i32.ne i32.eqz i32.add local.set $5 + local.get $7 local.get $8 - local.get $9 i32.const 1 i32.shl i32.add i32.const 4472 i32.const 4496 - local.get $10 + local.get $9 i32.const 0 i32.ne select @@ -10157,35 +10047,27 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $9 + local.get $8 local.get $5 i32.add - local.set $9 + local.set $8 local.get $6 - local.get $9 + local.get $8 i32.gt_s if - local.get $8 - i32.const 0 - local.get $9 - call $~lib/string/String#substring - local.set $7 - block $~lib/runtime/DISCARD|inlined.0 - local.get $8 - local.set $11 - local.get $11 - call $~lib/runtime/discard - end local.get $7 + i32.const 0 + local.get $8 + call $~lib/string/String#substring + local.set $10 + local.get $7 + call $~lib/runtime/runtime.discard + local.get $10 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.3 (result i32) - local.get $8 - local.set $7 - local.get $7 - i32.const 1 - call $~lib/runtime/register - end + local.get $7 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 231 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -10434,40 +10316,32 @@ local.get $1 i32.add local.set $2 - block $~lib/runtime/ALLOCATE|inlined.5 (result i32) - local.get $2 - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/runtime/allocate - end - local.set $4 + local.get $2 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $3 block $~lib/util/number/utoa32_core|inlined.0 - local.get $4 + local.get $3 local.set $6 local.get $0 local.set $5 local.get $2 - local.set $3 + local.set $4 local.get $6 local.get $5 - local.get $3 + local.get $4 call $~lib/util/number/utoa32_lut end local.get $1 if - local.get $4 + local.get $3 i32.const 45 i32.store16 end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.4 (result i32) - local.get $4 - local.set $3 - local.get $3 - i32.const 1 - call $~lib/runtime/register - end + local.get $3 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa (; 235 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -10542,7 +10416,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -10577,45 +10450,41 @@ i32.const 11 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.6 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 2 i32.shl i32.add i32.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -10624,16 +10493,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -10645,39 +10514,31 @@ i32.shl i32.add i32.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.1 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.5 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 238 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -10700,34 +10561,26 @@ local.get $0 call $~lib/util/number/decimalCount32 local.set $1 - block $~lib/runtime/ALLOCATE|inlined.7 (result i32) - local.get $1 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 + local.get $1 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $2 block $~lib/util/number/utoa32_core|inlined.2 - local.get $3 + local.get $2 local.set $5 local.get $0 local.set $4 local.get $1 - local.set $2 + local.set $3 local.get $5 local.get $4 - local.get $2 + local.get $3 call $~lib/util/number/utoa32_lut end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.6 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 1 - call $~lib/runtime/register - end + local.get $2 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa (; 240 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -10782,7 +10635,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -10817,45 +10669,41 @@ i32.const 10 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.8 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 2 i32.shl i32.add i32.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -10864,16 +10712,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -10885,39 +10733,31 @@ i32.shl i32.add i32.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.2 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.7 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 243 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -12312,7 +12152,6 @@ (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 f64.const 0 f64.eq @@ -12338,31 +12177,23 @@ select return end - block $~lib/runtime/ALLOCATE|inlined.9 (result i32) - i32.const 28 - i32.const 1 - i32.shl - local.set $1 - local.get $1 - call $~lib/runtime/allocate - end - local.set $2 - local.get $2 + i32.const 28 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $1 + local.get $1 local.get $0 call $~lib/util/number/dtoa_core - local.set $3 - local.get $2 + local.set $2 + local.get $1 i32.const 0 - local.get $3 + local.get $2 call $~lib/string/String#substring - local.set $4 - block $~lib/runtime/DISCARD|inlined.3 - local.get $2 - local.set $1 - local.get $1 - call $~lib/runtime/discard - end - local.get $4 + local.set $3 + local.get $1 + call $~lib/runtime/runtime.discard + local.get $3 ) (func $~lib/util/number/dtoa_stream (; 253 ;) (type $FUNCSIG$iiid) (param $0 i32) (param $1 i32) (param $2 f64) (result i32) (local $3 i32) @@ -12445,9 +12276,8 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 f64) - (local $10 i32) + (local $8 f64) + (local $9 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -12482,45 +12312,41 @@ i32.const 28 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.10 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 3 i32.shl i32.add f64.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/dtoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -12529,16 +12355,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -12550,39 +12376,31 @@ i32.shl i32.add f64.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/dtoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.4 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.8 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 255 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -12672,18 +12490,14 @@ end i32.const 0 local.set $9 - block $~lib/runtime/ALLOCATE|inlined.11 (result i32) - local.get $5 - local.get $4 - local.get $2 - i32.mul - i32.add - i32.const 1 - i32.shl - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end + local.get $5 + local.get $4 + local.get $2 + i32.mul + i32.add + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $10 block $break|1 i32.const 0 @@ -12774,13 +12588,9 @@ i32.shl call $~lib/memory/memory.copy end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.9 (result i32) - local.get $10 - local.set $8 - local.get $8 - i32.const 1 - call $~lib/runtime/register - end + local.get $10 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/string/String>#join (; 257 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -12796,9 +12606,9 @@ i32.eqz if i32.const 0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 87 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -12861,7 +12671,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -12894,38 +12703,34 @@ i32.const 15 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.12 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 2 i32.shl i32.add i32.load - local.set $9 - local.get $9 + local.set $8 + local.get $8 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -12934,15 +12739,15 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 i32.const 15 i32.add - local.set $8 + local.set $7 end local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -12951,16 +12756,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -12973,8 +12778,8 @@ i32.add i32.load if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -12983,36 +12788,28 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 i32.const 15 i32.add - local.set $8 + local.set $7 end local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.5 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.10 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 262 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -13126,7 +12923,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -13161,45 +12957,41 @@ i32.const 11 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.13 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 0 i32.shl i32.add i32.load8_s - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -13208,16 +13000,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -13229,39 +13021,31 @@ i32.shl i32.add i32.load8_s - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.6 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.11 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 268 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -13343,7 +13127,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -13378,45 +13161,41 @@ i32.const 10 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.14 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 1 i32.shl i32.add i32.load16_u - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -13425,16 +13204,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -13446,39 +13225,31 @@ i32.shl i32.add i32.load16_u - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.7 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.12 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 274 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -13713,14 +13484,10 @@ local.get $2 call $~lib/util/number/decimalCount32 local.set $3 - block $~lib/runtime/ALLOCATE|inlined.15 (result i32) - local.get $3 - i32.const 1 - i32.shl - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $3 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $1 block $~lib/util/number/utoa32_core|inlined.8 local.get $1 @@ -13738,14 +13505,10 @@ local.get $0 call $~lib/util/number/decimalCount64 local.set $3 - block $~lib/runtime/ALLOCATE|inlined.16 (result i32) - local.get $3 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end + local.get $3 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $1 block $~lib/util/number/utoa64_core|inlined.0 local.get $1 @@ -13760,13 +13523,9 @@ call $~lib/util/number/utoa64_lut end end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.13 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.const 1 - call $~lib/runtime/register - end + local.get $1 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa (; 279 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 @@ -13846,9 +13605,8 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) + (local $8 i64) + (local $9 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -13883,45 +13641,41 @@ i32.const 20 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.17 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 3 i32.shl i32.add i64.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -13930,16 +13684,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -13951,39 +13705,31 @@ i32.shl i32.add i64.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.8 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.14 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 282 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -14043,14 +13789,10 @@ local.get $1 i32.add local.set $4 - block $~lib/runtime/ALLOCATE|inlined.18 (result i32) - local.get $4 - i32.const 1 - i32.shl - local.set $5 - local.get $5 - call $~lib/runtime/allocate - end + local.get $4 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $2 block $~lib/util/number/utoa32_core|inlined.10 local.get $2 @@ -14070,14 +13812,10 @@ local.get $1 i32.add local.set $4 - block $~lib/runtime/ALLOCATE|inlined.19 (result i32) - local.get $4 - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/runtime/allocate - end + local.get $4 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $2 block $~lib/util/number/utoa64_core|inlined.2 local.get $2 @@ -14098,13 +13836,9 @@ i32.const 45 i32.store16 end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.15 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $2 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa (; 286 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 @@ -14206,9 +13940,8 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) + (local $8 i64) + (local $9 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -14243,45 +13976,41 @@ i32.const 21 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.20 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 3 i32.shl i32.add i64.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -14290,16 +14019,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -14311,39 +14040,31 @@ i32.shl i32.add i64.load - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.9 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.16 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 289 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -14438,18 +14159,14 @@ end i32.const 0 local.set $9 - block $~lib/runtime/ALLOCATE|inlined.21 (result i32) - local.get $5 - local.get $4 - local.get $2 - i32.mul - i32.add - i32.const 1 - i32.shl - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end + local.get $5 + local.get $4 + local.get $2 + i32.mul + i32.add + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $10 block $break|1 i32.const 0 @@ -14540,13 +14257,9 @@ i32.shl call $~lib/memory/memory.copy end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.17 (result i32) - local.get $10 - local.set $8 - local.get $8 - i32.const 1 - call $~lib/runtime/register - end + local.get $10 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/string/String | null>#join (; 292 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -14786,7 +14499,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) - (local $10 i32) local.get $0 i32.load offset=12 i32.const 1 @@ -14821,45 +14533,41 @@ i32.const 10 i32.add local.set $5 - block $~lib/runtime/ALLOCATE|inlined.22 (result i32) - local.get $5 - i32.const 1 - i32.shl - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end - local.set $7 + local.get $5 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $6 i32.const 0 - local.set $8 + local.set $7 block $break|0 i32.const 0 - local.set $6 + local.set $9 loop $repeat|0 - local.get $6 + local.get $9 local.get $2 i32.lt_s i32.eqz br_if $break|0 block local.get $3 - local.get $6 + local.get $9 i32.const 0 i32.shl i32.add i32.load8_u - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $4 if + local.get $6 local.get $7 - local.get $8 i32.const 1 i32.shl i32.add @@ -14868,16 +14576,16 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $8 + local.get $7 local.get $4 i32.add - local.set $8 + local.set $7 end end - local.get $6 + local.get $9 i32.const 1 i32.add - local.set $6 + local.set $9 br $repeat|0 unreachable end @@ -14889,39 +14597,31 @@ i32.shl i32.add i32.load8_u - local.set $9 - local.get $8 + local.set $8 + local.get $7 + local.get $6 local.get $7 local.get $8 - local.get $9 call $~lib/util/number/itoa_stream i32.add - local.set $8 + local.set $7 local.get $5 - local.get $8 + local.get $7 i32.gt_s if - local.get $7 - i32.const 0 - local.get $8 - call $~lib/string/String#substring - local.set $6 - block $~lib/runtime/DISCARD|inlined.10 - local.get $7 - local.set $10 - local.get $10 - call $~lib/runtime/discard - end local.get $6 + i32.const 0 + local.get $7 + call $~lib/string/String#substring + local.set $9 + local.get $6 + call $~lib/runtime/runtime.discard + local.get $9 return end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.18 (result i32) - local.get $7 - local.set $6 - local.get $6 - i32.const 1 - call $~lib/runtime/register - end + local.get $6 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array#join (; 302 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -15473,7 +15173,7 @@ i32.const 8 i32.const 0 i32.const 248 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15496,7 +15196,7 @@ i32.const 8 i32.const 0 i32.const 320 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15519,7 +15219,7 @@ i32.const 8 i32.const 0 i32.const 344 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15542,7 +15242,7 @@ i32.const 8 i32.const 0 i32.const 368 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15565,7 +15265,7 @@ i32.const 8 i32.const 0 i32.const 392 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15588,7 +15288,7 @@ i32.const 10 i32.const 2 i32.const 488 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15611,7 +15311,7 @@ i32.const 10 i32.const 2 i32.const 528 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15634,7 +15334,7 @@ i32.const 10 i32.const 2 i32.const 568 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15657,7 +15357,7 @@ i32.const 10 i32.const 2 i32.const 608 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -15680,7 +15380,7 @@ i32.const 10 i32.const 2 i32.const 648 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16029,7 +15729,7 @@ i32.const 4 i32.const 2 i32.const 688 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#concat drop global.get $std/array/arr @@ -16302,7 +16002,7 @@ i32.const 4 i32.const 2 i32.const 752 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -16313,7 +16013,7 @@ i32.const 4 i32.const 2 i32.const 792 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16329,7 +16029,7 @@ i32.const 4 i32.const 2 i32.const 832 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -16340,7 +16040,7 @@ i32.const 4 i32.const 2 i32.const 872 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16356,7 +16056,7 @@ i32.const 4 i32.const 2 i32.const 912 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -16367,7 +16067,7 @@ i32.const 4 i32.const 2 i32.const 952 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16383,7 +16083,7 @@ i32.const 4 i32.const 2 i32.const 992 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 2 @@ -16394,7 +16094,7 @@ i32.const 4 i32.const 2 i32.const 1032 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16410,7 +16110,7 @@ i32.const 4 i32.const 2 i32.const 1072 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -16421,7 +16121,7 @@ i32.const 4 i32.const 2 i32.const 1112 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16437,7 +16137,7 @@ i32.const 4 i32.const 2 i32.const 1152 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -16448,7 +16148,7 @@ i32.const 4 i32.const 2 i32.const 1192 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16464,7 +16164,7 @@ i32.const 4 i32.const 2 i32.const 1232 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 1 @@ -16475,7 +16175,7 @@ i32.const 4 i32.const 2 i32.const 1272 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16491,7 +16191,7 @@ i32.const 4 i32.const 2 i32.const 1312 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -16502,7 +16202,7 @@ i32.const 4 i32.const 2 i32.const 1352 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16518,7 +16218,7 @@ i32.const 4 i32.const 2 i32.const 1392 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const 0 @@ -16529,7 +16229,7 @@ i32.const 4 i32.const 2 i32.const 1432 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16545,7 +16245,7 @@ i32.const 4 i32.const 2 i32.const 1472 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -16556,7 +16256,7 @@ i32.const 4 i32.const 2 i32.const 1512 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16572,7 +16272,7 @@ i32.const 4 i32.const 2 i32.const 1552 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -16583,7 +16283,7 @@ i32.const 4 i32.const 2 i32.const 1592 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -16599,7 +16299,7 @@ i32.const 4 i32.const 2 i32.const 1632 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/cwArr global.get $std/array/cwArr i32.const -4 @@ -16610,7 +16310,7 @@ i32.const 4 i32.const 2 i32.const 1672 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17474,7 +17174,7 @@ i32.const 4 i32.const 2 i32.const 1784 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17491,7 +17191,7 @@ i32.const 4 i32.const 2 i32.const 1824 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17507,7 +17207,7 @@ i32.const 4 i32.const 2 i32.const 1840 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 @@ -17517,7 +17217,7 @@ i32.const 4 i32.const 2 i32.const 1880 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17534,7 +17234,7 @@ i32.const 4 i32.const 2 i32.const 1912 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17550,7 +17250,7 @@ i32.const 4 i32.const 2 i32.const 1936 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 2 @@ -17560,7 +17260,7 @@ i32.const 4 i32.const 2 i32.const 1976 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17577,7 +17277,7 @@ i32.const 4 i32.const 2 i32.const 2000 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17593,7 +17293,7 @@ i32.const 4 i32.const 2 i32.const 2032 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 0 @@ -17603,7 +17303,7 @@ i32.const 4 i32.const 2 i32.const 2072 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17620,7 +17320,7 @@ i32.const 4 i32.const 2 i32.const 2096 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17636,7 +17336,7 @@ i32.const 4 i32.const 2 i32.const 2128 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -1 @@ -17646,7 +17346,7 @@ i32.const 4 i32.const 2 i32.const 2168 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17663,7 +17363,7 @@ i32.const 4 i32.const 2 i32.const 2192 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17679,7 +17379,7 @@ i32.const 4 i32.const 2 i32.const 2224 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 @@ -17689,7 +17389,7 @@ i32.const 4 i32.const 2 i32.const 2264 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17706,7 +17406,7 @@ i32.const 4 i32.const 2 i32.const 2288 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17722,7 +17422,7 @@ i32.const 4 i32.const 2 i32.const 2320 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 @@ -17732,7 +17432,7 @@ i32.const 4 i32.const 2 i32.const 2360 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17749,7 +17449,7 @@ i32.const 4 i32.const 2 i32.const 2384 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17765,7 +17465,7 @@ i32.const 4 i32.const 2 i32.const 2416 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -7 @@ -17775,7 +17475,7 @@ i32.const 4 i32.const 2 i32.const 2456 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17792,7 +17492,7 @@ i32.const 4 i32.const 2 i32.const 2480 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17808,7 +17508,7 @@ i32.const 4 i32.const 2 i32.const 2512 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const -2 @@ -17818,7 +17518,7 @@ i32.const 4 i32.const 2 i32.const 2552 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17835,7 +17535,7 @@ i32.const 4 i32.const 2 i32.const 2568 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17851,7 +17551,7 @@ i32.const 4 i32.const 2 i32.const 2608 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 1 @@ -17861,7 +17561,7 @@ i32.const 4 i32.const 2 i32.const 2648 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17878,7 +17578,7 @@ i32.const 4 i32.const 2 i32.const 2664 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17894,7 +17594,7 @@ i32.const 4 i32.const 2 i32.const 2704 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 4 @@ -17904,7 +17604,7 @@ i32.const 4 i32.const 2 i32.const 2744 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17921,7 +17621,7 @@ i32.const 4 i32.const 2 i32.const 2760 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17937,7 +17637,7 @@ i32.const 4 i32.const 2 i32.const 2800 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 @@ -17947,7 +17647,7 @@ i32.const 4 i32.const 2 i32.const 2840 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17964,7 +17664,7 @@ i32.const 4 i32.const 2 i32.const 2856 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -17980,7 +17680,7 @@ i32.const 4 i32.const 2 i32.const 2896 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray global.set $std/array/sarr global.get $std/array/sarr i32.const 7 @@ -17990,7 +17690,7 @@ i32.const 4 i32.const 2 i32.const 2936 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -18007,7 +17707,7 @@ i32.const 4 i32.const 2 i32.const 2952 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19209,7 +18909,7 @@ i32.const 34 i32.const 2 i32.const 3304 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19234,7 +18934,7 @@ i32.const 58 i32.const 3 i32.const 3464 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19259,7 +18959,7 @@ i32.const 4 i32.const 2 i32.const 3616 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19284,7 +18984,7 @@ i32.const 10 i32.const 2 i32.const 3728 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19320,7 +19020,7 @@ i32.const 4 i32.const 2 i32.const 4056 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19339,7 +19039,7 @@ i32.const 4 i32.const 2 i32.const 4080 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 0 call $std/array/isArraysEqual i32.eqz @@ -19492,7 +19192,7 @@ i32.const 81 i32.const 0 i32.const 4552 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 4528 call $~lib/array/Array#join i32.const 4576 @@ -19510,7 +19210,7 @@ i32.const 4 i32.const 2 i32.const 5120 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 4200 call $~lib/array/Array#join i32.const 5152 @@ -19528,7 +19228,7 @@ i32.const 10 i32.const 2 i32.const 5240 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 5216 call $~lib/array/Array#join i32.const 5152 @@ -19546,7 +19246,7 @@ i32.const 4 i32.const 2 i32.const 5320 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 5296 call $~lib/array/Array#join i32.const 5344 @@ -19564,7 +19264,7 @@ i32.const 58 i32.const 3 i32.const 6672 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 5472 call $~lib/array/Array#join i32.const 6736 @@ -19582,7 +19282,7 @@ i32.const 78 i32.const 2 i32.const 6888 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray i32.const 4200 call $~lib/array/Array<~lib/string/String>#join i32.const 6832 @@ -19601,7 +19301,7 @@ i32.const 88 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $0 local.get $0 i32.load offset=4 @@ -19720,7 +19420,7 @@ i32.const 90 i32.const 0 i32.const 7128 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#toString i32.const 7152 call $~lib/string/String.__eq @@ -19737,7 +19437,7 @@ i32.const 92 i32.const 1 i32.const 7208 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#toString i32.const 7232 call $~lib/string/String.__eq @@ -19754,7 +19454,7 @@ i32.const 83 i32.const 3 i32.const 7312 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#toString i32.const 7352 call $~lib/string/String.__eq @@ -19771,7 +19471,7 @@ i32.const 94 i32.const 3 i32.const 7464 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array#toString i32.const 7512 call $~lib/string/String.__eq @@ -19801,7 +19501,7 @@ i32.const 78 i32.const 2 i32.const 7744 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $~lib/array/Array<~lib/string/String>#toString i32.const 7776 call $~lib/string/String.__eq @@ -19819,7 +19519,7 @@ i32.const 68 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $1 local.get $1 i32.load offset=4 @@ -19830,7 +19530,7 @@ i32.const 4 i32.const 2 i32.const 7832 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $2 local.get $2 local.get $1 @@ -19844,7 +19544,7 @@ i32.const 4 i32.const 2 i32.const 7856 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $2 local.get $2 local.get $1 @@ -19873,7 +19573,7 @@ i32.const 96 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $0 local.get $0 i32.load offset=4 @@ -19884,7 +19584,7 @@ i32.const 8 i32.const 0 i32.const 7936 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $2 local.get $2 local.get $0 @@ -19898,7 +19598,7 @@ i32.const 8 i32.const 0 i32.const 7960 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $2 local.get $2 local.get $0 @@ -19927,7 +19627,7 @@ i32.const 100 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $0 local.get $0 i32.load offset=4 @@ -19939,7 +19639,7 @@ i32.const 98 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $2 local.get $2 i32.load offset=4 @@ -19950,7 +19650,7 @@ i32.const 10 i32.const 2 i32.const 8056 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray 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 675968f8..8f732502 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -86,7 +86,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -318,7 +318,7 @@ end end ) - (func $~lib/runtime/register (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 200 @@ -326,8 +326,8 @@ if i32.const 0 i32.const 64 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -341,8 +341,8 @@ if i32.const 0 i32.const 64 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -359,19 +359,19 @@ if i32.const 0 i32.const 16 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end local.get $0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 call $~lib/memory/memory.fill local.get $1 i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/memory/memcpy (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -1473,7 +1473,7 @@ i32.gt_s select local.tee $2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $3 local.get $0 local.get $1 @@ -1482,9 +1482,9 @@ call $~lib/memory/memory.copy local.get $3 i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/ArrayBufferView#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) i32.const 1 i32.const 1073741816 @@ -1493,9 +1493,9 @@ i32.gt_u if i32.const 0 - i32.const 64 - i32.const 236 - i32.const 57 + i32.const 16 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -1509,9 +1509,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1534,18 +1534,18 @@ i32.store offset=8 local.get $0 ) - (func $~lib/runtime/makeArray (; 10 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.makeArray (; 10 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $1 i32.store local.get $0 @@ -1589,9 +1589,9 @@ unreachable end i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $1 i32.const 0 i32.store @@ -1806,13 +1806,13 @@ unreachable end i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor global.set $std/arraybuffer/arr8 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray drop global.get $std/arraybuffer/arr8 if (result i32) @@ -1832,11 +1832,11 @@ block $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array>13 (result i32) i32.const 1 i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor br_if $__inlined_func$~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array>13 drop i32.const 0 diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 8b21d815..ce20ab8f 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -16,7 +16,7 @@ (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/runtime/HEADER_SIZE i32 (i32.const 8)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741816)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741816)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) @@ -29,7 +29,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -125,10 +125,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -398,7 +398,7 @@ end end ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -407,8 +407,8 @@ if i32.const 0 i32.const 64 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -424,8 +424,8 @@ if i32.const 0 i32.const 64 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -436,36 +436,27 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 i32.const 16 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 2 - call $~lib/runtime/register - end + local.get $2 + i32.const 2 + call $~lib/runtime/runtime.register ) (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -1975,12 +1966,8 @@ i32.gt_s select local.set $6 - block $~lib/runtime/ALLOCATE|inlined.1 (result i32) - local.get $6 - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $6 + call $~lib/runtime/runtime.allocate local.set $7 local.get $7 local.get $0 @@ -1988,13 +1975,9 @@ i32.add local.get $6 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.1 (result i32) - local.get $7 - local.set $4 - local.get $4 - i32.const 2 - call $~lib/runtime/register - end + local.get $7 + i32.const 2 + call $~lib/runtime/runtime.register ) (func $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array> (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -2034,18 +2017,18 @@ end i32.const 0 ) - (func $~lib/runtime/ArrayBufferView#constructor (; 17 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 17 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u if i32.const 0 - i32.const 64 - i32.const 236 - i32.const 57 + i32.const 16 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -2061,9 +2044,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2093,24 +2076,24 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) - (func $~lib/runtime/makeArray (; 19 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 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/allocate + call $~lib/runtime/runtime.allocate local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $4 local.get $0 local.get $2 @@ -2119,9 +2102,9 @@ local.get $0 local.get $2 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $6 local.get $4 local.get $6 @@ -2150,13 +2133,13 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) @@ -2173,7 +2156,7 @@ local.set $3 end local.get $3 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u local.get $2 local.get $3 @@ -2195,9 +2178,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2259,7 +2242,7 @@ end global.get $std/arraybuffer/buffer i32.const 0 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced @@ -2289,7 +2272,7 @@ end global.get $std/arraybuffer/buffer i32.const 1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced @@ -2307,7 +2290,7 @@ end global.get $std/arraybuffer/buffer i32.const -1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced @@ -2397,7 +2380,7 @@ end global.get $std/arraybuffer/buffer i32.const 42 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH call $~lib/arraybuffer/ArrayBuffer#slice global.set $std/arraybuffer/sliced global.get $std/arraybuffer/sliced @@ -2493,7 +2476,7 @@ i32.const 5 i32.const 2 i32.const 152 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray 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 e6e004fb..38524913 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -15,8 +15,8 @@ (type $FUNCSIG$viji (func (param i32 i64 i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 48) "\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 8) "\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 56) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") (data (i32.const 96) "\01\00\00\00$\00\00\00~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 144) "\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") (data (i32.const 184) "\01\00\00\00\1e\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s") @@ -91,7 +91,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -156,16 +156,16 @@ i32.const 0 i32.store8 ) - (func $~lib/runtime/register (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 224 i32.le_u if i32.const 0 - i32.const 16 - i32.const 153 - i32.const 4 + i32.const 64 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -178,9 +178,9 @@ i32.ne if i32.const 0 - i32.const 16 - i32.const 155 - i32.const 4 + i32.const 64 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -189,23 +189,23 @@ i32.store local.get $0 ) - (func $~lib/runtime/ArrayBufferView#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 call $~lib/memory/memory.fill local.get $1 i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $1 local.get $0 i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -236,7 +236,7 @@ if i32.const 0 i32.const 104 - i32.const 114 + i32.const 115 i32.const 44 call $~lib/env/abort unreachable @@ -285,9 +285,9 @@ unreachable end i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $3 i32.const 0 i32.store @@ -963,10 +963,10 @@ global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/runtime/runtime.register + call $~lib/arraybuffer/ArrayBufferView#constructor global.set $std/dataview/array global.get $std/dataview/array i32.const 0 diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index 16dd9153..713c9b2e 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -15,15 +15,15 @@ (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 48) "\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 56) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") (data (i32.const 96) "\01\00\00\00$\00\00\00~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 144) "\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") (data (i32.const 184) "\01\00\00\00\1e\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/runtime/HEADER_SIZE i32 (i32.const 8)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741816)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741816)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) @@ -35,7 +35,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -131,10 +131,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -404,7 +404,7 @@ end end ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -412,9 +412,9 @@ i32.eqz if i32.const 0 - i32.const 16 - i32.const 153 - i32.const 4 + i32.const 64 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -429,9 +429,9 @@ i32.eqz if i32.const 0 - i32.const 16 - i32.const 155 - i32.const 4 + i32.const 64 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -442,49 +442,40 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 - i32.const 56 - i32.const 25 - i32.const 43 + i32.const 16 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 2 - call $~lib/runtime/register - end + local.get $2 + i32.const 2 + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/ArrayBufferView#constructor (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u if i32.const 0 i32.const 16 - i32.const 236 - i32.const 57 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -500,9 +491,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -532,13 +523,13 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) @@ -550,7 +541,7 @@ if i32.const 0 i32.const 104 - i32.const 114 + i32.const 115 i32.const 44 call $~lib/env/abort unreachable @@ -581,7 +572,7 @@ local.set $3 end local.get $3 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u local.get $2 local.get $3 @@ -603,9 +594,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -637,14 +628,14 @@ local.get $0 i32.load ) - (func $~lib/runtime/ArrayBufferView#get:byteOffset (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 i32.load i32.sub ) - (func $~lib/runtime/ArrayBufferView#get:byteLength (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#get:byteLength (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=8 ) @@ -1489,9 +1480,9 @@ global.get $std/dataview/array call $~lib/typedarray/Uint8Array#get:buffer global.get $std/dataview/array - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset global.get $std/dataview/array - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength call $~lib/dataview/DataView#constructor global.set $std/dataview/view global.get $std/dataview/view diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 44ae296b..fea96f3c 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -81,7 +81,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/register (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 80 @@ -89,8 +89,8 @@ if i32.const 0 i32.const 48 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -104,8 +104,8 @@ if i32.const 0 i32.const 48 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -205,7 +205,7 @@ local.get $0 i32.const 8 i32.add - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i64.const 0 i64.store diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 25d22b7b..790f2afa 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/ADJUSTOBLOCK (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -123,10 +123,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -139,7 +139,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -148,8 +148,8 @@ if i32.const 0 i32.const 48 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -165,8 +165,8 @@ if i32.const 0 i32.const 48 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -181,9 +181,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index cab77e67..7b4ed5a5 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -101,7 +101,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -147,7 +147,7 @@ (func $~lib/string/String~iterate (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/register (; 5 ;) (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 148 @@ -155,8 +155,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -170,8 +170,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -399,19 +399,19 @@ if i32.const 0 i32.const 72 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end local.get $0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 call $~lib/memory/memory.fill local.get $1 i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/map/Map#clear (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) @@ -451,9 +451,9 @@ (func $~lib/map/Map#constructor (; 9 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -1181,9 +1181,9 @@ (func $~lib/map/Map#constructor (; 17 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -1844,9 +1844,9 @@ (func $~lib/map/Map#constructor (; 24 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -2619,9 +2619,9 @@ (func $~lib/map/Map#constructor (; 32 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -3327,9 +3327,9 @@ (func $~lib/map/Map#constructor (; 39 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -4025,9 +4025,9 @@ (func $~lib/map/Map#constructor (; 48 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -4404,9 +4404,9 @@ (func $~lib/map/Map#constructor (; 51 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 15 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -5145,9 +5145,9 @@ (func $~lib/map/Map#constructor (; 60 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 17 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -5496,9 +5496,9 @@ (func $~lib/map/Map#constructor (; 62 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 19 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -6176,9 +6176,9 @@ (func $~lib/map/Map#constructor (; 70 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 21 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 2172de8f..13a554ca 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -30,14 +30,14 @@ (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) (global $~lib/argc (mut i32) (i32.const 0)) (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/memory/HEAP_BASE i32 (i32.const 148)) (global $~lib/capabilities i32 (i32.const 2)) (export "memory" (memory $0)) (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -133,10 +133,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -178,7 +178,7 @@ (func $~lib/collector/dummy/__ref_register (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -187,8 +187,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -204,8 +204,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -478,36 +478,27 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 i32.const 72 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 4 - call $~lib/runtime/register - end + local.get $2 + i32.const 4 + call $~lib/runtime/runtime.register ) (func $~lib/collector/dummy/__ref_link (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop @@ -590,9 +581,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1564,9 +1555,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2507,9 +2498,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -3496,9 +3487,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -4439,9 +4430,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -5400,9 +5391,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -6319,9 +6310,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 15 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -7336,9 +7327,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 17 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -8265,9 +8256,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 19 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -9199,9 +9190,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 21 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/std/new.optimized.wat b/tests/compiler/std/new.optimized.wat index 45fa3ebd..1b0be8f1 100644 --- a/tests/compiler/std/new.optimized.wat +++ b/tests/compiler/std/new.optimized.wat @@ -76,7 +76,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/register (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 48 @@ -84,8 +84,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -99,8 +99,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -122,7 +122,7 @@ local.get $0 i32.const 8 i32.add - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 1 i32.store diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 81e5b86f..7ed90566 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/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -116,10 +116,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -132,7 +132,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 5 ;) (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 global.get $~lib/memory/HEAP_BASE @@ -141,8 +141,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -158,8 +158,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -175,9 +175,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/std/object-literal.optimized.wat b/tests/compiler/std/object-literal.optimized.wat index 25b1184b..e4e009da 100644 --- a/tests/compiler/std/object-literal.optimized.wat +++ b/tests/compiler/std/object-literal.optimized.wat @@ -87,7 +87,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (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 @@ -124,7 +124,7 @@ call_indirect (type $FUNCSIG$vi) end ) - (func $~lib/runtime/register (; 5 ;) (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 156 @@ -132,8 +132,8 @@ if i32.const 0 i32.const 64 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -147,8 +147,8 @@ if i32.const 0 i32.const 64 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -269,9 +269,9 @@ global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 1 i32.store @@ -281,9 +281,9 @@ local.get $0 call $std/object-literal/bar i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 2 i32.store @@ -300,9 +300,9 @@ unreachable end i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 3 i32.store diff --git a/tests/compiler/std/object-literal.untouched.wat b/tests/compiler/std/object-literal.untouched.wat index 89c4fa6f..ee2ec8a2 100644 --- a/tests/compiler/std/object-literal.untouched.wat +++ b/tests/compiler/std/object-literal.untouched.wat @@ -27,7 +27,7 @@ (func $~lib/string/String~iterate (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) ) - (func $~lib/runtime/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -123,10 +123,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -162,7 +162,7 @@ (func $~lib/collector/dummy/__ref_register (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -171,8 +171,8 @@ if i32.const 0 i32.const 64 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -188,8 +188,8 @@ if i32.const 0 i32.const 64 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -382,9 +382,9 @@ global.set $~lib/allocator/arena/offset block (result i32) i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 local.get $0 i32.const 1 @@ -397,9 +397,9 @@ call $std/object-literal/bar block (result i32) i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $1 local.get $1 i32.const 2 @@ -409,9 +409,9 @@ call $std/object-literal/bar2 block (result i32) i32.const 4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $2 local.get $2 i32.const 3 diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 2fa1f405..d4406de5 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -145,7 +145,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 16 call $~lib/allocator/arena/__mem_allocate @@ -159,7 +159,7 @@ i32.const 8 i32.add ) - (func $~lib/runtime/register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 112 @@ -167,8 +167,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -182,8 +182,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -194,9 +194,9 @@ ) (func $std/operator-overloading/Tester#constructor (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $2 local.get $0 i32.store @@ -1239,9 +1239,9 @@ ) (func $std/operator-overloading/TesterInlineStatic#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $2 local.get $0 i32.store @@ -1252,9 +1252,9 @@ ) (func $std/operator-overloading/TesterInlineInstance#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $2 local.get $0 i32.store diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 9b9d0a42..3ef068ef 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/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -184,10 +184,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -200,7 +200,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 5 ;) (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 global.get $~lib/memory/HEAP_BASE @@ -209,8 +209,8 @@ if i32.const 0 i32.const 16 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -226,8 +226,8 @@ if i32.const 0 i32.const 16 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -241,9 +241,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1814,9 +1814,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1832,9 +1832,9 @@ i32.eqz if i32.const 8 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/std/runtime.optimized.wat b/tests/compiler/std/runtime.optimized.wat index 49bc79fa..0fcb6ca0 100644 --- a/tests/compiler/std/runtime.optimized.wat +++ b/tests/compiler/std/runtime.optimized.wat @@ -1169,7 +1169,7 @@ local.get $1 call $~lib/allocator/tlsf/Root#use ) - (func $~lib/runtime/allocate (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -2486,7 +2486,7 @@ end end ) - (func $~lib/runtime/reallocate (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2563,8 +2563,8 @@ if i32.const 0 i32.const 232 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -2593,15 +2593,15 @@ i32.store offset=4 local.get $0 ) - (func $~lib/runtime/discard (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 24 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 264 i32.le_u if i32.const 0 i32.const 232 - i32.const 177 - i32.const 4 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -2615,15 +2615,15 @@ if i32.const 0 i32.const 232 - i32.const 179 - i32.const 4 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end local.get $0 call $~lib/allocator/tlsf/__mem_free ) - (func $~lib/runtime/register (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.register (; 25 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 i32.const 264 @@ -2631,8 +2631,8 @@ if i32.const 0 i32.const 232 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -2646,8 +2646,8 @@ if i32.const 0 i32.const 232 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -2697,7 +2697,7 @@ else i32.const 0 i32.const 24 - i32.const 36 + i32.const 37 i32.const 2 call $~lib/env/abort unreachable @@ -2795,7 +2795,7 @@ f64.const 0 call $~lib/env/trace i32.const 1 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref1 global.get $std/runtime/ref1 i32.const 16 @@ -2808,7 +2808,7 @@ if i32.const 0 i32.const 24 - i32.const 51 + i32.const 52 i32.const 0 call $~lib/env/abort unreachable @@ -2820,21 +2820,21 @@ if i32.const 0 i32.const 24 - i32.const 52 + i32.const 53 i32.const 0 call $~lib/env/abort unreachable end global.get $std/runtime/ref1 local.tee $0 - global.get $std/runtime/barrier1 - call $~lib/runtime/reallocate local.get $0 + global.get $std/runtime/barrier1 + call $~lib/runtime/runtime.reallocate i32.ne if i32.const 0 i32.const 24 - i32.const 53 + i32.const 54 i32.const 0 call $~lib/env/abort unreachable @@ -2846,14 +2846,14 @@ if i32.const 0 i32.const 24 - i32.const 54 + i32.const 55 i32.const 0 call $~lib/env/abort unreachable end global.get $std/runtime/ref1 global.get $std/runtime/barrier2 - call $~lib/runtime/reallocate + call $~lib/runtime/runtime.reallocate global.set $std/runtime/ref2 global.get $std/runtime/ref1 global.get $std/runtime/ref2 @@ -2861,7 +2861,7 @@ if i32.const 0 i32.const 24 - i32.const 56 + i32.const 57 i32.const 0 call $~lib/env/abort unreachable @@ -2877,15 +2877,15 @@ if i32.const 0 i32.const 24 - i32.const 58 + i32.const 59 i32.const 0 call $~lib/env/abort unreachable end global.get $std/runtime/ref2 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard global.get $std/runtime/barrier2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref3 global.get $std/runtime/ref1 global.get $std/runtime/ref3 @@ -2893,23 +2893,23 @@ if i32.const 0 i32.const 24 - i32.const 61 + i32.const 62 i32.const 0 call $~lib/env/abort unreachable end global.get $std/runtime/barrier1 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref4 global.get $std/runtime/ref4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register global.get $std/runtime/register_ref global.get $std/runtime/ref4 i32.ne if i32.const 0 i32.const 24 - i32.const 65 + i32.const 66 i32.const 0 call $~lib/env/abort unreachable @@ -2925,7 +2925,7 @@ if i32.const 0 i32.const 24 - i32.const 67 + i32.const 68 i32.const 0 call $~lib/env/abort unreachable @@ -2937,13 +2937,13 @@ if i32.const 0 i32.const 24 - i32.const 68 + i32.const 69 i32.const 0 call $~lib/env/abort unreachable end i32.const 10 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref5 global.get $std/runtime/ref5 i32.const 16 @@ -2954,7 +2954,7 @@ if i32.const 0 i32.const 24 - i32.const 71 + i32.const 72 i32.const 0 call $~lib/env/abort unreachable @@ -2970,7 +2970,7 @@ if i32.const 0 i32.const 24 - i32.const 72 + i32.const 73 i32.const 0 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/runtime.ts b/tests/compiler/std/runtime.ts index b83875c7..48bfdffc 100644 --- a/tests/compiler/std/runtime.ts +++ b/tests/compiler/std/runtime.ts @@ -1,5 +1,6 @@ import "allocator/tlsf"; -import { classId, ADJUSTOBLOCK, ALLOCATE, REALLOCATE, REGISTER, DISCARD, HEADER, HEADER_SIZE, HEADER_MAGIC } from "runtime"; +// import { classId, ADJUSTOBLOCK, ALLOCATE, REALLOCATE, REGISTER, DISCARD, HEADER, HEADER_SIZE, HEADER_MAGIC } from "runtime"; +import { runtime, HEADER, HEADER_SIZE, HEADER_MAGIC, classId } from "runtime"; @start export function main(): void {} @@ -31,42 +32,42 @@ function isPowerOf2(x: i32): bool { return x != 0 && (x & (x - 1)) == 0; } -assert(ADJUSTOBLOCK(0) > 0); +assert(runtime.adjust(0) > 0); for (let i = 0; i < 9000; ++i) { - assert(isPowerOf2(ADJUSTOBLOCK(i))); + assert(isPowerOf2(runtime.adjust(i))); } -var barrier1 = ADJUSTOBLOCK(0); +var barrier1 = runtime.adjust(0); var barrier2 = barrier1 + 1; -while (ADJUSTOBLOCK(barrier2 + 1) == ADJUSTOBLOCK(barrier2)) ++barrier2; +while (runtime.adjust(barrier2 + 1) == runtime.adjust(barrier2)) ++barrier2; var barrier3 = barrier2 + 1; -while (ADJUSTOBLOCK(barrier3 + 1) == ADJUSTOBLOCK(barrier3)) ++barrier3; +while (runtime.adjust(barrier3 + 1) == runtime.adjust(barrier3)) ++barrier3; trace("barrier1", 1, barrier1); trace("barrier2", 1, barrier2); trace("barrier3", 1, barrier3); -var ref1 = ALLOCATE(1); +var ref1 = runtime.allocate(1); var header1 = changetype
(ref1 - HEADER_SIZE); assert(header1.classId == HEADER_MAGIC); assert(header1.payloadSize == 1); -assert(ref1 == REALLOCATE(ref1, barrier1)); // same segment +assert(ref1 == runtime.reallocate(ref1, barrier1)); // same segment assert(header1.payloadSize == barrier1); -var ref2 = REALLOCATE(ref1, barrier2); +var ref2 = runtime.reallocate(ref1, barrier2); assert(ref1 != ref2); // moves var header2 = changetype
(ref2 - HEADER_SIZE); assert(header2.payloadSize == barrier2); -DISCARD(ref2); -var ref3 = ALLOCATE(barrier2); +runtime.discard(ref2); +var ref3 = runtime.allocate(barrier2); assert(ref1 == ref3); // reuses space of ref1 (free'd in realloc), ref2 (explicitly free'd) -var ref4 = ALLOCATE(barrier1); -REGISTER(ref4); // should call __gc_register +var ref4 = runtime.allocate(barrier1); +runtime.register(ref4, classId()); // should call __gc_register assert(register_ref == ref4); var header4 = changetype
(register_ref - HEADER_SIZE); assert(header4.classId == classId()); assert(header4.payloadSize == barrier1); -var ref5 = ALLOCATE(10); +var ref5 = runtime.allocate(10); assert(changetype(ref5).byteLength == 10); assert(changetype(ref5).length == 5); diff --git a/tests/compiler/std/runtime.untouched.wat b/tests/compiler/std/runtime.untouched.wat index 0bf3b556..abc4c22b 100644 --- a/tests/compiler/std/runtime.untouched.wat +++ b/tests/compiler/std/runtime.untouched.wat @@ -67,7 +67,7 @@ (func $~lib/string/String~iterate (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) ) - (func $~lib/runtime/ADJUSTOBLOCK (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -1462,10 +1462,10 @@ call $~lib/allocator/tlsf/__mem_allocate return ) - (func $~lib/runtime/allocate (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 26 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -3224,7 +3224,7 @@ local.get $0 global.set $std/runtime/register_ref ) - (func $~lib/runtime/reallocate (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3242,10 +3242,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust local.set $4 local.get $3 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -3295,8 +3295,8 @@ if i32.const 0 i32.const 232 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -3328,7 +3328,7 @@ i32.store offset=4 local.get $0 ) - (func $~lib/runtime/discard (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 34 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -3337,8 +3337,8 @@ if i32.const 0 i32.const 232 - i32.const 177 - i32.const 4 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -3354,15 +3354,15 @@ if i32.const 0 i32.const 232 - i32.const 179 - i32.const 4 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end local.get $1 call $~lib/memory/memory.free ) - (func $~lib/runtime/register (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -3371,8 +3371,8 @@ if i32.const 0 i32.const 232 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -3388,8 +3388,8 @@ if i32.const 0 i32.const 232 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -3416,7 +3416,6 @@ ) (func $start:std/runtime (; 38 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i32) i32.const 1 i32.const 2 i32.ne @@ -3424,20 +3423,20 @@ if i32.const 0 i32.const 24 - i32.const 28 + i32.const 29 i32.const 0 call $~lib/env/abort unreachable end i32.const 0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.const 0 i32.gt_u i32.eqz if i32.const 0 i32.const 24 - i32.const 34 + i32.const 35 i32.const 0 call $~lib/env/abort unreachable @@ -3452,13 +3451,13 @@ i32.eqz br_if $break|0 local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $std/runtime/isPowerOf2 i32.eqz if i32.const 0 i32.const 24 - i32.const 36 + i32.const 37 i32.const 2 call $~lib/env/abort unreachable @@ -3473,7 +3472,7 @@ unreachable end i32.const 0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust global.set $std/runtime/barrier1 global.get $std/runtime/barrier1 i32.const 1 @@ -3484,9 +3483,9 @@ global.get $std/runtime/barrier2 i32.const 1 i32.add - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust global.get $std/runtime/barrier2 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.eq if global.get $std/runtime/barrier2 @@ -3506,9 +3505,9 @@ global.get $std/runtime/barrier3 i32.const 1 i32.add - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust global.get $std/runtime/barrier3 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.eq if global.get $std/runtime/barrier3 @@ -3546,12 +3545,8 @@ f64.const 0 f64.const 0 call $~lib/env/trace - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - i32.const 1 - local.set $0 - local.get $0 - call $~lib/runtime/allocate - end + i32.const 1 + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref1 global.get $std/runtime/ref1 global.get $~lib/runtime/HEADER_SIZE @@ -3565,7 +3560,7 @@ if i32.const 0 i32.const 24 - i32.const 51 + i32.const 52 i32.const 0 call $~lib/env/abort unreachable @@ -3578,27 +3573,21 @@ if i32.const 0 i32.const 24 - i32.const 52 + i32.const 53 i32.const 0 call $~lib/env/abort unreachable end global.get $std/runtime/ref1 - block $~lib/runtime/REALLOCATE|inlined.0 (result i32) - global.get $std/runtime/ref1 - local.set $1 - global.get $std/runtime/barrier1 - local.set $0 - local.get $1 - local.get $0 - call $~lib/runtime/reallocate - end + global.get $std/runtime/ref1 + global.get $std/runtime/barrier1 + call $~lib/runtime/runtime.reallocate i32.eq i32.eqz if i32.const 0 i32.const 24 - i32.const 53 + i32.const 54 i32.const 0 call $~lib/env/abort unreachable @@ -3611,20 +3600,14 @@ if i32.const 0 i32.const 24 - i32.const 54 + i32.const 55 i32.const 0 call $~lib/env/abort unreachable end - block $~lib/runtime/REALLOCATE|inlined.1 (result i32) - global.get $std/runtime/ref1 - local.set $1 - global.get $std/runtime/barrier2 - local.set $0 - local.get $1 - local.get $0 - call $~lib/runtime/reallocate - end + global.get $std/runtime/ref1 + global.get $std/runtime/barrier2 + call $~lib/runtime/runtime.reallocate global.set $std/runtime/ref2 global.get $std/runtime/ref1 global.get $std/runtime/ref2 @@ -3633,7 +3616,7 @@ if i32.const 0 i32.const 24 - i32.const 56 + i32.const 57 i32.const 0 call $~lib/env/abort unreachable @@ -3650,23 +3633,15 @@ if i32.const 0 i32.const 24 - i32.const 58 + i32.const 59 i32.const 0 call $~lib/env/abort unreachable end - block $~lib/runtime/DISCARD|inlined.0 - global.get $std/runtime/ref2 - local.set $0 - local.get $0 - call $~lib/runtime/discard - end - block $~lib/runtime/ALLOCATE|inlined.1 (result i32) - global.get $std/runtime/barrier2 - local.set $0 - local.get $0 - call $~lib/runtime/allocate - end + global.get $std/runtime/ref2 + call $~lib/runtime/runtime.discard + global.get $std/runtime/barrier2 + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref3 global.get $std/runtime/ref1 global.get $std/runtime/ref3 @@ -3675,25 +3650,17 @@ if i32.const 0 i32.const 24 - i32.const 61 + i32.const 62 i32.const 0 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.2 (result i32) - global.get $std/runtime/barrier1 - local.set $0 - local.get $0 - call $~lib/runtime/allocate - end + global.get $std/runtime/barrier1 + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref4 - block $~lib/runtime/REGISTER|inlined.0 (result i32) - global.get $std/runtime/ref4 - local.set $0 - local.get $0 - i32.const 1 - call $~lib/runtime/register - end + global.get $std/runtime/ref4 + i32.const 1 + call $~lib/runtime/runtime.register drop global.get $std/runtime/register_ref global.get $std/runtime/ref4 @@ -3702,7 +3669,7 @@ if i32.const 0 i32.const 24 - i32.const 65 + i32.const 66 i32.const 0 call $~lib/env/abort unreachable @@ -3719,7 +3686,7 @@ if i32.const 0 i32.const 24 - i32.const 67 + i32.const 68 i32.const 0 call $~lib/env/abort unreachable @@ -3732,17 +3699,13 @@ if i32.const 0 i32.const 24 - i32.const 68 + i32.const 69 i32.const 0 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.3 (result i32) - i32.const 10 - local.set $0 - local.get $0 - call $~lib/runtime/allocate - end + i32.const 10 + call $~lib/runtime/runtime.allocate global.set $std/runtime/ref5 global.get $std/runtime/ref5 call $~lib/arraybuffer/ArrayBuffer#get:byteLength @@ -3752,7 +3715,7 @@ if i32.const 0 i32.const 24 - i32.const 71 + i32.const 72 i32.const 0 call $~lib/env/abort unreachable @@ -3765,7 +3728,7 @@ if i32.const 0 i32.const 24 - i32.const 72 + i32.const 73 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 4b37e134..2932bcfb 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -97,7 +97,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -143,7 +143,7 @@ (func $~lib/string/String~iterate (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/register (; 5 ;) (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 148 @@ -151,8 +151,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -166,8 +166,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -395,19 +395,19 @@ if i32.const 0 i32.const 72 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end local.get $0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 call $~lib/memory/memory.fill local.get $1 i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/set/Set#clear (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) @@ -447,9 +447,9 @@ (func $~lib/set/Set#constructor (; 9 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -1046,9 +1046,9 @@ (func $~lib/set/Set#constructor (; 16 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -1594,9 +1594,9 @@ (func $~lib/set/Set#constructor (; 22 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -2229,9 +2229,9 @@ (func $~lib/set/Set#constructor (; 29 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -2813,9 +2813,9 @@ (func $~lib/set/Set#constructor (; 35 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -3415,9 +3415,9 @@ (func $~lib/set/Set#constructor (; 43 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -3723,9 +3723,9 @@ (func $~lib/set/Set#constructor (; 46 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 15 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -4361,9 +4361,9 @@ (func $~lib/set/Set#constructor (; 54 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 17 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -4634,9 +4634,9 @@ (func $~lib/set/Set#constructor (; 56 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 19 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -5210,9 +5210,9 @@ (func $~lib/set/Set#constructor (; 63 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 21 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 8b0772f3..ff6f1e6b 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -30,14 +30,14 @@ (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) (global $~lib/argc (mut i32) (i32.const 0)) (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/memory/HEAP_BASE i32 (i32.const 148)) (global $~lib/capabilities i32 (i32.const 2)) (export "memory" (memory $0)) (export "table" (table $0)) (export ".capabilities" (global $~lib/capabilities)) (start $start) - (func $~lib/runtime/ADJUSTOBLOCK (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -133,10 +133,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -178,7 +178,7 @@ (func $~lib/collector/dummy/__ref_register (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -187,8 +187,8 @@ if i32.const 0 i32.const 24 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -204,8 +204,8 @@ if i32.const 0 i32.const 24 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -478,36 +478,27 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 i32.const 72 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 4 - call $~lib/runtime/register - end + local.get $2 + i32.const 4 + call $~lib/runtime/runtime.register ) (func $~lib/collector/dummy/__ref_link (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop @@ -590,9 +581,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -1427,9 +1418,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2249,9 +2240,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -3101,9 +3092,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -3923,9 +3914,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -4779,9 +4770,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -5593,9 +5584,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 15 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -6498,9 +6489,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 17 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -7315,9 +7306,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 19 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -8136,9 +8127,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 21 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 165ecd17..11bd2e0f 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -1366,7 +1366,7 @@ end end ) - (func $~lib/runtime/reallocate (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1437,8 +1437,8 @@ if i32.const 0 i32.const 280 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -1481,7 +1481,7 @@ i32.const 0 i32.const 240 i32.const 13 - i32.const 64 + i32.const 72 call $~lib/env/abort unreachable end @@ -1492,7 +1492,7 @@ local.get $1 i32.shl local.tee $3 - call $~lib/runtime/reallocate + call $~lib/runtime/runtime.reallocate local.set $1 local.get $1 local.get $2 diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index 869e4f88..5752f5a7 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -31,7 +31,7 @@ (global $std/static-array/f i32 (i32.const 120)) (global $std/static-array/F i32 (i32.const 168)) (global $~lib/runtime/HEADER_SIZE i32 (i32.const 8)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741816)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741816)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) @@ -71,7 +71,7 @@ local.get $1 call $~lib/array/Array#__unchecked_get ) - (func $~lib/runtime/ADJUSTOBLOCK (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -1863,7 +1863,7 @@ local.get $0 call $~lib/allocator/arena/__mem_free ) - (func $~lib/runtime/reallocate (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1881,10 +1881,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust local.set $4 local.get $3 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -1928,8 +1928,8 @@ if i32.const 0 i32.const 280 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -1964,7 +1964,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $1 local.get $0 i32.load offset=8 @@ -1973,7 +1972,7 @@ i32.gt_u if local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u @@ -1981,7 +1980,7 @@ i32.const 0 i32.const 240 i32.const 13 - i32.const 64 + i32.const 72 call $~lib/env/abort unreachable end @@ -1992,15 +1991,9 @@ local.get $2 i32.shl local.set $4 - block $~lib/runtime/REALLOCATE|inlined.0 (result i32) - local.get $3 - local.set $6 - local.get $4 - local.set $5 - local.get $6 - local.get $5 - call $~lib/runtime/reallocate - end + local.get $3 + local.get $4 + call $~lib/runtime/runtime.reallocate local.set $5 local.get $5 local.get $3 diff --git a/tests/compiler/std/string-utf8.optimized.wat b/tests/compiler/std/string-utf8.optimized.wat index 71f47c89..b34cfd00 100644 --- a/tests/compiler/std/string-utf8.optimized.wat +++ b/tests/compiler/std/string-utf8.optimized.wat @@ -394,7 +394,7 @@ i32.store8 local.get $5 ) - (func $~lib/runtime/allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -1456,7 +1456,7 @@ end end ) - (func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 i32.const 228 @@ -1464,8 +1464,8 @@ if i32.const 0 i32.const 136 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -1479,8 +1479,8 @@ if i32.const 0 i32.const 136 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -1551,7 +1551,7 @@ if i32.const 0 i32.const 96 - i32.const 447 + i32.const 448 i32.const 8 call $~lib/env/abort unreachable @@ -1598,7 +1598,7 @@ if i32.const 0 i32.const 96 - i32.const 451 + i32.const 452 i32.const 8 call $~lib/env/abort unreachable @@ -1677,7 +1677,7 @@ if i32.const 0 i32.const 96 - i32.const 463 + i32.const 464 i32.const 8 call $~lib/env/abort unreachable @@ -1732,19 +1732,19 @@ if i32.const 0 i32.const 96 - i32.const 472 + i32.const 473 i32.const 4 call $~lib/env/abort unreachable end local.get $5 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $0 local.get $6 local.get $5 call $~lib/memory/memory.copy local.get $0 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/string/compareImpl (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) diff --git a/tests/compiler/std/string-utf8.untouched.wat b/tests/compiler/std/string-utf8.untouched.wat index 36d69018..8131ede6 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/ADJUSTOBLOCK (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -465,10 +465,10 @@ i32.sub i32.shl ) - (func $~lib/runtime/allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -1920,7 +1920,7 @@ local.get $0 call $~lib/allocator/arena/__mem_free ) - (func $~lib/runtime/register (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -1929,8 +1929,8 @@ if i32.const 0 i32.const 136 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -1946,8 +1946,8 @@ if i32.const 0 i32.const 136 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -2033,7 +2033,7 @@ if i32.const 0 i32.const 96 - i32.const 447 + i32.const 448 i32.const 8 call $~lib/env/abort unreachable @@ -2087,7 +2087,7 @@ if i32.const 0 i32.const 96 - i32.const 451 + i32.const 452 i32.const 8 call $~lib/env/abort unreachable @@ -2182,7 +2182,7 @@ if i32.const 0 i32.const 96 - i32.const 463 + i32.const 464 i32.const 8 call $~lib/env/abort unreachable @@ -2245,17 +2245,13 @@ if i32.const 0 i32.const 96 - i32.const 472 + i32.const 473 i32.const 4 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $4 - local.set $5 - local.get $5 - call $~lib/runtime/allocate - end + local.get $4 + call $~lib/runtime/runtime.allocate local.set $7 local.get $7 local.get $3 @@ -2263,13 +2259,9 @@ call $~lib/memory/memory.copy local.get $3 call $~lib/memory/memory.free - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.0 (result i32) - local.get $7 - local.set $5 - local.get $5 - i32.const 1 - call $~lib/runtime/register - end + local.get $7 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/string/compareImpl (; 14 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 9f320c1d..3d95e96a 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -413,7 +413,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (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 @@ -440,7 +440,7 @@ i32.const 16 i32.add ) - (func $~lib/runtime/register (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 6736 @@ -448,8 +448,8 @@ if i32.const 0 i32.const 120 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -463,8 +463,8 @@ if i32.const 0 i32.const 120 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -476,13 +476,13 @@ (func $~lib/string/String.fromCharCode (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 i32.store16 local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/string/compareImpl (; 6 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) @@ -579,7 +579,7 @@ if i32.const 0 i32.const 216 - i32.const 24 + i32.const 25 i32.const 4 call $~lib/env/abort unreachable @@ -592,7 +592,7 @@ i32.add i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $2 local.get $1 if @@ -623,7 +623,7 @@ end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String#startsWith (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -634,7 +634,7 @@ if i32.const 0 i32.const 216 - i32.const 164 + i32.const 165 i32.const 4 call $~lib/env/abort unreachable @@ -682,7 +682,7 @@ if i32.const 0 i32.const 216 - i32.const 77 + i32.const 78 i32.const 4 call $~lib/env/abort unreachable @@ -730,7 +730,7 @@ if i32.const 0 i32.const 216 - i32.const 133 + i32.const 134 i32.const 4 call $~lib/env/abort unreachable @@ -1881,7 +1881,7 @@ if i32.const 0 i32.const 216 - i32.const 281 + i32.const 282 i32.const 4 call $~lib/env/abort unreachable @@ -1921,7 +1921,7 @@ return end local.get $4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.set $1 local.get $4 local.get $5 @@ -1965,7 +1965,7 @@ call $~lib/memory/memory.copy local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String#padEnd (; 16 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1976,7 +1976,7 @@ if i32.const 0 i32.const 216 - i32.const 302 + i32.const 303 i32.const 4 call $~lib/env/abort unreachable @@ -2016,7 +2016,7 @@ return end local.get $5 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 local.get $4 @@ -2062,7 +2062,7 @@ end local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String#lastIndexOf (; 17 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -2072,7 +2072,7 @@ if i32.const 0 i32.const 216 - i32.const 149 + i32.const 150 i32.const 4 call $~lib/env/abort unreachable @@ -2494,7 +2494,7 @@ if i32.const 0 i32.const 216 - i32.const 569 + i32.const 570 i32.const 10 call $~lib/env/abort unreachable @@ -2587,7 +2587,7 @@ return end local.get $2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $1 @@ -2600,7 +2600,7 @@ call $~lib/memory/memory.copy local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String.__concat (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -2766,7 +2766,7 @@ if i32.const 0 i32.const 216 - i32.const 323 + i32.const 324 i32.const 4 call $~lib/env/abort unreachable @@ -2796,7 +2796,7 @@ if i32.const 0 i32.const 216 - i32.const 328 + i32.const 329 i32.const 6 call $~lib/env/abort unreachable @@ -2826,7 +2826,7 @@ i32.mul i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $3 @@ -2836,7 +2836,7 @@ call $~lib/memory/memory.repeat local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String#slice (; 28 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -2903,7 +2903,7 @@ i32.const 1 i32.shl local.tee $2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $3 local.get $1 i32.const 1 @@ -2914,7 +2914,7 @@ call $~lib/memory/memory.copy local.get $3 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/string/String>~iterate (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) @@ -2953,23 +2953,22 @@ end end ) - (func $~lib/runtime/makeArray (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/runtime/runtime.makeArray (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) i32.const 16 - call $~lib/runtime/allocate - i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate + local.get $1 + call $~lib/runtime/runtime.register local.set $1 local.get $0 i32.const 2 i32.shl local.tee $2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $3 local.set $4 local.get $1 @@ -3200,7 +3199,7 @@ end end ) - (func $~lib/runtime/reallocate (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3277,8 +3276,8 @@ if i32.const 0 i32.const 120 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -3319,7 +3318,7 @@ i32.const 0 i32.const 1912 i32.const 13 - i32.const 64 + i32.const 72 call $~lib/env/abort unreachable end @@ -3330,7 +3329,7 @@ i32.const 2 i32.shl local.tee $3 - call $~lib/runtime/reallocate + call $~lib/runtime/runtime.reallocate local.set $1 local.get $1 local.get $2 @@ -3395,230 +3394,242 @@ if i32.const 0 i32.const 216 - i32.const 350 + i32.const 351 i32.const 4 call $~lib/env/abort unreachable end - block $folding-inner0 - local.get $2 - i32.eqz - br_if $folding-inner0 - local.get $1 - i32.eqz - if - i32.const 1 - call $~lib/runtime/makeArray - local.tee $1 - i32.load offset=4 - local.get $0 - i32.store - local.get $1 - return - end + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 2 + call $~lib/runtime/runtime.makeArray + return + end + local.get $1 + i32.eqz + if + i32.const 1 + i32.const 2 + call $~lib/runtime/runtime.makeArray + local.tee $1 + i32.load offset=4 local.get $0 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $3 - i32.const 2147483647 - local.get $2 - local.get $2 - i32.const 0 - i32.lt_s - select - local.set $5 + i32.store local.get $1 - i32.const 16 - i32.sub - i32.load offset=4 - i32.const 1 - i32.shr_u - local.tee $8 - if - local.get $3 - i32.eqz - if - i32.const 1 - call $~lib/runtime/makeArray - local.tee $0 - i32.load offset=4 - i32.const 416 - i32.store - local.get $0 - return - end - else - local.get $3 - i32.eqz - br_if $folding-inner0 - local.get $3 - local.get $5 - local.get $3 - local.get $5 - i32.lt_s - select - local.tee $2 - call $~lib/runtime/makeArray - local.tee $4 - i32.load offset=4 - local.set $3 - i32.const 0 - local.set $1 - loop $repeat|0 - local.get $1 - local.get $2 - i32.lt_s - if - i32.const 2 - call $~lib/runtime/allocate - i32.const 1 - call $~lib/runtime/register - local.tee $5 - local.get $1 - i32.const 1 - i32.shl - local.get $0 - i32.add - i32.load16_u - i32.store16 - local.get $1 - i32.const 2 - i32.shl - local.get $3 - i32.add - local.get $5 - i32.store - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $repeat|0 - end - end - local.get $4 - return - end - i32.const 0 - call $~lib/runtime/makeArray - local.set $2 - loop $continue|1 - local.get $1 - i32.eqz - if - unreachable - end - local.get $0 - local.get $1 - local.get $4 - call $~lib/string/String#indexOf - local.tee $7 - i32.const -1 - i32.ne - if - local.get $7 - local.get $4 - i32.sub - local.tee $6 - i32.const 0 - i32.gt_s - if - local.get $6 - i32.const 1 - i32.shl - local.tee $6 - call $~lib/runtime/allocate - local.tee $9 - local.get $4 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $6 - call $~lib/memory/memory.copy - local.get $2 - local.get $9 - i32.const 1 - call $~lib/runtime/register - call $~lib/array/Array<~lib/string/String>#push - else - local.get $2 - i32.const 416 - call $~lib/array/Array<~lib/string/String>#push - end - local.get $5 - local.get $10 - i32.const 1 - i32.add - local.tee $10 - i32.eq - if - local.get $2 - return - end - local.get $7 - local.get $8 - i32.add - local.set $4 - br $continue|1 - end - end - local.get $4 + return + end + local.get $0 + i32.const 16 + i32.sub + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $3 + i32.const 2147483647 + local.get $2 + local.get $2 + i32.const 0 + i32.lt_s + select + local.set $5 + local.get $1 + i32.const 16 + i32.sub + i32.load offset=4 + i32.const 1 + i32.shr_u + local.tee $8 + if + local.get $3 i32.eqz if i32.const 1 - call $~lib/runtime/makeArray - local.tee $1 + i32.const 2 + call $~lib/runtime/runtime.makeArray + local.tee $0 i32.load offset=4 - local.tee $2 - i32.load + i32.const 416 + i32.store local.get $0 - i32.ne - if - local.get $2 - local.get $0 - i32.store - end - local.get $1 + return + end + else + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 1 + call $~lib/runtime/runtime.makeArray return end local.get $3 - local.get $4 - i32.sub - local.tee $1 + local.get $5 + local.get $3 + local.get $5 + i32.lt_s + select + local.tee $4 + i32.const 2 + call $~lib/runtime/runtime.makeArray + local.tee $3 + i32.load offset=4 + local.set $5 i32.const 0 - i32.gt_s - if + local.set $1 + loop $repeat|0 local.get $1 - i32.const 1 - i32.shl - local.tee $1 - call $~lib/runtime/allocate - local.tee $3 local.get $4 - i32.const 1 - i32.shl - local.get $0 - i32.add - local.get $1 - call $~lib/memory/memory.copy - local.get $2 - local.get $3 - i32.const 1 - call $~lib/runtime/register - call $~lib/array/Array<~lib/string/String>#push - else - local.get $2 - i32.const 416 - call $~lib/array/Array<~lib/string/String>#push + i32.lt_s + if + i32.const 2 + call $~lib/runtime/runtime.allocate + local.tee $2 + local.get $1 + i32.const 1 + i32.shl + local.get $0 + i32.add + i32.load16_u + i32.store16 + local.get $1 + i32.const 2 + i32.shl + local.get $5 + i32.add + local.get $2 + i32.store + local.get $2 + i32.const 1 + call $~lib/runtime/runtime.register + drop + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $repeat|0 + end end - local.get $2 + local.get $3 return end i32.const 0 - call $~lib/runtime/makeArray + i32.const 2 + call $~lib/runtime/runtime.makeArray + local.set $2 + loop $continue|1 + local.get $1 + i32.eqz + if + unreachable + end + local.get $0 + local.get $1 + local.get $4 + call $~lib/string/String#indexOf + local.tee $7 + i32.const -1 + i32.ne + if + local.get $7 + local.get $4 + i32.sub + local.tee $6 + i32.const 0 + i32.gt_s + if + local.get $6 + i32.const 1 + i32.shl + local.tee $6 + call $~lib/runtime/runtime.allocate + local.tee $9 + local.get $4 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $6 + call $~lib/memory/memory.copy + local.get $2 + local.get $9 + i32.const 1 + call $~lib/runtime/runtime.register + call $~lib/array/Array<~lib/string/String>#push + else + local.get $2 + i32.const 416 + call $~lib/array/Array<~lib/string/String>#push + end + local.get $5 + local.get $10 + i32.const 1 + i32.add + local.tee $10 + i32.eq + if + local.get $2 + return + end + local.get $7 + local.get $8 + i32.add + local.set $4 + br $continue|1 + end + end + local.get $4 + i32.eqz + if + i32.const 1 + i32.const 2 + call $~lib/runtime/runtime.makeArray + local.tee $1 + i32.load offset=4 + local.tee $2 + i32.load + local.get $0 + i32.ne + if + local.get $2 + local.get $0 + i32.store + end + local.get $1 + return + end + local.get $3 + local.get $4 + i32.sub + local.tee $1 + i32.const 0 + i32.gt_s + if + local.get $1 + i32.const 1 + i32.shl + local.tee $1 + call $~lib/runtime/runtime.allocate + local.tee $3 + local.get $4 + i32.const 1 + i32.shl + local.get $0 + i32.add + local.get $1 + call $~lib/memory/memory.copy + local.get $2 + local.get $3 + i32.const 1 + call $~lib/runtime/runtime.register + call $~lib/array/Array<~lib/string/String>#push + else + local.get $2 + i32.const 416 + call $~lib/array/Array<~lib/string/String>#push + end + local.get $2 ) (func $~lib/array/Array<~lib/string/String>#__get (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $1 @@ -3854,7 +3865,7 @@ local.tee $3 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $3 @@ -3867,7 +3878,7 @@ end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/utoa32 (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -3883,14 +3894,14 @@ local.tee $1 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $1 call $~lib/util/number/utoa32_lut local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/decimalCount64 (; 42 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 @@ -4064,7 +4075,7 @@ local.tee $3 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $1 local.get $3 @@ -4075,7 +4086,7 @@ local.tee $1 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $1 @@ -4083,7 +4094,7 @@ end local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa64 (; 45 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) @@ -4121,7 +4132,7 @@ local.tee $4 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $3 local.get $2 local.get $4 @@ -4134,7 +4145,7 @@ local.tee $2 i32.const 1 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $3 local.get $0 local.get $2 @@ -4148,7 +4159,7 @@ end local.get $3 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/util/number/genDigits (; 46 ;) (type $FUNCSIG$iijijiji) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32) (local $7 i32) @@ -5121,7 +5132,7 @@ if i32.const 0 i32.const 216 - i32.const 189 + i32.const 190 i32.const 4 call $~lib/env/abort unreachable @@ -5197,7 +5208,7 @@ return end local.get $3 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 local.get $2 @@ -5206,17 +5217,17 @@ call $~lib/memory/memory.copy local.get $1 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/discard (; 50 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 50 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 6736 i32.le_u if i32.const 0 i32.const 120 - i32.const 177 - i32.const 4 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -5229,8 +5240,8 @@ if i32.const 0 i32.const 120 - i32.const 179 - i32.const 4 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end @@ -5267,7 +5278,7 @@ return end i32.const 56 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 call $~lib/util/number/dtoa_core @@ -5277,7 +5288,7 @@ call $~lib/string/String#substring local.set $1 local.get $2 - call $~lib/runtime/discard + call $~lib/runtime/runtime.discard local.get $1 ) (func $start:std/string (; 52 ;) (type $FUNCSIG$v) diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 61eb3f6d..1ad6323a 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -191,7 +191,7 @@ (global $std/string/b (mut i32) (i32.const 0)) (global $std/string/sa (mut i32) (i32.const 0)) (global $~lib/argc (mut i32) (i32.const 0)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/u64.MAX_VALUE i64 (i64.const -1)) @@ -239,7 +239,7 @@ i32.add i32.load16_u ) - (func $~lib/runtime/ADJUSTOBLOCK (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -335,10 +335,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -360,7 +360,7 @@ (func $~lib/collector/dummy/__ref_register (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -369,8 +369,8 @@ if i32.const 0 i32.const 120 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -386,8 +386,8 @@ if i32.const 0 i32.const 120 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -400,24 +400,15 @@ ) (func $~lib/string/String.fromCharCode (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - i32.const 2 - local.set $1 - local.get $1 - call $~lib/runtime/allocate - end - local.set $2 - local.get $2 + i32.const 2 + call $~lib/runtime/runtime.allocate + local.set $1 + local.get $1 local.get $0 i32.store16 - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.0 (result i32) - local.get $2 - local.set $1 - local.get $1 - i32.const 1 - call $~lib/runtime/register - end + local.get $1 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/string/compareImpl (; 11 ;) (type $FUNCSIG$iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) @@ -528,7 +519,7 @@ if i32.const 0 i32.const 216 - i32.const 24 + i32.const 25 i32.const 4 call $~lib/env/abort unreachable @@ -537,21 +528,17 @@ i32.const 65535 i32.gt_s local.set $1 - block $~lib/runtime/ALLOCATE|inlined.1 (result i32) - local.get $1 - i32.const 1 - i32.add - i32.const 1 - i32.shl - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 + local.get $1 + i32.const 1 + i32.add + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $2 local.get $1 i32.eqz if - local.get $3 + local.get $2 local.get $0 i32.store16 else @@ -564,28 +551,24 @@ i32.shr_u i32.const 55296 i32.add - local.set $2 + local.set $3 local.get $0 i32.const 1023 i32.and i32.const 56320 i32.add local.set $4 - local.get $3 local.get $2 + local.get $3 i32.const 16 i32.shl local.get $4 i32.or i32.store end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.1 (result i32) - local.get $3 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $2 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String#startsWith (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -601,7 +584,7 @@ if i32.const 0 i32.const 216 - i32.const 164 + i32.const 165 i32.const 4 call $~lib/env/abort unreachable @@ -667,7 +650,7 @@ if i32.const 0 i32.const 216 - i32.const 77 + i32.const 78 i32.const 4 call $~lib/env/abort unreachable @@ -731,7 +714,7 @@ if i32.const 0 i32.const 216 - i32.const 133 + i32.const 134 i32.const 4 call $~lib/env/abort unreachable @@ -2292,7 +2275,7 @@ if i32.const 0 i32.const 216 - i32.const 281 + i32.const 282 i32.const 4 call $~lib/env/abort unreachable @@ -2329,12 +2312,8 @@ local.get $3 i32.sub local.set $7 - block $~lib/runtime/ALLOCATE|inlined.2 (result i32) - local.get $4 - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end + local.get $4 + call $~lib/runtime/runtime.allocate local.set $8 local.get $7 local.get $5 @@ -2377,13 +2356,9 @@ local.get $0 local.get $3 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.2 (result i32) - local.get $8 - local.set $10 - local.get $10 - i32.const 1 - call $~lib/runtime/register - end + local.get $8 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String#padEnd (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -2401,7 +2376,7 @@ if i32.const 0 i32.const 216 - i32.const 302 + i32.const 303 i32.const 4 call $~lib/env/abort unreachable @@ -2438,12 +2413,8 @@ local.get $3 i32.sub local.set $7 - block $~lib/runtime/ALLOCATE|inlined.3 (result i32) - local.get $4 - local.set $6 - local.get $6 - call $~lib/runtime/allocate - end + local.get $4 + call $~lib/runtime/runtime.allocate local.set $8 local.get $8 local.get $0 @@ -2490,13 +2461,9 @@ local.get $7 call $~lib/memory/memory.copy end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.3 (result i32) - local.get $8 - local.set $10 - local.get $10 - i32.const 1 - call $~lib/runtime/register - end + local.get $8 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String#lastIndexOf (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -2511,7 +2478,7 @@ if i32.const 0 i32.const 216 - i32.const 149 + i32.const 150 i32.const 4 call $~lib/env/abort unreachable @@ -3025,7 +2992,7 @@ if i32.const 0 i32.const 216 - i32.const 569 + i32.const 570 i32.const 10 call $~lib/env/abort unreachable @@ -3098,7 +3065,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $1 i32.const 0 i32.eq @@ -3127,30 +3093,22 @@ i32.const 416 return end - block $~lib/runtime/ALLOCATE|inlined.4 (result i32) - local.get $4 - local.set $5 - local.get $5 - call $~lib/runtime/allocate - end - local.set $6 - local.get $6 + local.get $4 + call $~lib/runtime/runtime.allocate + local.set $5 + local.get $5 local.get $0 local.get $2 call $~lib/memory/memory.copy - local.get $6 + local.get $5 local.get $2 i32.add local.get $1 local.get $3 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.4 (result i32) - local.get $6 - local.set $5 - local.get $5 - i32.const 1 - call $~lib/runtime/register - end + local.get $5 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String.__concat (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -3315,7 +3273,7 @@ if i32.const 0 i32.const 216 - i32.const 323 + i32.const 324 i32.const 4 call $~lib/env/abort unreachable @@ -3343,7 +3301,7 @@ if i32.const 0 i32.const 216 - i32.const 328 + i32.const 329 i32.const 6 call $~lib/env/abort unreachable @@ -3369,16 +3327,12 @@ local.get $0 return end - block $~lib/runtime/ALLOCATE|inlined.5 (result i32) - local.get $2 - local.get $1 - i32.mul - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/runtime/allocate - end + local.get $2 + local.get $1 + i32.mul + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $4 local.get $4 local.get $0 @@ -3387,13 +3341,9 @@ i32.shl local.get $1 call $~lib/memory/memory.repeat - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.5 (result i32) - local.get $4 - local.set $3 - local.get $3 - i32.const 1 - call $~lib/runtime/register - end + local.get $4 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String#slice (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -3466,14 +3416,10 @@ i32.const 416 return end - block $~lib/runtime/ALLOCATE|inlined.6 (result i32) - local.get $3 - i32.const 1 - i32.shl - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $3 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $8 local.get $8 local.get $0 @@ -3485,13 +3431,9 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.6 (result i32) - local.get $8 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $8 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/array/Array<~lib/string/String>~iterate (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) @@ -3548,7 +3490,7 @@ (func $~lib/collector/dummy/__ref_unlink (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/makeArray (; 39 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 39 ;) (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) @@ -3556,9 +3498,9 @@ (local $8 i32) (local $9 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $4 local.get $0 local.get $2 @@ -3567,9 +3509,9 @@ local.get $0 local.get $2 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $6 local.get $4 local.tee $7 @@ -3876,7 +3818,7 @@ local.get $0 call $~lib/allocator/arena/__mem_free ) - (func $~lib/runtime/reallocate (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.reallocate (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3894,10 +3836,10 @@ i32.lt_u if local.get $1 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust local.set $4 local.get $3 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust i32.const 0 local.get $0 global.get $~lib/memory/HEAP_BASE @@ -3947,8 +3889,8 @@ if i32.const 0 i32.const 120 - i32.const 117 - i32.const 8 + i32.const 107 + i32.const 10 call $~lib/env/abort unreachable end @@ -3995,7 +3937,7 @@ i32.gt_u if local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u @@ -4003,7 +3945,7 @@ i32.const 0 i32.const 1912 i32.const 13 - i32.const 64 + i32.const 72 call $~lib/env/abort unreachable end @@ -4014,15 +3956,9 @@ local.get $2 i32.shl local.set $4 - block $~lib/runtime/REALLOCATE|inlined.0 (result i32) - local.get $3 - local.set $6 - local.get $4 - local.set $5 - local.get $6 - local.get $5 - call $~lib/runtime/reallocate - end + local.get $3 + local.get $4 + call $~lib/runtime/runtime.reallocate local.set $5 local.get $5 local.get $3 @@ -4155,7 +4091,6 @@ (local $11 i32) (local $12 i32) (local $13 i32) - (local $14 i32) local.get $0 i32.const 0 i32.ne @@ -4163,7 +4098,7 @@ if i32.const 0 i32.const 216 - i32.const 350 + i32.const 351 i32.const 4 call $~lib/env/abort unreachable @@ -4171,17 +4106,11 @@ local.get $2 i32.eqz if - block $~lib/runtime/MAKEARRAY<~lib/string/String>|inlined.0 (result i32) - i32.const 0 - local.set $4 - i32.const 0 - local.set $3 - local.get $4 - i32.const 2 - i32.const 2 - local.get $3 - call $~lib/runtime/makeArray - end + i32.const 0 + i32.const 2 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray return end local.get $1 @@ -4193,7 +4122,7 @@ i32.const 2 i32.const 2 i32.const 0 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray local.set $3 local.get $3 i32.load offset=4 @@ -4231,17 +4160,11 @@ local.get $6 i32.eqz if - block $~lib/runtime/MAKEARRAY<~lib/string/String>|inlined.1 (result i32) - i32.const 0 - local.set $3 - i32.const 0 - local.set $4 - local.get $3 - i32.const 2 - i32.const 2 - local.get $4 - call $~lib/runtime/makeArray - end + i32.const 0 + i32.const 1 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray return end local.get $6 @@ -4253,17 +4176,11 @@ i32.lt_s select local.set $6 - block $~lib/runtime/MAKEARRAY<~lib/string/String>|inlined.2 (result i32) - local.get $6 - local.set $3 - i32.const 0 - local.set $4 - local.get $3 - i32.const 2 - i32.const 2 - local.get $4 - call $~lib/runtime/makeArray - end + local.get $6 + i32.const 2 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray local.set $4 local.get $4 i32.load offset=4 @@ -4278,18 +4195,8 @@ i32.eqz br_if $break|0 block - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.7 (result i32) - block $~lib/runtime/ALLOCATE|inlined.7 (result i32) - i32.const 2 - local.set $9 - local.get $9 - call $~lib/runtime/allocate - end - local.set $8 - local.get $8 - i32.const 1 - call $~lib/runtime/register - end + i32.const 2 + call $~lib/runtime/runtime.allocate local.set $8 local.get $8 local.get $0 @@ -4307,6 +4214,10 @@ local.get $8 i32.store local.get $8 + i32.const 1 + call $~lib/runtime/runtime.register + drop + local.get $8 local.get $4 call $~lib/collector/dummy/__ref_link end @@ -4325,17 +4236,11 @@ local.get $6 i32.eqz if - block $~lib/runtime/MAKEARRAY<~lib/string/String>|inlined.3 (result i32) - i32.const 1 - local.set $4 - i32.const 0 - local.set $3 - local.get $4 - i32.const 2 - i32.const 2 - local.get $3 - call $~lib/runtime/makeArray - end + i32.const 1 + i32.const 2 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray local.set $3 local.get $3 i32.load offset=4 @@ -4345,24 +4250,18 @@ return end end - block $~lib/runtime/MAKEARRAY<~lib/string/String>|inlined.4 (result i32) - i32.const 0 - local.set $4 - i32.const 0 - local.set $3 - local.get $4 - i32.const 2 - i32.const 2 - local.get $3 - call $~lib/runtime/makeArray - end + i32.const 0 + i32.const 2 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray + local.set $9 + i32.const 0 local.set $10 i32.const 0 local.set $11 i32.const 0 local.set $12 - i32.const 0 - local.set $13 block $break|1 loop $continue|1 local.get $0 @@ -4373,33 +4272,29 @@ else unreachable end - local.get $12 + local.get $11 call $~lib/string/String#indexOf - local.tee $11 + local.tee $10 i32.const -1 i32.ne if block + local.get $10 local.get $11 - local.get $12 i32.sub local.set $3 local.get $3 i32.const 0 i32.gt_s if - block $~lib/runtime/ALLOCATE|inlined.8 (result i32) - local.get $3 - i32.const 1 - i32.shl - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $3 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $4 local.get $4 local.get $0 - local.get $12 + local.get $11 i32.const 1 i32.shl i32.add @@ -4407,55 +4302,45 @@ i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $10 - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.8 (result i32) - local.get $4 - local.set $5 - local.get $5 - i32.const 1 - call $~lib/runtime/register - end + local.get $9 + local.get $4 + i32.const 1 + call $~lib/runtime/runtime.register call $~lib/array/Array<~lib/string/String>#push drop else - local.get $10 + local.get $9 i32.const 416 call $~lib/array/Array<~lib/string/String>#push drop end - local.get $13 + local.get $12 i32.const 1 i32.add - local.tee $13 + local.tee $12 local.get $2 i32.eq if - local.get $10 + local.get $9 return end - local.get $11 + local.get $10 local.get $7 i32.add - local.set $12 + local.set $11 end br $continue|1 end end end - local.get $12 + local.get $11 i32.eqz if - block $~lib/runtime/MAKEARRAY<~lib/string/String>|inlined.5 (result i32) - i32.const 1 - local.set $4 - i32.const 0 - local.set $3 - local.get $4 - i32.const 2 - i32.const 2 - local.get $3 - call $~lib/runtime/makeArray - end + i32.const 1 + i32.const 2 + i32.const 2 + i32.const 0 + call $~lib/runtime/runtime.makeArray local.set $3 local.get $3 i32.const 0 @@ -4465,49 +4350,41 @@ return end local.get $6 - local.get $12 + local.get $11 i32.sub - local.set $14 - local.get $14 + local.set $13 + local.get $13 i32.const 0 i32.gt_s if - block $~lib/runtime/ALLOCATE|inlined.9 (result i32) - local.get $14 - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/runtime/allocate - end + local.get $13 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $3 local.get $3 local.get $0 - local.get $12 + local.get $11 i32.const 1 i32.shl i32.add - local.get $14 + local.get $13 i32.const 1 i32.shl call $~lib/memory/memory.copy - local.get $10 - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.9 (result i32) - local.get $3 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $9 + local.get $3 + i32.const 1 + call $~lib/runtime/runtime.register call $~lib/array/Array<~lib/string/String>#push drop else - local.get $10 + local.get $9 i32.const 416 call $~lib/array/Array<~lib/string/String>#push drop end - local.get $10 + local.get $9 ) (func $~lib/array/Array<~lib/string/String>#get:length (; 48 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 @@ -4802,40 +4679,32 @@ local.get $1 i32.add local.set $2 - block $~lib/runtime/ALLOCATE|inlined.10 (result i32) - local.get $2 - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/runtime/allocate - end - local.set $4 + local.get $2 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $3 block $~lib/util/number/utoa32_core|inlined.0 - local.get $4 + local.get $3 local.set $6 local.get $0 local.set $5 local.get $2 - local.set $3 + local.set $4 local.get $6 local.get $5 - local.get $3 + local.get $4 call $~lib/util/number/utoa32_lut end local.get $1 if - local.get $4 + local.get $3 i32.const 45 i32.store16 end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.10 (result i32) - local.get $4 - local.set $3 - local.get $3 - i32.const 1 - call $~lib/runtime/register - end + local.get $3 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/utoa32 (; 55 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) @@ -4852,34 +4721,26 @@ local.get $0 call $~lib/util/number/decimalCount32 local.set $1 - block $~lib/runtime/ALLOCATE|inlined.11 (result i32) - local.get $1 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 + local.get $1 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $2 block $~lib/util/number/utoa32_core|inlined.1 - local.get $3 + local.get $2 local.set $5 local.get $0 local.set $4 local.get $1 - local.set $2 + local.set $3 local.get $5 local.get $4 - local.get $2 + local.get $3 call $~lib/util/number/utoa32_lut end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.11 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 1 - call $~lib/runtime/register - end + local.get $2 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/decimalCount64 (; 56 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) @@ -5103,14 +4964,10 @@ local.get $2 call $~lib/util/number/decimalCount32 local.set $3 - block $~lib/runtime/ALLOCATE|inlined.12 (result i32) - local.get $3 - i32.const 1 - i32.shl - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $3 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $1 block $~lib/util/number/utoa32_core|inlined.2 local.get $1 @@ -5128,14 +4985,10 @@ local.get $0 call $~lib/util/number/decimalCount64 local.set $3 - block $~lib/runtime/ALLOCATE|inlined.13 (result i32) - local.get $3 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end + local.get $3 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $1 block $~lib/util/number/utoa64_core|inlined.0 local.get $1 @@ -5150,13 +5003,9 @@ call $~lib/util/number/utoa64_lut end end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.12 (result i32) - local.get $1 - local.set $3 - local.get $3 - i32.const 1 - call $~lib/runtime/register - end + local.get $1 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/util/number/itoa64 (; 59 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) @@ -5197,14 +5046,10 @@ local.get $1 i32.add local.set $4 - block $~lib/runtime/ALLOCATE|inlined.14 (result i32) - local.get $4 - i32.const 1 - i32.shl - local.set $5 - local.get $5 - call $~lib/runtime/allocate - end + local.get $4 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $2 block $~lib/util/number/utoa32_core|inlined.3 local.get $2 @@ -5224,14 +5069,10 @@ local.get $1 i32.add local.set $4 - block $~lib/runtime/ALLOCATE|inlined.15 (result i32) - local.get $4 - i32.const 1 - i32.shl - local.set $3 - local.get $3 - call $~lib/runtime/allocate - end + local.get $4 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate local.set $2 block $~lib/util/number/utoa64_core|inlined.1 local.get $2 @@ -5252,13 +5093,9 @@ i32.const 45 i32.store16 end - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.13 (result i32) - local.get $2 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $2 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/builtins/isFinite (; 60 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 @@ -6664,7 +6501,7 @@ if i32.const 0 i32.const 216 - i32.const 189 + i32.const 190 i32.const 4 call $~lib/env/abort unreachable @@ -6753,12 +6590,8 @@ local.get $0 return end - block $~lib/runtime/ALLOCATE|inlined.17 (result i32) - local.get $3 - local.set $4 - local.get $4 - call $~lib/runtime/allocate - end + local.get $3 + call $~lib/runtime/runtime.allocate local.set $10 local.get $10 local.get $0 @@ -6766,15 +6599,11 @@ i32.add local.get $3 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.14 (result i32) - local.get $10 - local.set $4 - local.get $4 - i32.const 1 - call $~lib/runtime/register - end + local.get $10 + i32.const 1 + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/discard (; 70 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/runtime.discard (; 70 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -6783,8 +6612,8 @@ if i32.const 0 i32.const 120 - i32.const 177 - i32.const 4 + i32.const 132 + i32.const 6 call $~lib/env/abort unreachable end @@ -6800,8 +6629,8 @@ if i32.const 0 i32.const 120 - i32.const 179 - i32.const 4 + i32.const 134 + i32.const 6 call $~lib/env/abort unreachable end @@ -6812,7 +6641,6 @@ (local $1 i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $0 f64.const 0 f64.eq @@ -6838,31 +6666,23 @@ select return end - block $~lib/runtime/ALLOCATE|inlined.16 (result i32) - i32.const 28 - i32.const 1 - i32.shl - local.set $1 - local.get $1 - call $~lib/runtime/allocate - end - local.set $2 - local.get $2 + i32.const 28 + i32.const 1 + i32.shl + call $~lib/runtime/runtime.allocate + local.set $1 + local.get $1 local.get $0 call $~lib/util/number/dtoa_core - local.set $3 - local.get $2 + local.set $2 + local.get $1 i32.const 0 - local.get $3 + local.get $2 call $~lib/string/String#substring - local.set $4 - block $~lib/runtime/DISCARD|inlined.0 - local.get $2 - local.set $1 - local.get $1 - call $~lib/runtime/discard - end - local.get $4 + local.set $3 + local.get $1 + call $~lib/runtime/runtime.discard + local.get $3 ) (func $start:std/string (; 72 ;) (type $FUNCSIG$v) (local $0 i32) diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 5eb2f0e9..15411804 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -115,7 +115,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const 1 i32.const 32 @@ -136,7 +136,7 @@ i32.const 8 i32.add ) - (func $~lib/runtime/register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 i32.const 700 @@ -144,8 +144,8 @@ if i32.const 0 i32.const 72 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -159,8 +159,8 @@ if i32.const 0 i32.const 72 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -388,19 +388,19 @@ if i32.const 0 i32.const 112 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end local.get $0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 local.get $0 call $~lib/memory/memory.fill local.get $1 i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/map/Map<~lib/string/String,usize>#clear (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 @@ -427,9 +427,9 @@ (func $~lib/map/Map<~lib/string/String,usize>#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -455,9 +455,9 @@ (func $~lib/map/Map#constructor (; 8 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $0 i32.const 0 i32.store @@ -2266,7 +2266,7 @@ return end local.get $2 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $2 local.get $0 local.get $1 @@ -2279,7 +2279,7 @@ call $~lib/memory/memory.copy local.get $2 i32.const 1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) (func $~lib/string/String.__concat (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index b702816a..d481dfbd 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -44,7 +44,7 @@ (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741816)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741816)) (global $~lib/symbol/idToString (mut i32) (i32.const 0)) (global $std/symbol/sym3 (mut i32) (i32.const 0)) (global $std/symbol/sym4 (mut i32) (i32.const 0)) @@ -79,7 +79,7 @@ end local.get $2 ) - (func $~lib/runtime/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -175,10 +175,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -191,7 +191,7 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -200,8 +200,8 @@ if i32.const 0 i32.const 72 - i32.const 153 - i32.const 4 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -217,8 +217,8 @@ if i32.const 0 i32.const 72 - i32.const 155 - i32.const 4 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -486,36 +486,27 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 i32.const 112 - i32.const 25 - i32.const 43 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 3 - call $~lib/runtime/register - end + local.get $2 + i32.const 3 + call $~lib/runtime/runtime.register ) (func $~lib/map/Map<~lib/string/String,usize>#clear (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 @@ -549,9 +540,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -609,9 +600,9 @@ i32.eqz if i32.const 24 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -2988,7 +2979,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $1 i32.const 0 i32.eq @@ -3017,30 +3007,22 @@ i32.const 160 return end - block $~lib/runtime/ALLOCATE|inlined.1 (result i32) - local.get $4 - local.set $5 - local.get $5 - call $~lib/runtime/allocate - end - local.set $6 - local.get $6 + local.get $4 + call $~lib/runtime/runtime.allocate + local.set $5 + local.get $5 local.get $0 local.get $2 call $~lib/memory/memory.copy - local.get $6 + local.get $5 local.get $2 i32.add local.get $1 local.get $3 call $~lib/memory/memory.copy - block $~lib/runtime/REGISTER<~lib/string/String>|inlined.0 (result i32) - local.get $6 - local.set $5 - local.get $5 - i32.const 1 - call $~lib/runtime/register - end + local.get $5 + i32.const 1 + call $~lib/runtime/runtime.register ) (func $~lib/string/String.__concat (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 36d42c47..268c5b72 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -35,10 +35,10 @@ (memory $0 1) (data (i32.const 8) "\01\00\00\00\"") (data (i32.const 24) "s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 64) "\01\00\00\00\1e") - (data (i32.const 80) "~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") - (data (i32.const 112) "\01\00\00\00&") - (data (i32.const 128) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 64) "\01\00\00\00&") + (data (i32.const 80) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 120) "\01\00\00\00\1e") + (data (i32.const 136) "~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") (data (i32.const 168) "\01\00\00\00$") (data (i32.const 184) "~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s") (data (i32.const 224) "\02\00\00\00\05") @@ -93,7 +93,7 @@ (data (i32.const 1336) "\01\00\00\00V") (data (i32.const 1352) "T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h") (table $0 130 funcref) - (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/string/String~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) + (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/string/String~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $std/typedarray/arr (mut i32) (i32.const 0)) @@ -182,7 +182,7 @@ global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/runtime/allocate (; 3 ;) (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 @@ -434,16 +434,16 @@ end end ) - (func $~lib/runtime/register (; 5 ;) (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 1440 i32.le_u if i32.const 0 - i32.const 80 - i32.const 153 - i32.const 4 + i32.const 136 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -456,9 +456,9 @@ i32.ne if i32.const 0 - i32.const 80 - i32.const 155 - i32.const 4 + i32.const 136 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -474,23 +474,23 @@ i32.gt_u if i32.const 0 - i32.const 128 - i32.const 25 - i32.const 43 + i32.const 80 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end local.get $0 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.tee $1 i32.const 0 local.get $0 call $~lib/memory/memory.fill local.get $1 i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/ArrayBufferView~iterate (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/arraybuffer/ArrayBufferView~iterate (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) local.get $0 i32.load local.tee $0 @@ -500,7 +500,7 @@ call_indirect (type $FUNCSIG$vi) end ) - (func $~lib/runtime/ArrayBufferView#constructor (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $1 i32.const 1073741808 local.get $2 @@ -509,8 +509,8 @@ if i32.const 0 i32.const 80 - i32.const 236 - i32.const 57 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -524,9 +524,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -554,102 +554,102 @@ ) (func $~lib/typedarray/Int8Array#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Uint8Array#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Uint8ClampedArray#constructor (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Int16Array#constructor (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 1 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Uint16Array#constructor (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 1 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Int32Array#constructor (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Uint32Array#constructor (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Int64Array#constructor (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 3 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Uint64Array#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 12 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 3 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Float32Array#constructor (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $~lib/typedarray/Float64Array#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 14 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.get $0 i32.const 3 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor ) (func $std/typedarray/testInstantiate (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) (local $1 i32) @@ -1125,7 +1125,7 @@ if i32.const 0 i32.const 184 - i32.const 442 + i32.const 443 i32.const 63 call $~lib/env/abort unreachable @@ -1149,7 +1149,7 @@ if i32.const 0 i32.const 184 - i32.const 436 + i32.const 437 i32.const 63 call $~lib/env/abort unreachable @@ -1221,9 +1221,7 @@ end local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $2 local.get $0 i32.load offset=4 @@ -1253,6 +1251,8 @@ i32.shl i32.store offset=8 local.get $2 + i32.const 9 + call $~lib/runtime/runtime.register ) (func $~lib/typedarray/Float64Array#__set (; 24 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) local.get $1 @@ -1264,7 +1264,7 @@ if i32.const 0 i32.const 184 - i32.const 852 + i32.const 853 i32.const 63 call $~lib/env/abort unreachable @@ -1337,9 +1337,7 @@ end local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 14 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $2 local.get $0 i32.load offset=4 @@ -1369,6 +1367,8 @@ i32.shl i32.store offset=8 local.get $2 + i32.const 14 + call $~lib/runtime/runtime.register ) (func $~lib/util/sort/insertionSort (; 26 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -1807,7 +1807,7 @@ if i32.const 0 i32.const 184 - i32.const 846 + i32.const 847 i32.const 63 call $~lib/env/abort unreachable @@ -1828,7 +1828,7 @@ if i32.const 0 i32.const 184 - i32.const 196 + i32.const 197 i32.const 44 call $~lib/env/abort unreachable @@ -1860,7 +1860,7 @@ if i32.const 0 i32.const 184 - i32.const 190 + i32.const 191 i32.const 44 call $~lib/env/abort unreachable @@ -1879,7 +1879,7 @@ if i32.const 0 i32.const 184 - i32.const 32 + i32.const 33 i32.const 44 call $~lib/env/abort unreachable @@ -3005,21 +3005,21 @@ end end ) - (func $~lib/runtime/makeArray (; 38 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 38 ;) (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/allocate + call $~lib/runtime/runtime.allocate local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $1 local.get $0 local.get $2 i32.shl local.tee $4 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.tee $2 local.set $5 local.get $1 @@ -3054,7 +3054,7 @@ if i32.const 0 i32.const 184 - i32.const 26 + i32.const 27 i32.const 44 call $~lib/env/abort unreachable @@ -3183,9 +3183,7 @@ end local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $2 local.get $0 i32.load offset=4 @@ -3211,6 +3209,8 @@ i32.sub i32.store offset=8 local.get $2 + i32.const 4 + call $~lib/runtime/runtime.register ) (func $~lib/typedarray/Int32Array#fill (; 43 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (local $4 i32) @@ -3439,7 +3439,7 @@ if i32.const 0 i32.const 184 - i32.const 114 + i32.const 115 i32.const 44 call $~lib/env/abort unreachable @@ -3562,7 +3562,7 @@ if i32.const 0 i32.const 184 - i32.const 278 + i32.const 279 i32.const 63 call $~lib/env/abort unreachable @@ -3658,7 +3658,7 @@ if i32.const 0 i32.const 184 - i32.const 360 + i32.const 361 i32.const 63 call $~lib/env/abort unreachable @@ -3825,7 +3825,7 @@ if i32.const 0 i32.const 184 - i32.const 524 + i32.const 525 i32.const 63 call $~lib/env/abort unreachable @@ -3879,7 +3879,7 @@ if i32.const 0 i32.const 184 - i32.const 606 + i32.const 607 i32.const 63 call $~lib/env/abort unreachable @@ -3979,7 +3979,7 @@ if i32.const 0 i32.const 184 - i32.const 688 + i32.const 689 i32.const 63 call $~lib/env/abort unreachable @@ -4033,7 +4033,7 @@ if i32.const 0 i32.const 184 - i32.const 770 + i32.const 771 i32.const 63 call $~lib/env/abort unreachable @@ -5023,7 +5023,7 @@ if i32.const 0 i32.const 184 - i32.const 108 + i32.const 109 i32.const 44 call $~lib/env/abort unreachable @@ -5261,7 +5261,7 @@ if i32.const 0 i32.const 184 - i32.const 272 + i32.const 273 i32.const 63 call $~lib/env/abort unreachable @@ -5397,7 +5397,7 @@ if i32.const 0 i32.const 184 - i32.const 354 + i32.const 355 i32.const 63 call $~lib/env/abort unreachable @@ -5646,7 +5646,7 @@ if i32.const 0 i32.const 184 - i32.const 518 + i32.const 519 i32.const 63 call $~lib/env/abort unreachable @@ -5787,7 +5787,7 @@ if i32.const 0 i32.const 184 - i32.const 600 + i32.const 601 i32.const 63 call $~lib/env/abort unreachable @@ -5923,7 +5923,7 @@ if i32.const 0 i32.const 184 - i32.const 682 + i32.const 683 i32.const 63 call $~lib/env/abort unreachable @@ -6064,7 +6064,7 @@ if i32.const 0 i32.const 184 - i32.const 764 + i32.const 765 i32.const 63 call $~lib/env/abort unreachable @@ -10414,9 +10414,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -10453,6 +10451,8 @@ i32.sub i32.store offset=8 local.get $1 + i32.const 5 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 242 ;) (type $FUNCSIG$v) (local $0 i32) @@ -10606,9 +10606,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -10645,6 +10643,8 @@ i32.sub i32.store offset=8 local.get $1 + i32.const 6 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 244 ;) (type $FUNCSIG$v) (local $0 i32) @@ -10854,9 +10854,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -10897,6 +10895,8 @@ i32.shl i32.store offset=8 local.get $1 + i32.const 7 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 247 ;) (type $FUNCSIG$v) (local $0 i32) @@ -11112,9 +11112,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -11155,6 +11153,8 @@ i32.shl i32.store offset=8 local.get $1 + i32.const 8 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 250 ;) (type $FUNCSIG$v) (local $0 i32) @@ -11497,9 +11497,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -11540,6 +11538,8 @@ i32.shl i32.store offset=8 local.get $1 + i32.const 10 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> (; 254 ;) (type $FUNCSIG$v) (local $0 i32) @@ -11743,9 +11743,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -11786,6 +11784,8 @@ i32.shl i32.store offset=8 local.get $1 + i32.const 11 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 257 ;) (type $FUNCSIG$v) (local $0 i32) @@ -11938,9 +11938,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 12 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -11981,6 +11979,8 @@ i32.shl i32.store offset=8 local.get $1 + i32.const 12 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> (; 259 ;) (type $FUNCSIG$v) (local $0 i32) @@ -12187,9 +12187,7 @@ select local.set $3 i32.const 12 - call $~lib/runtime/allocate - i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.allocate local.set $1 local.get $0 i32.load offset=4 @@ -12230,6 +12228,8 @@ i32.shl i32.store offset=8 local.get $1 + i32.const 13 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 262 ;) (type $FUNCSIG$v) (local $0 i32) @@ -12953,7 +12953,7 @@ i32.const 16 i32.const 0 i32.const 240 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -12974,7 +12974,7 @@ i32.const 16 i32.const 0 i32.const 312 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -12995,7 +12995,7 @@ i32.const 16 i32.const 0 i32.const 336 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13016,7 +13016,7 @@ i32.const 16 i32.const 0 i32.const 360 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13037,7 +13037,7 @@ i32.const 16 i32.const 0 i32.const 384 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13103,7 +13103,7 @@ i32.const 16 i32.const 0 i32.const 408 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13119,7 +13119,7 @@ i32.const 16 i32.const 0 i32.const 432 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -13163,7 +13163,7 @@ i32.const 18 i32.const 2 i32.const 456 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13184,7 +13184,7 @@ i32.const 18 i32.const 2 i32.const 496 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13205,7 +13205,7 @@ i32.const 18 i32.const 2 i32.const 536 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13226,7 +13226,7 @@ i32.const 18 i32.const 2 i32.const 576 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13247,7 +13247,7 @@ i32.const 18 i32.const 2 i32.const 616 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13315,7 +13315,7 @@ i32.const 18 i32.const 2 i32.const 656 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -13331,7 +13331,7 @@ i32.const 18 i32.const 2 i32.const 688 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if diff --git a/tests/compiler/std/typedarray.ts b/tests/compiler/std/typedarray.ts index 914cda37..7283275e 100644 --- a/tests/compiler/std/typedarray.ts +++ b/tests/compiler/std/typedarray.ts @@ -193,9 +193,9 @@ assert(sub32.byteLength == 3 * sizeof()); assert(isInt32ArrayEqual(sub32, [0, 0, 0])); assert(isInt32ArrayEqual(arr32, [1, 0, 0, 0, 2])); -import { MAX_BYTELENGTH } from "runtime"; +import { runtime } from "runtime"; -const MAX_F64LENGTH = MAX_BYTELENGTH >> alignof(); +const MAX_F64LENGTH = runtime.MAX_BYTELENGTH >> alignof(); new Float64Array(MAX_F64LENGTH); // 1GB // new Float64Array(MAX_F64 + 1); // throws diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 69509e59..e81c8f39 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -37,8 +37,8 @@ (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 8) "\01\00\00\00\"\00\00\00\00\00\00\00\00\00\00\00s\00t\00d\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 64) "\01\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") - (data (i32.const 112) "\01\00\00\00&\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 64) "\01\00\00\00&\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 120) "\01\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00") (data (i32.const 168) "\01\00\00\00$\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00") (data (i32.const 224) "\02\00\00\00\05\00\00\00\00\00\00\00\00\00\00\00\01\01\01\04\05") (data (i32.const 248) "\01\00\00\00\1a\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") @@ -68,7 +68,7 @@ (data (i32.const 1248) "\01\00\00\00B\00\00\00\00\00\00\00\00\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00v\00a\00l\00u\00e\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") (data (i32.const 1336) "\01\00\00\00V\00\00\00\00\00\00\00\00\00\00\00T\00y\00p\00e\00d\00A\00r\00r\00a\00y\00 \00r\00e\00v\00e\00r\00s\00e\00 \00w\00i\00t\00h\00 \00b\00y\00t\00e\00O\00f\00f\00s\00e\00t\00 \00m\00i\00s\00m\00a\00t\00c\00h\00") (table $0 130 funcref) - (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/runtime/ArrayBufferView~iterate $~lib/typedarray/Int8Array~iterate $~lib/typedarray/Uint8Array~iterate $~lib/typedarray/Uint8ClampedArray~iterate $~lib/typedarray/Int16Array~iterate $~lib/typedarray/Uint16Array~iterate $~lib/typedarray/Int32Array~iterate $~lib/typedarray/Uint32Array~iterate $~lib/typedarray/Int64Array~iterate $~lib/typedarray/Uint64Array~iterate $~lib/typedarray/Float32Array~iterate $~lib/typedarray/Float64Array~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) + (elem (i32.const 0) $null $~lib/string/String~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/arraybuffer/ArrayBufferView~iterate $~lib/typedarray/Int8Array~iterate $~lib/typedarray/Uint8Array~iterate $~lib/typedarray/Uint8ClampedArray~iterate $~lib/typedarray/Int16Array~iterate $~lib/typedarray/Uint16Array~iterate $~lib/typedarray/Int32Array~iterate $~lib/typedarray/Uint32Array~iterate $~lib/typedarray/Int64Array~iterate $~lib/typedarray/Uint64Array~iterate $~lib/typedarray/Float32Array~iterate $~lib/typedarray/Float64Array~iterate $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $~lib/array/Array~iterate $std/typedarray/testReduce<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduce<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testReduceRight<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayMap<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArraySome<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayFindIndex<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int8Array,i8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8Array,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int16Array,i16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint16Array,u16>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int32Array,i32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint32Array,u32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Int64Array,i64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Uint64Array,u64>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float32Array,f32>~anonymous|1 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|0 $std/typedarray/testArrayEvery<~lib/typedarray/Float64Array,f64>~anonymous|1 $std/typedarray/testArrayForEach<~lib/typedarray/Int8Array,i8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8Array,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint8ClampedArray,u8>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int16Array,i16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint16Array,u16>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int32Array,i32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint32Array,u32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Int64Array,i64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Uint64Array,u64>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float32Array,f32>~anonymous|0 $std/typedarray/testArrayForEach<~lib/typedarray/Float64Array,f64>~anonymous|0) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT i32 (i32.const 1)) @@ -81,7 +81,7 @@ (global $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32 (i32.const 4)) (global $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT i32 (i32.const 8)) (global $~lib/runtime/HEADER_SIZE i32 (i32.const 16)) - (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741808)) + (global $~lib/runtime/runtime.MAX_BYTELENGTH i32 (i32.const 1073741808)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) @@ -113,7 +113,7 @@ (func $~lib/string/String~iterate (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) ) - (func $~lib/runtime/ADJUSTOBLOCK (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -209,10 +209,10 @@ call $~lib/allocator/arena/__mem_allocate return ) - (func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUSTOBLOCK + call $~lib/runtime/runtime.adjust call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -494,7 +494,7 @@ (func $~lib/collector/dummy/__ref_register (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) nop ) - (func $~lib/runtime/register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/runtime/runtime.register (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 global.get $~lib/memory/HEAP_BASE @@ -502,9 +502,9 @@ i32.eqz if i32.const 0 - i32.const 80 - i32.const 153 - i32.const 4 + i32.const 136 + i32.const 145 + i32.const 6 call $~lib/env/abort unreachable end @@ -519,9 +519,9 @@ i32.eqz if i32.const 0 - i32.const 80 - i32.const 155 - i32.const 4 + i32.const 136 + i32.const 147 + i32.const 6 call $~lib/env/abort unreachable end @@ -534,38 +534,29 @@ ) (func $~lib/arraybuffer/ArrayBuffer#constructor (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH i32.gt_u if i32.const 0 - i32.const 128 - i32.const 25 - i32.const 43 + i32.const 80 + i32.const 53 + i32.const 51 call $~lib/env/abort unreachable end - block $~lib/runtime/ALLOCATE|inlined.0 (result i32) - local.get $1 - local.set $2 - local.get $2 - call $~lib/runtime/allocate - end - local.set $3 - local.get $3 + local.get $1 + call $~lib/runtime/runtime.allocate + local.set $2 + local.get $2 i32.const 0 local.get $1 call $~lib/memory/memory.fill - block $~lib/runtime/REGISTER<~lib/arraybuffer/ArrayBuffer>|inlined.0 (result i32) - local.get $3 - local.set $2 - local.get $2 - i32.const 2 - call $~lib/runtime/register - end + local.get $2 + i32.const 2 + call $~lib/runtime/runtime.register ) - (func $~lib/runtime/ArrayBufferView~iterate (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/arraybuffer/ArrayBufferView~iterate (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 i32.load @@ -585,21 +576,21 @@ (func $~lib/collector/dummy/__ref_unlink (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) nop ) - (func $~lib/runtime/ArrayBufferView#constructor (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 14 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) local.get $1 - global.get $~lib/runtime/MAX_BYTELENGTH + global.get $~lib/runtime/runtime.MAX_BYTELENGTH local.get $2 i32.shr_u i32.gt_u if i32.const 0 i32.const 80 - i32.const 236 - i32.const 57 + i32.const 11 + i32.const 65 call $~lib/env/abort unreachable end @@ -615,9 +606,9 @@ i32.eqz if i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 3 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $0 end local.get $0 @@ -665,7 +656,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Int8Array#constructor (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -673,36 +664,36 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 4 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) - (func $~lib/runtime/ArrayBufferView#get:byteOffset (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#get:byteOffset (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=4 local.get $0 i32.load i32.sub ) - (func $~lib/runtime/ArrayBufferView#get:byteLength (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/arraybuffer/ArrayBufferView#get:byteLength (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=8 ) (func $~lib/typedarray/Int8Array#get:length (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength ) (func $~lib/typedarray/Uint8Array~iterate (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Uint8Array#constructor (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -710,25 +701,25 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 5 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Uint8Array#get:length (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength ) (func $~lib/typedarray/Uint8ClampedArray~iterate (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Uint8ClampedArray#constructor (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -736,25 +727,25 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 6 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 0 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Uint8ClampedArray#get:length (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength ) (func $~lib/typedarray/Int16Array~iterate (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Int16Array#constructor (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -762,19 +753,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 7 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 1 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Int16Array#get:length (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 1 i32.shr_u ) @@ -782,7 +773,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Uint16Array#constructor (; 30 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -790,19 +781,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 8 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 1 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Uint16Array#get:length (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 1 i32.shr_u ) @@ -810,7 +801,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Int32Array#constructor (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -818,19 +809,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 9 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Int32Array#get:length (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 2 i32.shr_u ) @@ -838,7 +829,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Uint32Array#constructor (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -846,19 +837,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 10 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Uint32Array#get:length (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 2 i32.shr_u ) @@ -866,7 +857,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Int64Array#constructor (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -874,19 +865,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 11 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 3 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Int64Array#get:length (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 3 i32.shr_u ) @@ -894,7 +885,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Uint64Array#constructor (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -902,19 +893,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 12 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 3 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Uint64Array#get:length (; 43 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 3 i32.shr_u ) @@ -922,7 +913,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Float32Array#constructor (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -930,19 +921,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 13 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 2 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Float32Array#get:length (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 2 i32.shr_u ) @@ -950,7 +941,7 @@ (local $2 i32) local.get $0 local.get $1 - call $~lib/runtime/ArrayBufferView~iterate + call $~lib/arraybuffer/ArrayBufferView~iterate ) (func $~lib/typedarray/Float64Array#constructor (; 48 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 @@ -958,19 +949,19 @@ local.get $0 else i32.const 12 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 14 - call $~lib/runtime/register + call $~lib/runtime/runtime.register end local.get $1 i32.const 3 - call $~lib/runtime/ArrayBufferView#constructor + call $~lib/arraybuffer/ArrayBufferView#constructor local.set $0 local.get $0 ) (func $~lib/typedarray/Float64Array#get:length (; 49 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 3 i32.shr_u ) @@ -991,7 +982,7 @@ call $~lib/typedarray/Int8Array#constructor local.set $1 local.get $1 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1004,7 +995,7 @@ unreachable end local.get $1 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32.mul @@ -1036,7 +1027,7 @@ call $~lib/typedarray/Uint8Array#constructor local.set $2 local.get $2 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1049,7 +1040,7 @@ unreachable end local.get $2 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32.mul @@ -1081,7 +1072,7 @@ call $~lib/typedarray/Uint8ClampedArray#constructor local.set $3 local.get $3 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1094,7 +1085,7 @@ unreachable end local.get $3 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32.mul @@ -1126,7 +1117,7 @@ call $~lib/typedarray/Int16Array#constructor local.set $4 local.get $4 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1139,7 +1130,7 @@ unreachable end local.get $4 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Int16Array.BYTES_PER_ELEMENT i32.mul @@ -1171,7 +1162,7 @@ call $~lib/typedarray/Uint16Array#constructor local.set $5 local.get $5 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1184,7 +1175,7 @@ unreachable end local.get $5 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Uint16Array.BYTES_PER_ELEMENT i32.mul @@ -1216,7 +1207,7 @@ call $~lib/typedarray/Int32Array#constructor local.set $6 local.get $6 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1229,7 +1220,7 @@ unreachable end local.get $6 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Int32Array.BYTES_PER_ELEMENT i32.mul @@ -1261,7 +1252,7 @@ call $~lib/typedarray/Uint32Array#constructor local.set $7 local.get $7 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1274,7 +1265,7 @@ unreachable end local.get $7 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Uint32Array.BYTES_PER_ELEMENT i32.mul @@ -1306,7 +1297,7 @@ call $~lib/typedarray/Int64Array#constructor local.set $8 local.get $8 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1319,7 +1310,7 @@ unreachable end local.get $8 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Int64Array.BYTES_PER_ELEMENT i32.mul @@ -1351,7 +1342,7 @@ call $~lib/typedarray/Uint64Array#constructor local.set $9 local.get $9 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1364,7 +1355,7 @@ unreachable end local.get $9 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Uint64Array.BYTES_PER_ELEMENT i32.mul @@ -1396,7 +1387,7 @@ call $~lib/typedarray/Float32Array#constructor local.set $10 local.get $10 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1409,7 +1400,7 @@ unreachable end local.get $10 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Float32Array.BYTES_PER_ELEMENT i32.mul @@ -1441,7 +1432,7 @@ call $~lib/typedarray/Float64Array#constructor local.set $11 local.get $11 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -1454,7 +1445,7 @@ unreachable end local.get $11 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength local.get $0 global.get $~lib/typedarray/Float64Array.BYTES_PER_ELEMENT i32.mul @@ -1492,7 +1483,7 @@ if i32.const 0 i32.const 184 - i32.const 442 + i32.const 443 i32.const 63 call $~lib/env/abort unreachable @@ -1516,7 +1507,7 @@ if i32.const 0 i32.const 184 - i32.const 436 + i32.const 437 i32.const 63 call $~lib/env/abort unreachable @@ -1608,18 +1599,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Int32Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.1 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 9 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -1665,6 +1646,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 9 + call $~lib/runtime/runtime.register ) (func $~lib/typedarray/Float64Array#__set (; 54 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64) local.get $1 @@ -1676,7 +1659,7 @@ if i32.const 0 i32.const 184 - i32.const 852 + i32.const 853 i32.const 63 call $~lib/env/abort unreachable @@ -1769,18 +1752,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Float64Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.2 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 14 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -1826,6 +1799,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 14 + call $~lib/runtime/runtime.register ) (func $~lib/util/sort/insertionSort (; 56 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -2376,7 +2351,7 @@ if i32.const 0 i32.const 184 - i32.const 846 + i32.const 847 i32.const 63 call $~lib/env/abort unreachable @@ -2397,7 +2372,7 @@ if i32.const 0 i32.const 184 - i32.const 196 + i32.const 197 i32.const 44 call $~lib/env/abort unreachable @@ -2429,7 +2404,7 @@ if i32.const 0 i32.const 184 - i32.const 190 + i32.const 191 i32.const 44 call $~lib/env/abort unreachable @@ -2448,7 +2423,7 @@ if i32.const 0 i32.const 184 - i32.const 32 + i32.const 33 i32.const 44 call $~lib/env/abort unreachable @@ -3988,7 +3963,7 @@ end end ) - (func $~lib/runtime/makeArray (; 71 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/runtime/runtime.makeArray (; 71 ;) (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) @@ -3996,9 +3971,9 @@ (local $8 i32) (local $9 i32) i32.const 16 - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate local.get $1 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $4 local.get $0 local.get $2 @@ -4007,9 +3982,9 @@ local.get $0 local.get $2 i32.shl - call $~lib/runtime/allocate + call $~lib/runtime/runtime.allocate i32.const 2 - call $~lib/runtime/register + call $~lib/runtime/runtime.register local.set $6 local.get $4 local.tee $7 @@ -4064,7 +4039,7 @@ if i32.const 0 i32.const 184 - i32.const 26 + i32.const 27 i32.const 44 call $~lib/env/abort unreachable @@ -4230,18 +4205,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Int8Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.3 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 4 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -4287,6 +4252,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 4 + call $~lib/runtime/runtime.register ) (func $~lib/typedarray/Int32Array#fill (; 78 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) @@ -4585,7 +4552,7 @@ if i32.const 0 i32.const 184 - i32.const 114 + i32.const 115 i32.const 44 call $~lib/env/abort unreachable @@ -4809,7 +4776,7 @@ if i32.const 0 i32.const 184 - i32.const 278 + i32.const 279 i32.const 63 call $~lib/env/abort unreachable @@ -4936,7 +4903,7 @@ if i32.const 0 i32.const 184 - i32.const 360 + i32.const 361 i32.const 63 call $~lib/env/abort unreachable @@ -5160,7 +5127,7 @@ if i32.const 0 i32.const 184 - i32.const 524 + i32.const 525 i32.const 63 call $~lib/env/abort unreachable @@ -5283,7 +5250,7 @@ if i32.const 0 i32.const 184 - i32.const 606 + i32.const 607 i32.const 63 call $~lib/env/abort unreachable @@ -5406,7 +5373,7 @@ if i32.const 0 i32.const 184 - i32.const 688 + i32.const 689 i32.const 63 call $~lib/env/abort unreachable @@ -5529,7 +5496,7 @@ if i32.const 0 i32.const 184 - i32.const 770 + i32.const 771 i32.const 63 call $~lib/env/abort unreachable @@ -7025,7 +6992,7 @@ if i32.const 0 i32.const 184 - i32.const 108 + i32.const 109 i32.const 44 call $~lib/env/abort unreachable @@ -7318,7 +7285,7 @@ if i32.const 0 i32.const 184 - i32.const 272 + i32.const 273 i32.const 63 call $~lib/env/abort unreachable @@ -7477,7 +7444,7 @@ if i32.const 0 i32.const 184 - i32.const 354 + i32.const 355 i32.const 63 call $~lib/env/abort unreachable @@ -7772,7 +7739,7 @@ if i32.const 0 i32.const 184 - i32.const 518 + i32.const 519 i32.const 63 call $~lib/env/abort unreachable @@ -7931,7 +7898,7 @@ if i32.const 0 i32.const 184 - i32.const 600 + i32.const 601 i32.const 63 call $~lib/env/abort unreachable @@ -8090,7 +8057,7 @@ if i32.const 0 i32.const 184 - i32.const 682 + i32.const 683 i32.const 63 call $~lib/env/abort unreachable @@ -8249,7 +8216,7 @@ if i32.const 0 i32.const 184 - i32.const 764 + i32.const 765 i32.const 63 call $~lib/env/abort unreachable @@ -15207,18 +15174,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Uint8Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.4 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 5 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -15264,6 +15221,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 5 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8Array,u8> (; 370 ;) (type $FUNCSIG$v) (local $0 i32) @@ -15572,18 +15531,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Uint8ClampedArray>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.5 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 6 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -15629,6 +15578,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 6 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint8ClampedArray,u8> (; 373 ;) (type $FUNCSIG$v) (local $0 i32) @@ -15937,18 +15888,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Int16Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.6 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 7 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -15994,6 +15935,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 7 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Int16Array,i16> (; 376 ;) (type $FUNCSIG$v) (local $0 i32) @@ -16308,18 +16251,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Uint16Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.7 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 8 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -16365,6 +16298,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 8 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint16Array,u16> (; 379 ;) (type $FUNCSIG$v) (local $0 i32) @@ -16895,18 +16830,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Uint32Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.8 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 10 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -16952,6 +16877,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 10 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint32Array,u32> (; 384 ;) (type $FUNCSIG$v) (local $0 i32) @@ -17254,18 +17181,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Int64Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.9 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 11 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -17311,6 +17228,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 11 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Int64Array,i64> (; 387 ;) (type $FUNCSIG$v) (local $0 i32) @@ -17616,18 +17535,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Uint64Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.10 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 12 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -17673,6 +17582,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 12 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Uint64Array,u64> (; 390 ;) (type $FUNCSIG$v) (local $0 i32) @@ -17978,18 +17889,8 @@ select local.set $3 end - block $~lib/runtime/REGISTER<~lib/typedarray/Float32Array>|inlined.0 (result i32) - block $~lib/runtime/ALLOCATE|inlined.11 (result i32) - i32.const 12 - local.set $8 - local.get $8 - call $~lib/runtime/allocate - end - local.set $7 - local.get $7 - i32.const 13 - call $~lib/runtime/register - end + i32.const 12 + call $~lib/runtime/runtime.allocate local.set $7 local.get $5 i32.load @@ -18035,6 +17936,8 @@ i32.shl i32.store offset=8 local.get $7 + i32.const 13 + call $~lib/runtime/runtime.register ) (func $std/typedarray/testArrayReverse<~lib/typedarray/Float32Array,f32> (; 393 ;) (type $FUNCSIG$v) (local $0 i32) @@ -18594,7 +18497,7 @@ unreachable end global.get $std/typedarray/arr - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 0 i32.eq i32.eqz @@ -18607,7 +18510,7 @@ unreachable end global.get $std/typedarray/arr - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 3 i32.const 4 i32.mul @@ -18682,7 +18585,7 @@ unreachable end global.get $std/typedarray/arr - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.const 4 i32.mul @@ -18697,7 +18600,7 @@ unreachable end global.get $std/typedarray/arr - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 1 i32.const 4 i32.mul @@ -18780,7 +18683,7 @@ unreachable end global.get $std/typedarray/af64 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 2 i32.const 8 i32.mul @@ -18795,7 +18698,7 @@ unreachable end global.get $std/typedarray/af64 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 4 i32.const 8 i32.mul @@ -18954,7 +18857,7 @@ i32.const 16 i32.const 0 i32.const 240 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18976,7 +18879,7 @@ i32.const 16 i32.const 0 i32.const 312 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -18998,7 +18901,7 @@ i32.const 16 i32.const 0 i32.const 336 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -19020,7 +18923,7 @@ i32.const 16 i32.const 0 i32.const 360 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -19042,7 +18945,7 @@ i32.const 16 i32.const 0 i32.const 384 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -19078,7 +18981,7 @@ unreachable end global.get $std/typedarray/sub8 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.eq i32.eqz @@ -19091,7 +18994,7 @@ unreachable end global.get $std/typedarray/sub8 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 3 i32.eq i32.eqz @@ -19108,7 +19011,7 @@ i32.const 16 i32.const 0 i32.const 408 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -19124,7 +19027,7 @@ i32.const 16 i32.const 0 i32.const 432 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt8ArrayEqual i32.eqz if @@ -19170,7 +19073,7 @@ i32.const 18 i32.const 2 i32.const 456 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19192,7 +19095,7 @@ i32.const 18 i32.const 2 i32.const 496 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19214,7 +19117,7 @@ i32.const 18 i32.const 2 i32.const 536 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19236,7 +19139,7 @@ i32.const 18 i32.const 2 i32.const 576 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19258,7 +19161,7 @@ i32.const 18 i32.const 2 i32.const 616 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19294,7 +19197,7 @@ unreachable end global.get $std/typedarray/sub32 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.const 4 i32.mul @@ -19309,7 +19212,7 @@ unreachable end global.get $std/typedarray/sub32 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 3 i32.const 4 i32.mul @@ -19328,7 +19231,7 @@ i32.const 18 i32.const 2 i32.const 656 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19344,7 +19247,7 @@ i32.const 18 i32.const 2 i32.const 688 - call $~lib/runtime/makeArray + call $~lib/runtime/runtime.makeArray call $std/typedarray/isInt32ArrayEqual i32.eqz if @@ -19420,7 +19323,7 @@ unreachable end global.get $std/typedarray/multisubarr1 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 1 i32.eq i32.eqz @@ -19433,7 +19336,7 @@ unreachable end global.get $std/typedarray/multisubarr1 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 5 i32.eq i32.eqz @@ -19478,7 +19381,7 @@ unreachable end global.get $std/typedarray/multisubarr2 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 2 i32.eq i32.eqz @@ -19491,7 +19394,7 @@ unreachable end global.get $std/typedarray/multisubarr2 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 4 i32.eq i32.eqz @@ -19536,7 +19439,7 @@ unreachable end global.get $std/typedarray/multisubarr3 - call $~lib/runtime/ArrayBufferView#get:byteOffset + call $~lib/arraybuffer/ArrayBufferView#get:byteOffset i32.const 3 i32.eq i32.eqz @@ -19549,7 +19452,7 @@ unreachable end global.get $std/typedarray/multisubarr3 - call $~lib/runtime/ArrayBufferView#get:byteLength + call $~lib/arraybuffer/ArrayBufferView#get:byteLength i32.const 3 i32.eq i32.eqz