1
0
mirror of https://github.com/fluencelabs/assemblyscript synced 2025-07-27 20:22:10 +00:00

some cleanup

This commit is contained in:
dcode
2019-04-01 22:23:11 +02:00
parent 7b99e44343
commit 1ada854830
74 changed files with 6072 additions and 3909 deletions
src
std/assembly
tests/compiler

@@ -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";

@@ -820,7 +820,7 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.abortInstance = this.resolver.resolveFunction(<FunctionPrototype>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(<FunctionPrototype>element, null);
}
@@ -828,19 +828,19 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.memoryAllocateInstance = this.resolver.resolveFunction(<FunctionPrototype>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(<FunctionPrototype>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(<FunctionPrototype>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(<FunctionPrototype>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(<FunctionPrototype>element, null);
}

@@ -1,7 +1,7 @@
/// <reference path="./collector/index.d.ts" />
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 (<u32>minCapacity > <u32>array.dataLength >>> alignLog2) {
if (<u32>minCapacity > <u32>(MAX_BYTELENGTH >>> alignLog2)) throw new RangeError(E_INVALIDLENGTH);
if (<u32>minCapacity > <u32>(runtime.MAX_BYTELENGTH >>> alignLog2)) throw new RangeError(E_INVALIDLENGTH);
let oldData = array.data;
let newByteLength = minCapacity << alignLog2;
let newData = REALLOCATE(changetype<usize>(oldData), <usize>newByteLength); // registers on move
let newData = runtime.reallocate(changetype<usize>(oldData), <usize>newByteLength); // registers on move
if (newData !== changetype<usize>(oldData)) {
array.data = changetype<ArrayBuffer>(newData); // links
array.dataStart = newData;
@@ -40,8 +40,8 @@ export class Array<T> extends ArrayBufferView {
}
static create<T>(capacity: i32 = 0): Array<T> {
if (<u32>capacity > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError(E_INVALIDLENGTH);
var array = MAKEARRAY<T>(capacity);
if (<u32>capacity > <u32>runtime.MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError(E_INVALIDLENGTH);
var array = changetype<Array<T>>(runtime.makeArray(capacity, classId<Array<T>>(), alignof<T>()));
memory.fill(array.dataStart, 0, <usize>array.dataLength);
array.length_ = 0; // !
return array;
@@ -231,7 +231,7 @@ export class Array<T> extends ArrayBufferView {
concat(other: Array<T>): Array<T> {
var thisLen = this.length_;
var otherLen = select(0, other.length_, other === null);
var out = MAKEARRAY<T>(thisLen + otherLen);
var out = changetype<Array<T>>(runtime.makeArray(thisLen + otherLen, classId<Array<T>>(), alignof<T>()));
var outStart = out.dataStart;
var thisSize = <usize>thisLen << alignof<T>();
if (isManaged<T>()) {
@@ -319,7 +319,7 @@ export class Array<T> extends ArrayBufferView {
map<U>(callbackfn: (value: T, index: i32, array: Array<T>) => U): Array<U> {
var length = this.length_;
var out = MAKEARRAY<U>(length);
var out = changetype<Array<U>>(runtime.makeArray(length, classId<Array<U>>(), alignof<U>()));
var outStart = out.dataStart;
for (let index = 0; index < min(length, this.length_); ++index) {
let value = load<T>(this.dataStart + (<usize>index << alignof<T>()));
@@ -345,7 +345,7 @@ export class Array<T> extends ArrayBufferView {
}
filter(callbackfn: (value: T, index: i32, array: Array<T>) => bool): Array<T> {
var result = MAKEARRAY<T>(0);
var result = changetype<Array<T>>(runtime.makeArray(0, classId<Array<T>>(), alignof<T>()));
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
let value = load<T>(this.dataStart + (<usize>index << alignof<T>()));
if (callbackfn(value, index, this)) result.push(value);
@@ -433,7 +433,7 @@ export class Array<T> 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<T>(length);
var slice = changetype<Array<T>>(runtime.makeArray(length, classId<Array<T>>(), alignof<T>()));
var sliceBase = slice.dataStart;
var thisBase = this.dataStart + (<usize>begin << alignof<T>());
if (isManaged<T>()) {
@@ -465,7 +465,7 @@ export class Array<T> extends ArrayBufferView {
var length = this.length_;
start = start < 0 ? max<i32>(length + start, 0) : min<i32>(start, length);
deleteCount = max<i32>(min<i32>(deleteCount, length - start), 0);
var result = MAKEARRAY<T>(deleteCount);
var result = changetype<Array<T>>(runtime.makeArray(deleteCount, classId<Array<T>>(), alignof<T>()));
var resultStart = result.dataStart;
var thisStart = this.dataStart;
var thisBase = thisStart + (<usize>start << alignof<T>());
@@ -560,7 +560,7 @@ export class Array<T> 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<T> extends ArrayBufferView {
if (estLen > offset) {
let trimmed = changetype<string>(result).substring(0, offset);
DISCARD(result);
runtime.discard(result);
return trimmed; // registered in .substring
}
return REGISTER<string>(result);
return changetype<string>(runtime.register(result, classId<string>()));
}
private join_int(separator: string = ","): string {
@@ -608,7 +608,7 @@ export class Array<T> extends ArrayBufferView {
var sepLen = separator.length;
const valueLen = (sizeof<T>() <= 4 ? 10 : 20) + i32(isSigned<T>());
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<T> extends ArrayBufferView {
offset += itoa_stream<T>(result, offset, value);
if (estLen > offset) {
let trimmed = changetype<string>(result).substring(0, offset);
DISCARD(result);
runtime.discard(result);
return trimmed; // registered in .substring
}
return REGISTER<string>(result);
return changetype<string>(runtime.register(result, classId<string>()));
}
private join_flt(separator: string = ","): string {
@@ -649,7 +649,7 @@ export class Array<T> 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<T> extends ArrayBufferView {
);
if (estLen > offset) {
let trimmed = changetype<string>(result).substring(0, offset);
DISCARD(result);
runtime.discard(result);
return trimmed; // registered in .substring
}
return REGISTER<string>(result);
return changetype<string>(runtime.register(result, classId<string>()));
}
private join_str(separator: string = ","): string {
@@ -694,7 +694,7 @@ export class Array<T> 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<string>(dataStart + (<usize>i << alignof<T>()));
if (value !== null) {
@@ -723,7 +723,7 @@ export class Array<T> extends ArrayBufferView {
<usize>changetype<string>(value).length << 1
);
}
return REGISTER<string>(result);
return changetype<string>(runtime.register(result, classId<string>()));
}
private join_arr(separator: string = ","): string {
@@ -760,7 +760,7 @@ export class Array<T> 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<T> extends ArrayBufferView {
}
if (estLen > offset) {
let out = changetype<string>(result).substring(0, offset);
DISCARD(result);
runtime.discard(result);
return out; // registered in .substring
}
return REGISTER<string>(result);
return changetype<string>(runtime.register(result, classId<string>()));
}
toString(): string {

@@ -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 (<u32>length > <u32>runtime.MAX_BYTELENGTH >>> alignLog2) throw new RangeError(E_INVALIDLENGTH);
var buffer = new ArrayBuffer(length = length << alignLog2);
this.data = buffer;
this.dataStart = changetype<usize>(buffer);
this.dataLength = length;
}
get byteOffset(): i32 {
return <i32>(this.dataStart - changetype<usize>(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<T>(value: T): bool {
@@ -22,24 +50,24 @@ import { E_INVALIDLENGTH } from "./util/error";
}
constructor(length: i32) {
if (<u32>length > <u32>MAX_BYTELENGTH) throw new RangeError(E_INVALIDLENGTH);
var buffer = ALLOCATE(<usize>length);
if (<u32>length > <u32>runtime.MAX_BYTELENGTH) throw new RangeError(E_INVALIDLENGTH);
var buffer = runtime.allocate(<usize>length);
memory.fill(changetype<usize>(buffer), 0, <usize>length);
return REGISTER<ArrayBuffer>(buffer);
return changetype<ArrayBuffer>(runtime.register(buffer, classId<ArrayBuffer>()));
}
get byteLength(): i32 {
return changetype<HEADER>(changetype<usize>(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 = <usize>max(end - begin, 0);
var out = ALLOCATE(outSize);
var out = runtime.allocate(outSize);
memory.copy(out, changetype<usize>(this) + <usize>begin, outSize);
return REGISTER<ArrayBuffer>(out);
return changetype<ArrayBuffer>(runtime.register(out, classId<ArrayBuffer>()));
}
toString(): string {

@@ -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(<u32>byteLength > <u32>MAX_BYTELENGTH) |
i32(<u32>byteLength > <u32>runtime.MAX_BYTELENGTH) |
i32(<u32>byteOffset + byteLength > <u32>buffer.byteLength)
) throw new RangeError(E_INVALIDLENGTH);
this.data = buffer; // links

@@ -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<T> {
[key: number]: T;
constructor(length: i32) {
if (<u32>length > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError(E_INVALIDLENGTH);
if (<u32>length > <u32>runtime.MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError(E_INVALIDLENGTH);
if (isReference<T>()) {
if (!isNullable<T>()) {
if (length) throw new Error(E_HOLEYARRAY);
}
}
var outSize = <usize>length << alignof<T>();
var out = ALLOCATE(outSize);
var out = runtime.allocate(outSize);
memory.fill(out, 0, outSize);
return REGISTER<FixedArray<T>>(out);
return changetype<FixedArray<T>>(runtime.register(out, classId<FixedArray<T>>()));
}
get length(): i32 {

@@ -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<usize>(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<usize>(root));
} else if (isDefined(__ref_retain)) __ref_release(ref);
else assert(false);
else if (isDefined(__ref_release)) __ref_release(ref);
}
}
}

@@ -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,8 +45,16 @@ export declare function classId<T>(): u32;
@unsafe @builtin
export declare function iterateRoots(fn: (ref: usize) => void): void;
/** Runtime implementation. */
export namespace runtime {
/** Maximum byte length of any buffer-like object. */
// @ts-ignore
@lazy
export const MAX_BYTELENGTH: i32 = MAX_SIZE_32 - HEADER_SIZE;
/** Adjusts an allocation to actual block size. Primarily targets TLSF. */
export function ADJUSTOBLOCK(payloadSize: usize): usize {
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
@@ -59,18 +64,10 @@ export function ADJUSTOBLOCK(payloadSize: usize): usize {
return <usize>1 << <usize>(<u32>32 - clz<u32>(payloadSize + HEADER_SIZE - 1));
}
/**
* 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);
}
function allocate(payloadSize: usize): usize {
var header = changetype<HEADER>(memory.allocate(ADJUSTOBLOCK(payloadSize)));
@unsafe
export function allocate(payloadSize: usize): usize {
var header = changetype<HEADER>(memory.allocate(adjust(payloadSize)));
header.classId = HEADER_MAGIC;
header.payloadSize = payloadSize;
if (isDefined(__ref_collect)) {
@@ -80,19 +77,9 @@ function allocate(payloadSize: usize): usize {
return changetype<usize>(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 {
@unsafe
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,
@@ -100,8 +87,8 @@ function reallocate(ref: usize, newPayloadSize: usize): usize {
var header = changetype<HEADER>(ref - HEADER_SIZE);
var payloadSize = header.payloadSize;
if (payloadSize < newPayloadSize) {
let newAdjustedSize = ADJUSTOBLOCK(newPayloadSize);
if (select(ADJUSTOBLOCK(payloadSize), 0, ref > HEAP_BASE) < newAdjustedSize) {
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<HEADER>(memory.allocate(newAdjustedSize));
newHeader.classId = header.classId;
@@ -135,44 +122,9 @@ function reallocate(ref: usize, newPayloadSize: usize): usize {
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<T>(ref: usize): T {
if (!isReference<T>()) ERROR("reference expected");
return changetype<T>(register(ref, classId<T>()));
}
function register(ref: usize, classId: u32): usize {
if (!ASC_NO_ASSERT) {
assert(ref > HEAP_BASE); // must be a heap object
let header = changetype<HEADER>(ref - HEADER_SIZE);
assert(header.classId == HEADER_MAGIC);
header.classId = classId;
} else {
changetype<HEADER>(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 {
@unsafe
export function discard(ref: usize): void {
if (!ASC_NO_ASSERT) {
assert(ref > HEAP_BASE); // must be a heap object
let header = changetype<HEADER>(ref - HEADER_SIZE);
@@ -183,21 +135,27 @@ function discard(ref: usize): void {
}
}
/**
* 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<V>(capacity: i32, source: usize = 0): Array<V> {
return changetype<Array<V>>(makeArray(capacity, classId<V[]>(), alignof<V>(), source));
@unsafe
export function register(ref: usize, classId: u32): usize {
if (!ASC_NO_ASSERT) {
assert(ref > HEAP_BASE); // must be a heap object
let header = changetype<HEADER>(ref - HEADER_SIZE);
assert(header.classId == HEADER_MAGIC);
header.classId = classId;
} else {
changetype<HEADER>(ref - HEADER_SIZE).classId = classId;
}
if (isDefined(__ref_register)) __ref_register(ref);
return ref;
}
function makeArray(capacity: i32, cid: u32, alignLog2: usize, source: usize): usize {
var array = register(allocate(offsetof<i32[]>()), cid);
// @ts-ignore: decorator
@unsafe
export function makeArray(capacity: i32, cid: u32, alignLog2: usize, source: usize = 0): usize {
var array = runtime.register(runtime.allocate(offsetof<i32[]>()), cid);
var bufferSize = <usize>capacity << alignLog2;
var buffer = register(allocate(<usize>capacity << alignLog2), classId<ArrayBuffer>());
var buffer = runtime.register(runtime.allocate(<usize>capacity << alignLog2), classId<ArrayBuffer>());
changetype<ArrayBufferView>(array).data = changetype<ArrayBuffer>(buffer); // links
changetype<ArrayBufferView>(array).dataStart = buffer;
changetype<ArrayBufferView>(array).dataLength = bufferSize;
@@ -205,51 +163,4 @@ function makeArray(capacity: i32, cid: u32, alignLog2: usize, source: usize): us
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;
/** Data start offset in memory. */
// @ts-ignore: decorator
@unsafe
dataStart: usize;
/** Data length in memory, counted from `dataStart`. */
// @ts-ignore: decorator
@unsafe
dataLength: u32;
protected constructor(length: i32, alignLog2: i32) {
if (<u32>length > <u32>MAX_BYTELENGTH >>> alignLog2) throw new RangeError(E_INVALIDLENGTH);
var buffer = new ArrayBuffer(length = length << alignLog2);
this.data = buffer;
this.dataStart = changetype<usize>(buffer);
this.dataLength = length;
}
get byteOffset(): i32 {
return <i32>(this.dataStart - changetype<usize>(this.data));
}
get byteLength(): i32 {
return this.dataLength;
}
get length(): i32 {
ERROR("missing implementation: subclasses must implement ArrayBufferView#length");
return unreachable();
}
}

@@ -1,7 +1,8 @@
/// <reference path="./collector/index.d.ts" />
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<u16>(out, <u16>code);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
static fromCodePoint(code: i32): String {
assert(<u32>code <= 0x10FFFF);
var sur = code > 0xFFFF;
var out = ALLOCATE((i32(sur) + 1) << 1);
var out = runtime.allocate((i32(sur) + 1) << 1);
if (!sur) {
store<u16>(out, <u16>code);
} else {
@@ -32,15 +33,15 @@ import { E_INVALIDLENGTH } from "./util/error";
let lo: u32 = (code & 0x3FF) + 0xDC00;
store<u32>(out, (hi << 16) | lo);
}
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
@operator("[]") charAt(pos: i32): String {
assert(this !== null);
if (<u32>pos >= <u32>this.length) return changetype<String>("");
var out = ALLOCATE(2);
var out = runtime.allocate(2);
store<u16>(out, load<u16>(changetype<usize>(this) + (<usize>pos << 1)));
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
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<string>(left, "null", left !== null).concat(right);
@operator("+") private static __concat(left: String, right: String): String {
return select<String>(left, changetype<String>("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<String>("");
var out = ALLOCATE(outSize);
var out = runtime.allocate(outSize);
memory.copy(out, changetype<usize>(this), thisSize);
memory.copy(out + thisSize, changetype<usize>(other), otherSize);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
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<String>("");
var out = ALLOCATE(resultLength << 1);
var out = runtime.allocate(resultLength << 1);
memory.copy(out, changetype<usize>(this) + intStart, resultLength);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
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<String>("");
if (!fromPos && toPos == this.length << 1) return this;
var out = ALLOCATE(len);
var out = runtime.allocate(len);
memory.copy(out, changetype<usize>(this) + fromPos, len);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
trim(): String {
@@ -223,9 +224,9 @@ import { E_INVALIDLENGTH } from "./util/error";
}
if (!size) return changetype<String>("");
if (!start && size == length << 1) return this;
var out = ALLOCATE(size);
var out = runtime.allocate(size);
memory.copy(out, changetype<usize>(this) + offset, size);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
@inline
@@ -253,9 +254,9 @@ import { E_INVALIDLENGTH } from "./util/error";
if (!offset) return this;
size -= offset;
if (!size) return changetype<String>("");
var out = ALLOCATE(size);
var out = runtime.allocate(size);
memory.copy(out, changetype<usize>(this) + offset, size);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
trimEnd(): String {
@@ -272,9 +273,9 @@ import { E_INVALIDLENGTH } from "./util/error";
}
if (!size) return changetype<String>("");
if (size == originalSize) return this;
var out = ALLOCATE(size);
var out = runtime.allocate(size);
memory.copy(out, changetype<usize>(this), size);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
padStart(targetLength: i32, padString: string = " "): String {
@@ -284,7 +285,7 @@ import { E_INVALIDLENGTH } from "./util/error";
var padSize = <usize>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<usize>(padString), prependSize);
}
memory.copy(out + prependSize, changetype<usize>(this), thisSize);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
padEnd(targetLength: i32, padString: string = " "): String {
@@ -305,7 +306,7 @@ import { E_INVALIDLENGTH } from "./util/error";
var padSize = <usize>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<usize>(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<usize>(padString), appendSize);
}
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
repeat(count: i32 = 0): String {
@@ -330,9 +331,9 @@ import { E_INVALIDLENGTH } from "./util/error";
if (count == 0 || !length) return changetype<String>("");
if (count == 1) return this;
var out = ALLOCATE((length * count) << 1);
var out = runtime.allocate((length * count) << 1);
memory.repeat(out, changetype<usize>(this), <usize>length << 1, count);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
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<String>("");
var out = ALLOCATE(len << 1);
var out = runtime.allocate(len << 1);
memory.copy(out, changetype<usize>(this) + (<usize>begin << 1), <usize>len << 1);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] {
assert(this !== null);
if (!limit) return MAKEARRAY<String>(0);
if (!limit) return changetype<String[]>(runtime.makeArray(0, classId<String[]>(), alignof<String>()));
if (separator === null) return <String[]>[this];
var length: isize = this.length;
var sepLen: isize = separator.length;
if (limit < 0) limit = i32.MAX_VALUE;
if (!sepLen) {
if (!length) return MAKEARRAY<String>(0);
if (!length) return changetype<String[]>(runtime.makeArray(0, classId<String>(), alignof<String>()));
// split by chars
length = min<isize>(length, <isize>limit);
let result = MAKEARRAY<String>(length);
let result = changetype<String[]>(runtime.makeArray(length, classId<String[]>(), alignof<String>()));
let resultStart = changetype<ArrayBufferView>(result).dataStart;
for (let i: isize = 0; i < length; ++i) {
let charStr = REGISTER<String>(ALLOCATE(2));
store<u16>(changetype<usize>(charStr), load<u16>(changetype<usize>(this) + (<usize>i << 1)));
store<String>(resultStart + (<usize>i << alignof<usize>()), charStr); // result[i] = charStr
let charStr = runtime.allocate(2);
store<u16>(charStr, load<u16>(changetype<usize>(this) + (<usize>i << 1)));
store<usize>(resultStart + (<usize>i << alignof<usize>()), charStr); // result[i] = charStr
runtime.register(charStr, classId<String>());
if (isManaged<String>()) {
if (isDefined(__ref_link)) __ref_link(changetype<usize>(charStr), changetype<usize>(result));
else if (isDefined(__ref_retain)) __ref_retain(changetype<usize>(charStr));
else assert(false);
if (isDefined(__ref_retain)) __ref_retain(changetype<usize>(charStr));
}
}
return result;
} else if (!length) {
let result = MAKEARRAY<String>(1);
let result = changetype<String[]>(runtime.makeArray(1, classId<String[]>(), alignof<String>()));
store<string>(changetype<ArrayBufferView>(result).dataStart, ""); // no need to register/link
return result;
}
var result = MAKEARRAY<String>(0);
var result = changetype<String[]>(runtime.makeArray(0, classId<String[]>(), alignof<String>()));
var end = 0, start = 0, i = 0;
while ((end = this.indexOf(separator!, start)) != -1) {
let len = end - start;
if (len > 0) {
let out = ALLOCATE(<usize>len << 1);
let out = runtime.allocate(<usize>len << 1);
memory.copy(out, changetype<usize>(this) + (<usize>start << 1), <usize>len << 1);
result.push(REGISTER<String>(out));
result.push(changetype<String>(runtime.register(out, classId<String>())));
} else {
result.push(changetype<String>(""));
}
@@ -390,15 +391,15 @@ import { E_INVALIDLENGTH } from "./util/error";
start = end + sepLen;
}
if (!start) {
let result = MAKEARRAY<String>(1);
let result = changetype<String[]>(runtime.makeArray(1, classId<String[]>(), alignof<String>()));
unchecked(result[0] = this);
return result;
}
var len = length - start;
if (len > 0) {
let out = ALLOCATE(<usize>len << 1);
let out = runtime.allocate(<usize>len << 1);
memory.copy(out, changetype<usize>(this) + (<usize>start << 1), <usize>len << 1);
result.push(REGISTER<String>(out));
result.push(changetype<String>(runtime.register(out, classId<String>())));
} else {
result.push(changetype<String>(""));
}
@@ -433,8 +434,8 @@ import { E_INVALIDLENGTH } from "./util/error";
return len;
}
static fromUTF8(ptr: usize, len: usize): string {
if (len < 1) return changetype<string>("");
static fromUTF8(ptr: usize, len: usize): String {
if (len < 1) return changetype<String>("");
var ptrPos = <usize>0;
var buf = memory.allocate(<usize>len << 1);
var bufPos = <usize>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<usize>(out), buf, bufPos);
memory.free(buf);
return REGISTER<string>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
toUTF8(): usize {

@@ -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<TArray extends ArrayBufferView, T>(
else begin = min(begin, length);
if (end < 0) end = max(length + end, begin);
else end = max(min(end, length), begin);
var out = REGISTER<TArray>(ALLOCATE(offsetof<TArray>()));
var out = runtime.allocate(offsetof<TArray>());
var data = array.data;
var dataStart = array.dataStart;
changetype<ArrayBufferView>(out).data = data; // links
changetype<ArrayBufferView>(out).dataStart = dataStart + (<usize>begin << alignof<T>());
changetype<ArrayBufferView>(out).dataLength = (end - begin) << alignof<T>();
return out;
return changetype<TArray>(runtime.register(out, classId<TArray>()));
}
// @ts-ignore: decorator

@@ -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<usize>(out), value, decimals);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
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<usize>(out), value, decimals);
if (sign) store<u16>(changetype<usize>(out), CharCode.MINUS);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
export function utoa64(value: u64): String {
@@ -290,14 +291,14 @@ export function utoa64(value: u64): String {
if (value <= u32.MAX_VALUE) {
let val32 = <u32>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<usize>(out), value, decimals);
}
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
export function itoa64(value: i64): String {
@@ -310,16 +311,16 @@ export function itoa64(value: i64): String {
if (<u64>value <= <u64>u32.MAX_VALUE) {
let val32 = <u32>value;
let decimals = decimalCount32(val32) + u32(sign);
out = ALLOCATE(decimals << 1);
out = runtime.allocate(decimals << 1);
utoa32_core(changetype<usize>(out), val32, decimals);
} else {
let decimals = decimalCount64(value) + u32(sign);
out = ALLOCATE(decimals << 1);
out = runtime.allocate(decimals << 1);
utoa64_core(changetype<usize>(out), value, decimals);
}
if (sign) store<u16>(changetype<usize>(out), CharCode.MINUS);
return REGISTER<String>(out);
return changetype<String>(runtime.register(out, classId<String>()));
}
export function itoa<T extends number>(value: T): String {
@@ -624,10 +625,10 @@ export function dtoa(value: f64): String {
if (isNaN<f64>(value)) return "NaN";
return select<String>("-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<String>(temp).substring(0, length);
DISCARD(temp);
var result = changetype<String>(temp).substring(0, length); // registers
runtime.discard(temp);
return result;
}

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

File diff suppressed because it is too large Load Diff

@@ -1,5 +1,5 @@
import { link_count, unlink_count, collect_count } from "./gc/_dummy";
export { gc };
export { runtime, gc };
class Ref {}

File diff suppressed because it is too large Load Diff

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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<gc/itcm/trace/Ref | null>~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~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<gc/itcm/trace/Ref | null>~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~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

@@ -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<gc/itcm/trace/Ref | null>~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~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<gc/itcm/trace/Ref | null>~iterate $~lib/array/Array<gc/itcm/trace/Ref | null>~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
call $~lib/runtime/runtime.allocate
local.set $2
local.get $2
call $~lib/runtime/allocate
end
local.set $3
local.get $3
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
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
call $~lib/runtime/runtime.reallocate
local.set $5
local.get $5
local.get $3

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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
call $~lib/runtime/runtime.allocate
local.set $3
local.get $3
call $~lib/runtime/allocate
end
local.set $4
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
call $~lib/runtime/runtime.register
)
(func $~lib/util/number/itoa<i32> (; 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
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
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
call $~lib/runtime/runtime.allocate
local.set $1
local.get $1
call $~lib/runtime/allocate
end
local.set $2
local.get $2
local.get $0
call $~lib/util/number/dtoa_core
local.set $3
local.get $2
i32.const 0
local.get $3
call $~lib/string/String#substring
local.set $4
block $~lib/runtime/DISCARD|inlined.0
local.get $2
local.set $1
local.set $2
local.get $1
call $~lib/runtime/discard
end
local.get $4
i32.const 0
local.get $2
call $~lib/string/String#substring
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

@@ -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)

@@ -27,7 +27,7 @@
(func $optional-typeparameters/testDerived<i32,i32> (; 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

@@ -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

@@ -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

@@ -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<std/array-literal/Ref>~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

@@ -126,7 +126,7 @@
local.get $1
call $~lib/array/Array<i32>#__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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@@ -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

@@ -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
call $~lib/runtime/runtime.allocate
local.set $2
local.get $2
call $~lib/runtime/allocate
end
local.set $3
local.get $3
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
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
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
call $~lib/runtime/runtime.register
)
(func $~lib/arraybuffer/ArrayBuffer.isView<~lib/array/Array<i32>> (; 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>>
i32.eqz
i32.eqz

@@ -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

@@ -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
call $~lib/runtime/runtime.allocate
local.set $2
local.get $2
call $~lib/runtime/allocate
end
local.set $3
local.get $3
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
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

@@ -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

@@ -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

@@ -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<i8,i32>#clear (; 8 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
@@ -451,9 +451,9 @@
(func $~lib/map/Map<i8,i32>#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<u8,i32>#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<i16,i32>#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<u16,i32>#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<i32,i32>#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<u32,i32>#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<i64,i32>#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<u64,i32>#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<f32,i32>#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<f64,i32>#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

@@ -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
call $~lib/runtime/runtime.allocate
local.set $2
local.get $2
call $~lib/runtime/allocate
end
local.set $3
local.get $3
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
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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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<HEADER>(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<HEADER>(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<A>(ref4); // should call __gc_register
var ref4 = runtime.allocate(barrier1);
runtime.register(ref4, classId<A>()); // should call __gc_register
assert(register_ref == ref4);
var header4 = changetype<HEADER>(register_ref - HEADER_SIZE);
assert(header4.classId == classId<A>());
assert(header4.payloadSize == barrier1);
var ref5 = ALLOCATE(10);
var ref5 = runtime.allocate(10);
assert(changetype<ArrayBuffer>(ref5).byteLength == 10);
assert(changetype<String>(ref5).length == 5);

@@ -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
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
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
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)
call $~lib/runtime/runtime.discard
global.get $std/runtime/barrier2
local.set $0
local.get $0
call $~lib/runtime/allocate
end
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
call $~lib/runtime/runtime.allocate
global.set $std/runtime/ref4
block $~lib/runtime/REGISTER<std/runtime/A>|inlined.0 (result i32)
global.get $std/runtime/ref4
local.set $0
local.get $0
i32.const 1
call $~lib/runtime/register
end
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
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

@@ -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<i8>#clear (; 8 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
@@ -447,9 +447,9 @@
(func $~lib/set/Set<i8>#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<u8>#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<i16>#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<u16>#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<i32>#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<u32>#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<i64>#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<u64>#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<f32>#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<f64>#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

@@ -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
call $~lib/runtime/runtime.allocate
local.set $2
local.get $2
call $~lib/runtime/allocate
end
local.set $3
local.get $3
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
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

@@ -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

@@ -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<i32>#__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
call $~lib/runtime/runtime.reallocate
local.set $5
local.get $5
local.get $3

@@ -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)

@@ -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
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
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)

@@ -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,20 +3394,25 @@
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
if
i32.const 0
i32.const 2
call $~lib/runtime/runtime.makeArray
return
end
local.get $1
i32.eqz
if
i32.const 1
call $~lib/runtime/makeArray
i32.const 2
call $~lib/runtime/runtime.makeArray
local.tee $1
i32.load offset=4
local.get $0
@@ -3442,7 +3446,8 @@
i32.eqz
if
i32.const 1
call $~lib/runtime/makeArray
i32.const 2
call $~lib/runtime/runtime.makeArray
local.tee $0
i32.load offset=4
i32.const 416
@@ -3453,30 +3458,34 @@
else
local.get $3
i32.eqz
br_if $folding-inner0
if
i32.const 0
i32.const 1
call $~lib/runtime/runtime.makeArray
return
end
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.const 2
call $~lib/runtime/runtime.makeArray
local.tee $3
i32.load offset=4
local.set $3
local.set $5
i32.const 0
local.set $1
loop $repeat|0
local.get $1
local.get $2
local.get $4
i32.lt_s
if
i32.const 2
call $~lib/runtime/allocate
i32.const 1
call $~lib/runtime/register
local.tee $5
call $~lib/runtime/runtime.allocate
local.tee $2
local.get $1
i32.const 1
i32.shl
@@ -3487,10 +3496,14 @@
local.get $1
i32.const 2
i32.shl
local.get $3
i32.add
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
@@ -3498,11 +3511,12 @@
br $repeat|0
end
end
local.get $4
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
@@ -3529,7 +3543,7 @@
i32.const 1
i32.shl
local.tee $6
call $~lib/runtime/allocate
call $~lib/runtime/runtime.allocate
local.tee $9
local.get $4
i32.const 1
@@ -3541,7 +3555,7 @@
local.get $2
local.get $9
i32.const 1
call $~lib/runtime/register
call $~lib/runtime/runtime.register
call $~lib/array/Array<~lib/string/String>#push
else
local.get $2
@@ -3569,7 +3583,8 @@
i32.eqz
if
i32.const 1
call $~lib/runtime/makeArray
i32.const 2
call $~lib/runtime/runtime.makeArray
local.tee $1
i32.load offset=4
local.tee $2
@@ -3595,7 +3610,7 @@
i32.const 1
i32.shl
local.tee $1
call $~lib/runtime/allocate
call $~lib/runtime/runtime.allocate
local.tee $3
local.get $4
i32.const 1
@@ -3607,7 +3622,7 @@
local.get $2
local.get $3
i32.const 1
call $~lib/runtime/register
call $~lib/runtime/runtime.register
call $~lib/array/Array<~lib/string/String>#push
else
local.get $2
@@ -3615,10 +3630,6 @@
call $~lib/array/Array<~lib/string/String>#push
end
local.get $2
return
end
i32.const 0
call $~lib/runtime/makeArray
)
(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)

File diff suppressed because it is too large Load Diff

@@ -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<usize,~lib/string/String>#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

@@ -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
call $~lib/runtime/runtime.allocate
local.set $2
local.get $2
call $~lib/runtime/allocate
end
local.set $3
local.get $3
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
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
call $~lib/runtime/runtime.allocate
local.set $5
local.get $5
call $~lib/runtime/allocate
end
local.set $6
local.get $6
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
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

File diff suppressed because one or more lines are too long

@@ -193,9 +193,9 @@ assert(sub32.byteLength == 3 * sizeof<i32>());
assert(isInt32ArrayEqual(sub32, <i32[]>[0, 0, 0]));
assert(isInt32ArrayEqual(arr32, <i32[]>[1, 0, 0, 0, 2]));
import { MAX_BYTELENGTH } from "runtime";
import { runtime } from "runtime";
const MAX_F64LENGTH = <u32>MAX_BYTELENGTH >> alignof<f64>();
const MAX_F64LENGTH = <u32>runtime.MAX_BYTELENGTH >> alignof<f64>();
new Float64Array(MAX_F64LENGTH); // 1GB
// new Float64Array(MAX_F64 + 1); // throws

File diff suppressed because one or more lines are too long