more static array

This commit is contained in:
dcode 2019-03-16 07:26:33 +01:00
parent 058dc8d4fa
commit b8a08da7a5
10 changed files with 5328 additions and 2577 deletions

View File

@ -835,7 +835,8 @@ export class Compiler extends DiagnosticEmitter {
initializerNode,
global.type,
ConversionKind.IMPLICIT,
WrapMode.WRAP
WrapMode.WRAP,
global
);
this.currentFlow = previousFlow;
}
@ -2340,7 +2341,8 @@ export class Compiler extends DiagnosticEmitter {
expression: Expression,
contextualType: Type,
conversionKind: ConversionKind,
wrapMode: WrapMode
wrapMode: WrapMode,
context: Element | null = null
): ExpressionRef {
this.currentType = contextualType;
var expr: ExpressionRef;
@ -2387,7 +2389,7 @@ export class Compiler extends DiagnosticEmitter {
break;
}
case NodeKind.LITERAL: {
expr = this.compileLiteralExpression(<LiteralExpression>expression, contextualType);
expr = this.compileLiteralExpression(<LiteralExpression>expression, contextualType, false, context);
break;
}
case NodeKind.NEW: {
@ -6321,7 +6323,8 @@ export class Compiler extends DiagnosticEmitter {
compileLiteralExpression(
expression: LiteralExpression,
contextualType: Type,
implicitNegate: bool = false
implicitNegate: bool = false,
context: Element | null = null
): ExpressionRef {
var module = this.module;
switch (expression.literalKind) {
@ -6336,7 +6339,8 @@ export class Compiler extends DiagnosticEmitter {
assert(classType.typeArguments)[0],
(<ArrayLiteralExpression>expression).elementExpressions,
false, // TODO: isConst?
expression
expression,
context
);
}
this.error(
@ -6427,7 +6431,7 @@ export class Compiler extends DiagnosticEmitter {
return this.ensureStaticString(expression.value);
}
ensureStaticArrayBuffer(elementType: Type, values: ExpressionRef[]): ExpressionRef {
ensureStaticArrayBuffer(elementType: Type, values: ExpressionRef[]): MemorySegment {
var program = this.program;
var length = values.length;
var byteSize = elementType.byteSize;
@ -6510,156 +6514,37 @@ export class Compiler extends DiagnosticEmitter {
}
assert(pos == buf.length);
var segment = this.addMemorySegment(buf);
var offset = i64_add(segment.offset, i64_new(runtimeHeaderSize));
this.currentType = bufferInstance.type;
return program.options.isWasm64
? this.module.createI64(i64_low(offset), i64_high(offset))
: this.module.createI32(i64_low(offset));
return this.addMemorySegment(buf);
}
/** Ensures that the specified array exists in static memory and returns a pointer to it. */
// ensureStaticArray(elementType: Type, values: ExpressionRef[]): ExpressionRef {
// var program = this.program;
// var hasGC = program.hasGC;
// var gcHeaderSize = program.gcHeaderSize;
ensureStaticArrayHeader(elementType: Type, bufferSegment: MemorySegment): MemorySegment {
var program = this.program;
var runtimeHeaderSize = program.runtimeHeaderSize;
var arrayPrototype = assert(program.arrayPrototype);
var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ]));
var arrayInstanceSize = arrayInstance.currentMemoryOffset;
var bufferLength = bufferSegment.buffer.length - runtimeHeaderSize;
var arrayLength = i32(bufferLength / elementType.byteSize);
// var length = values.length;
// var byteSize = elementType.byteSize;
// var byteLength = length * byteSize;
// var usizeTypeSize = this.options.usizeType.byteSize;
var buf = new Uint8Array(runtimeHeaderSize + arrayInstanceSize);
program.writeRuntimeHeader(buf, 0, arrayInstance, arrayInstanceSize);
// var buf: Uint8Array;
// var pos: u32;
var bufferAddress32 = i64_low(bufferSegment.offset) + runtimeHeaderSize;
assert(!program.options.isWasm64); // TODO
assert(arrayInstance.writeField("data", bufferAddress32, buf, runtimeHeaderSize));
assert(arrayInstance.writeField("dataStart", bufferAddress32, buf, runtimeHeaderSize));
assert(arrayInstance.writeField("dataEnd", bufferAddress32 + bufferLength, buf, runtimeHeaderSize));
assert(arrayInstance.writeField("length_", arrayLength, buf, runtimeHeaderSize));
// // create the backing ArrayBuffer segment
// var bufferInstance = assert(program.arrayBufferInstance);
// var bufferHeaderSize = (bufferInstance.currentMemoryOffset + 7) & ~7;
// var bufferTotalSize = 1 << (32 - clz(bufferHeaderSize + byteLength - 1));
// if (hasGC) {
// buf = new Uint8Array(gcHeaderSize + bufferTotalSize);
// pos = gcHeaderSize;
// writeI32(ensureGCHook(this, bufferInstance), buf, program.gcHookOffset);
// } else {
// buf = new Uint8Array(bufferTotalSize);
// pos = 0;
// }
// writeI32(byteLength, buf, pos + bufferInstance.offsetof(LibrarySymbols.byteLength));
// pos += bufferHeaderSize;
// var nativeType = elementType.toNativeType();
// switch (nativeType) {
// case NativeType.I32: {
// switch (byteSize) {
// case 1: {
// for (let i = 0; i < length; ++i) {
// let value = values[i];
// assert(getExpressionType(value) == nativeType);
// assert(getExpressionId(value) == ExpressionId.Const);
// writeI8(getConstValueI32(value), buf, pos);
// pos += 1;
// }
// break;
// }
// case 2: {
// for (let i = 0; i < length; ++i) {
// let value = values[i];
// assert(getExpressionType(value) == nativeType);
// assert(getExpressionId(value) == ExpressionId.Const);
// writeI16(getConstValueI32(value), buf, pos);
// pos += 2;
// }
// break;
// }
// case 4: {
// for (let i = 0; i < length; ++i) {
// let value = values[i];
// assert(getExpressionType(value) == nativeType);
// assert(getExpressionId(value) == ExpressionId.Const);
// writeI32(getConstValueI32(value), buf, pos);
// pos += 4;
// }
// break;
// }
// default: assert(false);
// }
// break;
// }
// case NativeType.I64: {
// for (let i = 0; i < length; ++i) {
// let value = values[i];
// assert(getExpressionType(value) == nativeType);
// assert(getExpressionId(value) == ExpressionId.Const);
// writeI64(i64_new(getConstValueI64Low(value), getConstValueI64High(value)), buf, pos);
// pos += 8;
// }
// break;
// }
// case NativeType.F32: {
// for (let i = 0; i < length; ++i) {
// let value = values[i];
// assert(getExpressionType(value) == nativeType);
// assert(getExpressionId(value) == ExpressionId.Const);
// writeF32(getConstValueF32(value), buf, pos);
// pos += 4;
// }
// break;
// }
// case NativeType.F64: {
// for (let i = 0; i < length; ++i) {
// let value = values[i];
// assert(getExpressionType(value) == nativeType);
// assert(getExpressionId(value) == ExpressionId.Const);
// writeF64(getConstValueF64(value), buf, pos);
// pos += 8;
// }
// break;
// }
// default: assert(false);
// }
// var bufferSegment = this.addMemorySegment(buf);
// var bufferOffset = bufferSegment.offset;
// if (hasGC) bufferOffset = i64_add(bufferOffset, i64_new(gcHeaderSize));
// // create the Array segment and return a pointer to it
// var arrayPrototype = assert(program.arrayPrototype);
// var arrayInstance = assert(this.resolver.resolveClass(
// arrayPrototype,
// [ elementType ],
// makeMap<string,Type>()
// ));
// var arrayHeaderSize = (arrayInstance.currentMemoryOffset + 7) & ~7;
// if (hasGC) {
// buf = new Uint8Array(gcHeaderSize + arrayHeaderSize);
// pos = gcHeaderSize;
// writeI32(ensureGCHook(this, arrayInstance), buf, program.gcHookOffset);
// } else {
// buf = new Uint8Array(arrayHeaderSize);
// pos = 0;
// }
// var arraySegment = this.addMemorySegment(buf);
// var arrayOffset = arraySegment.offset;
// if (hasGC) arrayOffset = i64_add(arrayOffset, i64_new(gcHeaderSize));
// this.currentType = arrayInstance.type;
// var buffer_offset = pos + arrayInstance.offsetof("buffer_");
// var length_offset = pos + arrayInstance.offsetof("length_");
// if (usizeTypeSize == 8) {
// writeI64(bufferOffset, buf, buffer_offset);
// writeI32(length, buf, length_offset);
// return this.module.createI64(i64_low(arrayOffset), i64_high(arrayOffset));
// } else {
// assert(i64_is_u32(bufferOffset));
// writeI32(i64_low(bufferOffset), buf, buffer_offset);
// writeI32(length, buf, length_offset);
// assert(i64_is_u32(arrayOffset));
// return this.module.createI32(i64_low(arrayOffset));
// }
// }
return this.addMemorySegment(buf);
}
compileArrayLiteral(
elementType: Type,
expressions: (Expression | null)[],
isConst: bool,
reportNode: Node
reportNode: Node,
context: Element | null = null
): ExpressionRef {
var module = this.module;
@ -6692,14 +6577,31 @@ export class Compiler extends DiagnosticEmitter {
}
}
var arrayPrototype = assert(this.program.arrayPrototype);
var program = this.program;
var arrayPrototype = assert(program.arrayPrototype);
var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ]));
var arrayType = arrayInstance.type;
// if the array is static, make a static arraybuffer segment and wrap it with an array
// if the array is static, make a static arraybuffer segment
if (isStatic) {
let arrayBufferInstance = assert(this.program.arrayBufferInstance);
let wrapArrayPrototype = assert(this.program.wrapArrayPrototype);
let runtimeHeaderSize = program.runtimeHeaderSize;
let bufferSegment = this.ensureStaticArrayBuffer(elementType, constantValues);
let bufferAddress = i64_add(bufferSegment.offset, i64_new(runtimeHeaderSize));
// make both the buffer and array header static if assigned to a global. this can't be done
// if inside of a function because each invocation must create a new array reference then.
if (context && context.kind == ElementKind.GLOBAL) {
let arraySegment = this.ensureStaticArrayHeader(elementType, bufferSegment);
let arrayAddress = i64_add(arraySegment.offset, i64_new(runtimeHeaderSize));
this.currentType = arrayType;
return program.options.isWasm64
? this.module.createI64(i64_low(arrayAddress), i64_high(arrayAddress))
: this.module.createI32(i64_low(arrayAddress));
// otherwise allocate a new array header and make it wrap a copy of the static buffer
} else {
let arrayBufferInstance = assert(program.arrayBufferInstance);
let wrapArrayPrototype = assert(program.wrapArrayPrototype);
let wrapArrayInstance = this.resolver.resolveFunction(wrapArrayPrototype, [ elementType ]);
if (!wrapArrayInstance) {
this.currentType = arrayType;
@ -6708,12 +6610,14 @@ export class Compiler extends DiagnosticEmitter {
let previousFlow = this.currentFlow;
let tempLocal = previousFlow.getTempLocal(arrayBufferInstance.type, false);
let flow = Flow.createInline(previousFlow.parentFunction, wrapArrayInstance);
flow.addScopedAlias("buffer", arrayBufferInstance.type, tempLocal.index);
flow.addScopedAlias(wrapArrayInstance.signature.getParameterName(0), arrayBufferInstance.type, tempLocal.index);
this.currentFlow = flow;
let body = this.compileFunctionBody(wrapArrayInstance);
body.unshift(
module.createSetLocal(tempLocal.index,
this.ensureStaticArrayBuffer(elementType, constantValues)
program.options.isWasm64
? this.module.createI64(i64_low(bufferAddress), i64_high(bufferAddress))
: this.module.createI32(i64_low(bufferAddress))
)
);
previousFlow.freeTempLocal(tempLocal);
@ -6721,6 +6625,7 @@ export class Compiler extends DiagnosticEmitter {
this.currentType = arrayType;
return module.createBlock(flow.inlineReturnLabel, body, this.options.nativeSizeType);
}
}
// otherwise compile an explicit instantiation with indexed sets
var setter = arrayInstance.lookupOverload(OperatorKind.INDEXED_SET, true);
@ -7982,7 +7887,7 @@ export class Compiler extends DiagnosticEmitter {
var previousFlow = this.currentFlow;
var tempLocal = previousFlow.getTempLocal(classType, false);
var flow = Flow.createInline(previousFlow.parentFunction, registerInstance);
flow.addScopedAlias("ref", this.options.usizeType, tempLocal.index);
flow.addScopedAlias(registerInstance.signature.getParameterName(0), this.options.usizeType, tempLocal.index);
this.currentFlow = flow;
var body = this.compileFunctionBody(registerInstance);
body.unshift(

View File

@ -84,7 +84,7 @@ import {
} from "./module";
import {
CharCode, writeI32
CharCode, writeI32, writeI8, writeI16, writeF32, writeF64
} from "./util";
import {
@ -3026,6 +3026,47 @@ export class Class extends TypedElement {
assert(field.kind == ElementKind.FIELD);
return (<Field>field).memoryOffset;
}
/** Writes a field value to a buffer and returns the number of bytes written. */
writeField<T>(name: string, value: T, buffer: Uint8Array, baseOffset: i32): i32 {
var field = this.lookupInSelf(name);
if (field && field.kind == ElementKind.FIELD) {
let offset = baseOffset + (<Field>field).memoryOffset;
switch ((<Field>field).type.kind) {
case TypeKind.I8:
case TypeKind.U8: {
writeI8(i32(value), buffer, offset);
return 1;
}
case TypeKind.I16:
case TypeKind.U16: {
writeI16(i32(value), buffer, offset);
return 2;
}
case TypeKind.I32:
case TypeKind.U32: {
writeI32(i32(value), buffer, offset);
return 4;
}
case TypeKind.ISIZE:
case TypeKind.USIZE: {
assert(!this.program.options.isWasm64); // TODO
writeI32(i32(value), buffer, offset);
return 4;
}
case TypeKind.F32: {
writeF32(f32(value), buffer, offset);
return 4;
}
case TypeKind.F64: {
writeF64(f64(value), buffer, offset);
return 8;
}
}
}
assert(false);
return 0;
}
}
/** A yet unresolved interface. */

View File

@ -40,7 +40,7 @@ export declare function CLASSID<T>(): u32;
export declare function ITERATEROOTS(fn: (ref: usize) => void): void;
/** Adjusts an allocation to actual block size. Primarily targets TLSF. */
export function ADJUST(payloadSize: usize): usize {
function adjustToBlock(payloadSize: usize): usize {
// round up to power of 2, e.g. with HEADER_SIZE=8:
// 0 -> 2^3 = 8
// 1..8 -> 2^4 = 16
@ -52,9 +52,13 @@ export function ADJUST(payloadSize: usize): usize {
/** Allocates a new object and returns a pointer to its payload. Does not fill. */
// @ts-ignore: decorator
@unsafe
@unsafe @inline
export function ALLOCATE(payloadSize: usize): usize {
var header = changetype<HEADER>(memory.allocate(ADJUST(payloadSize)));
return doAllocate(payloadSize);
}
function doAllocate(payloadSize: usize): usize {
var header = changetype<HEADER>(memory.allocate(adjustToBlock(payloadSize)));
header.classId = HEADER_MAGIC;
header.payloadSize = payloadSize;
if (GC_IMPLEMENTED) {
@ -66,8 +70,12 @@ export function ALLOCATE(payloadSize: usize): usize {
/** Reallocates an object if necessary. Returns a pointer to its (moved) payload. */
// @ts-ignore: decorator
@unsafe
@unsafe @inline
export function REALLOCATE(ref: usize, newPayloadSize: usize): usize {
return doReallocate(ref, newPayloadSize);
}
function doReallocate(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,
@ -75,8 +83,8 @@ export function REALLOCATE(ref: usize, newPayloadSize: usize): usize {
var header = changetype<HEADER>(ref - HEADER_SIZE);
var payloadSize = header.payloadSize;
if (payloadSize < newPayloadSize) {
let newAdjustedSize = ADJUST(newPayloadSize);
if (select(ADJUST(payloadSize), 0, ref > HEAP_BASE) < newAdjustedSize) {
let newAdjustedSize = adjustToBlock(newPayloadSize);
if (select(adjustToBlock(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;
@ -114,27 +122,42 @@ export function REALLOCATE(ref: usize, newPayloadSize: usize): usize {
// @ts-ignore: decorator
@unsafe @inline
export function REGISTER<T>(ref: usize): T {
ASSERT_UNREGISTERED(ref);
changetype<HEADER>(ref - HEADER_SIZE).classId = CLASSID<T>();
return changetype<T>(doRegister(ref, CLASSID<T>()));
}
function doRegister(ref: usize, classId: u32): usize {
if (!ASC_NO_ASSERT) assertUnregistered(ref);
changetype<HEADER>(ref - HEADER_SIZE).classId = classId;
// @ts-ignore: stub
if (GC_IMPLEMENTED) __gc_register(ref);
return changetype<T>(ref);
return ref;
}
/** Links a registered object with the (registered) object now referencing it. */
// @ts-ignore: decorator
@unsafe @inline
export function LINK<T,TParent>(ref: T, parentRef: TParent): void {
ASSERT_REGISTERED(changetype<usize>(ref));
ASSERT_REGISTERED(changetype<usize>(parentRef));
doLink(changetype<usize>(ref), changetype<usize>(parentRef));
}
function doLink(ref: usize, parentRef: usize): void {
if (!ASC_NO_ASSERT) {
assertRegistered(ref);
assertRegistered(parentRef);
}
// @ts-ignore: stub
if (GC_IMPLEMENTED) __gc_link(changetype<usize>(ref), changetype<usize>(parentRef));
}
/** Discards an unregistered object that turned out to be unnecessary. */
// @ts-ignore: decorator
@unsafe @inline
export function DISCARD(ref: usize): void {
ASSERT_UNREGISTERED(ref);
doDiscard(ref);
}
function doDiscard(ref: usize): void {
if (!ASC_NO_ASSERT) assertUnregistered(ref);
memory.free(changetype<usize>(ref - HEADER_SIZE));
}
@ -142,39 +165,33 @@ export function DISCARD(ref: usize): void {
// @ts-ignore: decorator
@unsafe @inline
export function WRAPARRAY<T>(buffer: ArrayBuffer): T[] {
// TODO: this is quite a lot to compile inline
var array = REGISTER<T[]>(ALLOCATE(offsetof<T[]>()));
return changetype<T[]>(doWrapArray(buffer, CLASSID<T[]>(), alignof<T>()));
}
function doWrapArray(buffer: ArrayBuffer, classId: u32, alignLog2: usize): usize {
var array = doRegister(doAllocate(offsetof<i32[]>()), classId);
var bufferSize = <usize>buffer.byteLength;
var newBuffer = REGISTER<ArrayBuffer>(ALLOCATE(bufferSize));
changetype<ArrayBufferView>(array).data = newBuffer; // links
var newBuffer = doRegister(doAllocate(bufferSize), classId);
changetype<ArrayBufferView>(array).data = changetype<ArrayBuffer>(newBuffer); // links
changetype<ArrayBufferView>(array).dataStart = changetype<usize>(newBuffer);
changetype<ArrayBufferView>(array).dataEnd = changetype<usize>(newBuffer) + bufferSize;
store<i32>(changetype<usize>(array), <i32>(bufferSize >>> alignof<T>()), offsetof<T[]>("length_"));
if (isManaged<T>()) {
ERROR("unexpected managed type"); // not used currently
let dataOffset: usize = 0;
while (dataOffset < bufferSize) {
let element: T = load<T>(changetype<usize>(buffer) + dataOffset);
store<T>(changetype<usize>(newBuffer) + dataOffset, element);
LINK(element, array);
dataOffset += sizeof<T>();
}
} else {
store<i32>(changetype<usize>(array), <i32>(bufferSize >>> alignLog2), offsetof<i32[]>("length_"));
memory.copy(changetype<usize>(newBuffer), changetype<usize>(buffer), bufferSize);
}
return array;
return changetype<usize>(array);
}
// Helpers
/** Asserts that a managed object is still unregistered. */
function ASSERT_UNREGISTERED(ref: usize): void {
// @ts-ignore: decorator
function assertUnregistered(ref: usize): void {
assert(ref > HEAP_BASE); // must be a heap object
assert(changetype<HEADER>(ref - HEADER_SIZE).classId == HEADER_MAGIC);
}
/** Asserts that a managed object has already been registered. */
function ASSERT_REGISTERED(ref: usize): void {
// @ts-ignore: decorator
function assertRegistered(ref: usize): void {
assert(ref > HEAP_BASE); // must be a heap object
assert(changetype<HEADER>(ref - HEADER_SIZE).classId != HEADER_MAGIC);
}

View File

@ -130,7 +130,7 @@ declare function fmod(x: f64, y: f64): f64;
declare function fmodf(x: f32, y: f32): f32;
/** Converts any other numeric value to an 8-bit signed integer. */
declare function i8(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i8;
declare function i8(value: any): i8;
declare namespace i8 {
/** Smallest representable value. */
export const MIN_VALUE: i8;
@ -142,7 +142,7 @@ declare namespace i8 {
export function parseInt(string: string, radix?: i32): i8;
}
/** Converts any other numeric value to a 16-bit signed integer. */
declare function i16(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i16;
declare function i16(value: any): i16;
declare namespace i16 {
/** Smallest representable value. */
export const MIN_VALUE: i16;
@ -154,7 +154,7 @@ declare namespace i16 {
export function parseInt(string: string, radix?: i32): i16;
}
/** Converts any other numeric value to a 32-bit signed integer. */
declare function i32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): i32;
declare function i32(value: any): i32;
declare namespace i32 {
/** Smallest representable value. */
export const MIN_VALUE: i32;
@ -166,7 +166,7 @@ declare namespace i32 {
export function parseInt(string: string, radix?: i32): i32;
}
/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */
declare function isize(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): isize;
declare function isize(value: any): isize;
declare namespace isize {
/** Smallest representable value. */
export const MIN_VALUE: isize;
@ -178,7 +178,7 @@ declare namespace isize {
export function parseInt(string: string, radix?: i32): isize;
}
/** Converts any other numeric value to an 8-bit unsigned integer. */
declare function u8(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): u8;
declare function u8(value: any): u8;
declare namespace u8 {
/** Smallest representable value. */
export const MIN_VALUE: u8;
@ -190,7 +190,7 @@ declare namespace u8 {
export function parseInt(string: string, radix?: i32): u8;
}
/** Converts any other numeric value to a 16-bit unsigned integer. */
declare function u16(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): u16;
declare function u16(value: any): u16;
declare namespace u16 {
/** Smallest representable value. */
export const MIN_VALUE: u16;
@ -202,7 +202,7 @@ declare namespace u16 {
export function parseInt(string: string, radix?: i32): u16;
}
/** Converts any other numeric value to a 32-bit unsigned integer. */
declare function u32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): u32;
declare function u32(value: any): u32;
declare namespace u32 {
/** Smallest representable value. */
export const MIN_VALUE: u32;
@ -214,7 +214,7 @@ declare namespace u32 {
export function parseInt(string: string, radix?: i32): u32;
}
/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */
declare function usize(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): isize;
declare function usize(value: any): isize;
declare namespace usize {
/** Smallest representable value. */
export const MIN_VALUE: usize;
@ -226,7 +226,7 @@ declare namespace usize {
export function parseInt(string: string, radix?: i32): usize;
}
/** Converts any other numeric value to a 1-bit unsigned integer. */
declare function bool(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): bool;
declare function bool(value: any): bool;
declare namespace bool {
/** Smallest representable value. */
export const MIN_VALUE: bool;
@ -234,7 +234,7 @@ declare namespace bool {
export const MAX_VALUE: bool;
}
/** Converts any other numeric value to a 32-bit float. */
declare function f32(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f32;
declare function f32(value: any): f32;
declare namespace f32 {
/** Smallest representable value. */
export const MIN_VALUE: f32;
@ -262,7 +262,7 @@ declare namespace f32 {
export function parseInt(string: string, radix?: i32): f32;
}
/** Converts any other numeric value to a 64-bit float. */
declare function f64(value: i8 | i16 | i32 | isize | u8 | u16 | u32 | usize | bool | f32 | f64): f64;
declare function f64(value: any): f64;
declare namespace f64 {
/** Smallest representable value. */
export const MIN_VALUE: f64;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
(module
(type $FUNCSIG$v (func))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$viii (func (param i32 i32 i32)))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
@ -23,9 +23,9 @@
(type $FUNCSIG$vid (func (param i32 f64)))
(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 96) "\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s")
(data (i32.const 8) "\02\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) "\02\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 96) "\02\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
@ -95,7 +95,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/doAllocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
i32.const 1
i32.const 32
@ -116,14 +116,14 @@
i32.const 8
i32.add
)
(func $~lib/runtime/ASSERT_UNREGISTERED (; 3 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/runtime/assertUnregistered (; 3 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 124
i32.le_u
if
i32.const 0
i32.const 16
i32.const 172
i32.const 188
i32.const 2
call $~lib/env/abort
unreachable
@ -137,13 +137,23 @@
if
i32.const 0
i32.const 16
i32.const 173
i32.const 189
i32.const 2
call $~lib/env/abort
unreachable
end
)
(func $~lib/memory/memory.fill (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/runtime/doRegister (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
call $~lib/runtime/assertUnregistered
local.get $0
i32.const 8
i32.sub
local.get $1
i32.store
local.get $0
)
(func $~lib/memory/memory.fill (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
block $~lib/util/memory/memset|inlined.0
local.get $1
@ -354,7 +364,7 @@
end
end
)
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.const 1073741816
@ -368,20 +378,15 @@
unreachable
end
local.get $0
call $~lib/runtime/ALLOCATE
call $~lib/runtime/doAllocate
local.tee $1
local.get $0
call $~lib/memory/memory.fill
local.get $1
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $1
i32.const 8
i32.sub
i32.const 3
i32.store
local.get $1
call $~lib/runtime/doRegister
)
(func $~lib/map/Map<i8,i32>#clear (; 6 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/map/Map<i8,i32>#clear (; 7 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 16
call $~lib/arraybuffer/ArrayBuffer#constructor
@ -403,18 +408,13 @@
i32.const 0
i32.store offset=20
)
(func $~lib/map/Map<i8,i32>#constructor (; 7 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<i8,i32>#constructor (; 8 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
call $~lib/runtime/doAllocate
i32.const 1
call $~lib/runtime/doRegister
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
i32.const 2
i32.store
local.get $0
i32.const 0
i32.store
local.get $0
@ -436,7 +436,7 @@
call $~lib/map/Map<i8,i32>#clear
local.get $0
)
(func $~lib/map/Map<i8,i32>#find (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/map/Map<i8,i32>#find (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -481,7 +481,7 @@
end
i32.const 0
)
(func $~lib/map/Map<i8,i32>#has (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<i8,i32>#has (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -497,7 +497,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<i8,i32>#rehash (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<i8,i32>#rehash (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -601,7 +601,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<i8,i32>#set (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/map/Map<i8,i32>#set (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -700,7 +700,7 @@
i32.store
end
)
(func $~lib/map/Map<i8,i32>#get (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<i8,i32>#get (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -721,7 +721,7 @@
unreachable
end
)
(func $~lib/map/Map<i8,i32>#delete (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<i8,i32>#delete (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -788,7 +788,7 @@
call $~lib/map/Map<i8,i32>#rehash
end
)
(func $std/map/test<i8,i32> (; 14 ;) (type $FUNCSIG$v)
(func $std/map/test<i8,i32> (; 15 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/map/Map<i8,i32>#constructor
@ -1132,18 +1132,13 @@
unreachable
end
)
(func $~lib/map/Map<u8,i32>#constructor (; 15 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<u8,i32>#constructor (; 16 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 4
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -1165,7 +1160,7 @@
call $~lib/map/Map<i8,i32>#clear
local.get $0
)
(func $~lib/map/Map<u8,i32>#has (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<u8,i32>#has (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -1179,7 +1174,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<u8,i32>#rehash (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<u8,i32>#rehash (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1283,7 +1278,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<u8,i32>#set (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/map/Map<u8,i32>#set (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -1380,7 +1375,7 @@
i32.store
end
)
(func $~lib/map/Map<u8,i32>#get (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<u8,i32>#get (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -1399,7 +1394,7 @@
unreachable
end
)
(func $~lib/map/Map<u8,i32>#delete (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<u8,i32>#delete (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -1464,7 +1459,7 @@
call $~lib/map/Map<u8,i32>#rehash
end
)
(func $std/map/test<u8,i32> (; 21 ;) (type $FUNCSIG$v)
(func $std/map/test<u8,i32> (; 22 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/map/Map<u8,i32>#constructor
@ -1794,18 +1789,13 @@
unreachable
end
)
(func $~lib/map/Map<i16,i32>#constructor (; 22 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<i16,i32>#constructor (; 23 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 5
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -1827,7 +1817,7 @@
call $~lib/map/Map<i8,i32>#clear
local.get $0
)
(func $~lib/map/Map<i16,i32>#find (; 23 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/map/Map<i16,i32>#find (; 24 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -1872,7 +1862,7 @@
end
i32.const 0
)
(func $~lib/map/Map<i16,i32>#has (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<i16,i32>#has (; 25 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -1897,7 +1887,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<i16,i32>#rehash (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<i16,i32>#rehash (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -2010,7 +2000,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<i16,i32>#set (; 26 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/map/Map<i16,i32>#set (; 27 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -2118,7 +2108,7 @@
i32.store
end
)
(func $~lib/map/Map<i16,i32>#get (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<i16,i32>#get (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -2148,7 +2138,7 @@
unreachable
end
)
(func $~lib/map/Map<i16,i32>#delete (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<i16,i32>#delete (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -2224,7 +2214,7 @@
call $~lib/map/Map<i16,i32>#rehash
end
)
(func $std/map/test<i16,i32> (; 29 ;) (type $FUNCSIG$v)
(func $std/map/test<i16,i32> (; 30 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/map/Map<i16,i32>#constructor
@ -2568,18 +2558,13 @@
unreachable
end
)
(func $~lib/map/Map<u16,i32>#constructor (; 30 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<u16,i32>#constructor (; 31 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 6
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -2601,7 +2586,7 @@
call $~lib/map/Map<i8,i32>#clear
local.get $0
)
(func $~lib/map/Map<u16,i32>#has (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<u16,i32>#has (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -2624,7 +2609,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<u16,i32>#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<u16,i32>#rehash (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -2737,7 +2722,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<u16,i32>#set (; 33 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/map/Map<u16,i32>#set (; 34 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -2843,7 +2828,7 @@
i32.store
end
)
(func $~lib/map/Map<u16,i32>#get (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<u16,i32>#get (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -2871,7 +2856,7 @@
unreachable
end
)
(func $~lib/map/Map<u16,i32>#delete (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<u16,i32>#delete (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -2945,7 +2930,7 @@
call $~lib/map/Map<u16,i32>#rehash
end
)
(func $std/map/test<u16,i32> (; 36 ;) (type $FUNCSIG$v)
(func $std/map/test<u16,i32> (; 37 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/map/Map<u16,i32>#constructor
@ -3275,18 +3260,13 @@
unreachable
end
)
(func $~lib/map/Map<i32,i32>#constructor (; 37 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<i32,i32>#constructor (; 38 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 7
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -3308,7 +3288,7 @@
call $~lib/map/Map<i8,i32>#clear
local.get $0
)
(func $~lib/util/hash/hash32 (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/util/hash/hash32 (; 39 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 255
i32.and
@ -3339,7 +3319,7 @@
i32.const 16777619
i32.mul
)
(func $~lib/map/Map<i32,i32>#find (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/map/Map<i32,i32>#find (; 40 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -3382,7 +3362,7 @@
end
i32.const 0
)
(func $~lib/map/Map<i32,i32>#has (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<i32,i32>#has (; 41 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -3391,7 +3371,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<i32,i32>#rehash (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<i32,i32>#rehash (; 42 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3492,7 +3472,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<i32,i32>#set (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/map/Map<i32,i32>#set (; 43 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -3582,7 +3562,7 @@
i32.store
end
)
(func $~lib/map/Map<i32,i32>#get (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/map/Map<i32,i32>#get (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -3596,7 +3576,7 @@
unreachable
end
)
(func $~lib/map/Map<i32,i32>#delete (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<i32,i32>#delete (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -3656,7 +3636,7 @@
call $~lib/map/Map<i32,i32>#rehash
end
)
(func $std/map/test<i32,i32> (; 45 ;) (type $FUNCSIG$v)
(func $std/map/test<i32,i32> (; 46 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/map/Map<i32,i32>#constructor
@ -3972,18 +3952,13 @@
unreachable
end
)
(func $~lib/map/Map<u32,i32>#constructor (; 46 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<u32,i32>#constructor (; 47 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
call $~lib/runtime/doAllocate
i32.const 8
call $~lib/runtime/doRegister
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
i32.const 8
i32.store
local.get $0
i32.const 0
i32.store
local.get $0
@ -4005,7 +3980,7 @@
call $~lib/map/Map<i8,i32>#clear
local.get $0
)
(func $std/map/test<u32,i32> (; 47 ;) (type $FUNCSIG$v)
(func $std/map/test<u32,i32> (; 48 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/map/Map<u32,i32>#constructor
@ -4321,7 +4296,7 @@
unreachable
end
)
(func $~lib/map/Map<i64,i32>#clear (; 48 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/map/Map<i64,i32>#clear (; 49 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 16
call $~lib/arraybuffer/ArrayBuffer#constructor
@ -4343,18 +4318,13 @@
i32.const 0
i32.store offset=20
)
(func $~lib/map/Map<i64,i32>#constructor (; 49 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<i64,i32>#constructor (; 50 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 9
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -4376,7 +4346,7 @@
call $~lib/map/Map<i64,i32>#clear
local.get $0
)
(func $~lib/util/hash/hash64 (; 50 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
(func $~lib/util/hash/hash64 (; 51 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
(local $1 i32)
local.get $0
i32.wrap_i64
@ -4442,7 +4412,7 @@
i32.const 16777619
i32.mul
)
(func $~lib/map/Map<i64,i32>#find (; 51 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32)
(func $~lib/map/Map<i64,i32>#find (; 52 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -4485,7 +4455,7 @@
end
i32.const 0
)
(func $~lib/map/Map<i64,i32>#has (; 52 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
(func $~lib/map/Map<i64,i32>#has (; 53 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
local.get $0
local.get $1
local.get $1
@ -4494,7 +4464,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<i64,i32>#rehash (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<i64,i32>#rehash (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -4595,7 +4565,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<i64,i32>#set (; 54 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32)
(func $~lib/map/Map<i64,i32>#set (; 55 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -4685,7 +4655,7 @@
i32.store
end
)
(func $~lib/map/Map<i64,i32>#get (; 55 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
(func $~lib/map/Map<i64,i32>#get (; 56 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
local.get $0
local.get $1
local.get $1
@ -4699,7 +4669,7 @@
unreachable
end
)
(func $~lib/map/Map<i64,i32>#delete (; 56 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64)
(func $~lib/map/Map<i64,i32>#delete (; 57 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64)
(local $2 i32)
(local $3 i32)
local.get $0
@ -4760,7 +4730,7 @@
call $~lib/map/Map<i64,i32>#rehash
end
)
(func $std/map/test<i64,i32> (; 57 ;) (type $FUNCSIG$v)
(func $std/map/test<i64,i32> (; 58 ;) (type $FUNCSIG$v)
(local $0 i64)
(local $1 i32)
call $~lib/map/Map<i64,i32>#constructor
@ -5083,18 +5053,13 @@
unreachable
end
)
(func $~lib/map/Map<u64,i32>#constructor (; 58 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<u64,i32>#constructor (; 59 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 10
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -5116,7 +5081,7 @@
call $~lib/map/Map<i64,i32>#clear
local.get $0
)
(func $std/map/test<u64,i32> (; 59 ;) (type $FUNCSIG$v)
(func $std/map/test<u64,i32> (; 60 ;) (type $FUNCSIG$v)
(local $0 i64)
(local $1 i32)
call $~lib/map/Map<u64,i32>#constructor
@ -5439,18 +5404,13 @@
unreachable
end
)
(func $~lib/map/Map<f32,i32>#constructor (; 60 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<f32,i32>#constructor (; 61 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 11
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -5472,7 +5432,7 @@
call $~lib/map/Map<i8,i32>#clear
local.get $0
)
(func $~lib/map/Map<f32,i32>#find (; 61 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32)
(func $~lib/map/Map<f32,i32>#find (; 62 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -5515,7 +5475,7 @@
end
i32.const 0
)
(func $~lib/map/Map<f32,i32>#has (; 62 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32)
(func $~lib/map/Map<f32,i32>#has (; 63 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32)
local.get $0
local.get $1
local.get $1
@ -5525,7 +5485,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<f32,i32>#rehash (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<f32,i32>#rehash (; 64 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -5627,7 +5587,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<f32,i32>#set (; 64 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32)
(func $~lib/map/Map<f32,i32>#set (; 65 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -5718,7 +5678,7 @@
i32.store
end
)
(func $~lib/map/Map<f32,i32>#get (; 65 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32)
(func $~lib/map/Map<f32,i32>#get (; 66 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32)
local.get $0
local.get $1
local.get $1
@ -5733,7 +5693,7 @@
unreachable
end
)
(func $~lib/map/Map<f32,i32>#delete (; 66 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32)
(func $~lib/map/Map<f32,i32>#delete (; 67 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32)
(local $2 i32)
(local $3 i32)
local.get $0
@ -5795,7 +5755,7 @@
call $~lib/map/Map<f32,i32>#rehash
end
)
(func $std/map/test<f32,i32> (; 67 ;) (type $FUNCSIG$v)
(func $std/map/test<f32,i32> (; 68 ;) (type $FUNCSIG$v)
(local $0 f32)
(local $1 i32)
call $~lib/map/Map<f32,i32>#constructor
@ -6118,18 +6078,13 @@
unreachable
end
)
(func $~lib/map/Map<f64,i32>#constructor (; 68 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/map/Map<f64,i32>#constructor (; 69 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 12
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -6151,7 +6106,7 @@
call $~lib/map/Map<i64,i32>#clear
local.get $0
)
(func $~lib/map/Map<f64,i32>#find (; 69 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32)
(func $~lib/map/Map<f64,i32>#find (; 70 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -6194,7 +6149,7 @@
end
i32.const 0
)
(func $~lib/map/Map<f64,i32>#has (; 70 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32)
(func $~lib/map/Map<f64,i32>#has (; 71 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32)
local.get $0
local.get $1
local.get $1
@ -6204,7 +6159,7 @@
i32.const 0
i32.ne
)
(func $~lib/map/Map<f64,i32>#rehash (; 71 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/map/Map<f64,i32>#rehash (; 72 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -6306,7 +6261,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/map/Map<f64,i32>#set (; 72 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32)
(func $~lib/map/Map<f64,i32>#set (; 73 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -6397,7 +6352,7 @@
i32.store
end
)
(func $~lib/map/Map<f64,i32>#get (; 73 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32)
(func $~lib/map/Map<f64,i32>#get (; 74 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32)
local.get $0
local.get $1
local.get $1
@ -6412,7 +6367,7 @@
unreachable
end
)
(func $~lib/map/Map<f64,i32>#delete (; 74 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64)
(func $~lib/map/Map<f64,i32>#delete (; 75 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64)
(local $2 i32)
(local $3 i32)
local.get $0
@ -6474,7 +6429,7 @@
call $~lib/map/Map<f64,i32>#rehash
end
)
(func $std/map/test<f64,i32> (; 75 ;) (type $FUNCSIG$v)
(func $std/map/test<f64,i32> (; 76 ;) (type $FUNCSIG$v)
(local $0 f64)
(local $1 i32)
call $~lib/map/Map<f64,i32>#constructor
@ -6797,7 +6752,7 @@
unreachable
end
)
(func $start (; 76 ;) (type $FUNCSIG$v)
(func $start (; 77 ;) (type $FUNCSIG$v)
i32.const 128
global.set $~lib/allocator/arena/startOffset
global.get $~lib/allocator/arena/startOffset
@ -6813,7 +6768,7 @@
call $std/map/test<f32,i32>
call $std/map/test<f64,i32>
)
(func $null (; 77 ;) (type $FUNCSIG$v)
(func $null (; 78 ;) (type $FUNCSIG$v)
nop
)
)

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
(module
(type $FUNCSIG$v (func))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$iij (func (param i32 i64) (result i32)))
@ -21,9 +21,9 @@
(type $FUNCSIG$i (func (result 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 96) "\01\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s")
(data (i32.const 8) "\02\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) "\02\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 96) "\02\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
@ -93,7 +93,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/doAllocate (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
i32.const 1
i32.const 32
@ -114,14 +114,14 @@
i32.const 8
i32.add
)
(func $~lib/runtime/ASSERT_UNREGISTERED (; 3 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/runtime/assertUnregistered (; 3 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 124
i32.le_u
if
i32.const 0
i32.const 16
i32.const 172
i32.const 188
i32.const 2
call $~lib/env/abort
unreachable
@ -135,13 +135,23 @@
if
i32.const 0
i32.const 16
i32.const 173
i32.const 189
i32.const 2
call $~lib/env/abort
unreachable
end
)
(func $~lib/memory/memory.fill (; 4 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/runtime/doRegister (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
call $~lib/runtime/assertUnregistered
local.get $0
i32.const 8
i32.sub
local.get $1
i32.store
local.get $0
)
(func $~lib/memory/memory.fill (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
block $~lib/util/memory/memset|inlined.0
local.get $1
@ -352,7 +362,7 @@
end
end
)
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.const 1073741816
@ -366,20 +376,15 @@
unreachable
end
local.get $0
call $~lib/runtime/ALLOCATE
call $~lib/runtime/doAllocate
local.tee $1
local.get $0
call $~lib/memory/memory.fill
local.get $1
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $1
i32.const 8
i32.sub
i32.const 3
i32.store
local.get $1
call $~lib/runtime/doRegister
)
(func $~lib/set/Set<i8>#clear (; 6 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/set/Set<i8>#clear (; 7 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 16
call $~lib/arraybuffer/ArrayBuffer#constructor
@ -401,18 +406,13 @@
i32.const 0
i32.store offset=20
)
(func $~lib/set/Set<i8>#constructor (; 7 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<i8>#constructor (; 8 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
call $~lib/runtime/doAllocate
i32.const 1
call $~lib/runtime/doRegister
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
i32.const 2
i32.store
local.get $0
i32.const 0
i32.store
local.get $0
@ -434,7 +434,7 @@
call $~lib/set/Set<i8>#clear
local.get $0
)
(func $~lib/set/Set<i8>#find (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/set/Set<i8>#find (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -479,7 +479,7 @@
end
i32.const 0
)
(func $~lib/set/Set<i8>#has (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/set/Set<i8>#has (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -495,7 +495,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<i8>#rehash (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i8>#rehash (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -595,7 +595,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<i8>#add (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i8>#add (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -687,7 +687,7 @@
i32.store
end
)
(func $~lib/set/Set<i8>#delete (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i8>#delete (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -754,7 +754,7 @@
call $~lib/set/Set<i8>#rehash
end
)
(func $std/set/test<i8> (; 13 ;) (type $FUNCSIG$v)
(func $std/set/test<i8> (; 14 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/set/Set<i8>#constructor
@ -999,18 +999,13 @@
unreachable
end
)
(func $~lib/set/Set<u8>#constructor (; 14 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<u8>#constructor (; 15 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 4
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -1032,7 +1027,7 @@
call $~lib/set/Set<i8>#clear
local.get $0
)
(func $~lib/set/Set<u8>#has (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/set/Set<u8>#has (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -1046,7 +1041,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<u8>#rehash (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<u8>#rehash (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1146,7 +1141,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<u8>#add (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<u8>#add (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1236,7 +1231,7 @@
i32.store
end
)
(func $~lib/set/Set<u8>#delete (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<u8>#delete (; 19 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -1301,7 +1296,7 @@
call $~lib/set/Set<u8>#rehash
end
)
(func $std/set/test<u8> (; 19 ;) (type $FUNCSIG$v)
(func $std/set/test<u8> (; 20 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/set/Set<u8>#constructor
@ -1546,18 +1541,13 @@
unreachable
end
)
(func $~lib/set/Set<i16>#constructor (; 20 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<i16>#constructor (; 21 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 5
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -1579,7 +1569,7 @@
call $~lib/set/Set<i8>#clear
local.get $0
)
(func $~lib/set/Set<i16>#find (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/set/Set<i16>#find (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -1624,7 +1614,7 @@
end
i32.const 0
)
(func $~lib/set/Set<i16>#has (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/set/Set<i16>#has (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -1649,7 +1639,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<i16>#rehash (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i16>#rehash (; 24 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1758,7 +1748,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<i16>#add (; 24 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i16>#add (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1859,7 +1849,7 @@
i32.store
end
)
(func $~lib/set/Set<i16>#delete (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i16>#delete (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -1935,7 +1925,7 @@
call $~lib/set/Set<i16>#rehash
end
)
(func $std/set/test<i16> (; 26 ;) (type $FUNCSIG$v)
(func $std/set/test<i16> (; 27 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/set/Set<i16>#constructor
@ -2180,18 +2170,13 @@
unreachable
end
)
(func $~lib/set/Set<u16>#constructor (; 27 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<u16>#constructor (; 28 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 6
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -2213,7 +2198,7 @@
call $~lib/set/Set<i8>#clear
local.get $0
)
(func $~lib/set/Set<u16>#has (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/set/Set<u16>#has (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -2236,7 +2221,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<u16>#rehash (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<u16>#rehash (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -2345,7 +2330,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<u16>#add (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<u16>#add (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -2444,7 +2429,7 @@
i32.store
end
)
(func $~lib/set/Set<u16>#delete (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<u16>#delete (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -2518,7 +2503,7 @@
call $~lib/set/Set<u16>#rehash
end
)
(func $std/set/test<u16> (; 32 ;) (type $FUNCSIG$v)
(func $std/set/test<u16> (; 33 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/set/Set<u16>#constructor
@ -2763,18 +2748,13 @@
unreachable
end
)
(func $~lib/set/Set<i32>#constructor (; 33 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<i32>#constructor (; 34 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 7
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -2796,7 +2776,7 @@
call $~lib/set/Set<i8>#clear
local.get $0
)
(func $~lib/util/hash/hash32 (; 34 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/util/hash/hash32 (; 35 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 255
i32.and
@ -2827,7 +2807,7 @@
i32.const 16777619
i32.mul
)
(func $~lib/set/Set<i32>#find (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/set/Set<i32>#find (; 36 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -2870,7 +2850,7 @@
end
i32.const 0
)
(func $~lib/set/Set<i32>#has (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/set/Set<i32>#has (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
local.get $1
local.get $1
@ -2879,7 +2859,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<i32>#rehash (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i32>#rehash (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -2976,7 +2956,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<i32>#add (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i32>#add (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3061,7 +3041,7 @@
i32.store
end
)
(func $~lib/set/Set<i32>#delete (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i32>#delete (; 40 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $0
local.get $1
@ -3121,7 +3101,7 @@
call $~lib/set/Set<i32>#rehash
end
)
(func $std/set/test<i32> (; 40 ;) (type $FUNCSIG$v)
(func $std/set/test<i32> (; 41 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/set/Set<i32>#constructor
@ -3366,18 +3346,13 @@
unreachable
end
)
(func $~lib/set/Set<u32>#constructor (; 41 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<u32>#constructor (; 42 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
call $~lib/runtime/doAllocate
i32.const 8
call $~lib/runtime/doRegister
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
i32.const 8
i32.store
local.get $0
i32.const 0
i32.store
local.get $0
@ -3399,7 +3374,7 @@
call $~lib/set/Set<i8>#clear
local.get $0
)
(func $std/set/test<u32> (; 42 ;) (type $FUNCSIG$v)
(func $std/set/test<u32> (; 43 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
call $~lib/set/Set<u32>#constructor
@ -3644,7 +3619,7 @@
unreachable
end
)
(func $~lib/set/Set<i64>#clear (; 43 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/set/Set<i64>#clear (; 44 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 16
call $~lib/arraybuffer/ArrayBuffer#constructor
@ -3666,18 +3641,13 @@
i32.const 0
i32.store offset=20
)
(func $~lib/set/Set<i64>#constructor (; 44 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<i64>#constructor (; 45 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 9
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -3699,7 +3669,7 @@
call $~lib/set/Set<i64>#clear
local.get $0
)
(func $~lib/util/hash/hash64 (; 45 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
(func $~lib/util/hash/hash64 (; 46 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
(local $1 i32)
local.get $0
i32.wrap_i64
@ -3765,7 +3735,7 @@
i32.const 16777619
i32.mul
)
(func $~lib/set/Set<i64>#find (; 46 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32)
(func $~lib/set/Set<i64>#find (; 47 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -3808,7 +3778,7 @@
end
i32.const 0
)
(func $~lib/set/Set<i64>#has (; 47 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
(func $~lib/set/Set<i64>#has (; 48 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
local.get $0
local.get $1
local.get $1
@ -3817,7 +3787,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<i64>#rehash (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<i64>#rehash (; 49 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3914,7 +3884,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<i64>#add (; 49 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64)
(func $~lib/set/Set<i64>#add (; 50 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3999,7 +3969,7 @@
i32.store
end
)
(func $~lib/set/Set<i64>#delete (; 50 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64)
(func $~lib/set/Set<i64>#delete (; 51 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64)
(local $2 i32)
(local $3 i32)
local.get $0
@ -4060,7 +4030,7 @@
call $~lib/set/Set<i64>#rehash
end
)
(func $std/set/test<i64> (; 51 ;) (type $FUNCSIG$v)
(func $std/set/test<i64> (; 52 ;) (type $FUNCSIG$v)
(local $0 i64)
(local $1 i32)
call $~lib/set/Set<i64>#constructor
@ -4305,18 +4275,13 @@
unreachable
end
)
(func $~lib/set/Set<u64>#constructor (; 52 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<u64>#constructor (; 53 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 10
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -4338,7 +4303,7 @@
call $~lib/set/Set<i64>#clear
local.get $0
)
(func $std/set/test<u64> (; 53 ;) (type $FUNCSIG$v)
(func $std/set/test<u64> (; 54 ;) (type $FUNCSIG$v)
(local $0 i64)
(local $1 i32)
call $~lib/set/Set<u64>#constructor
@ -4583,18 +4548,13 @@
unreachable
end
)
(func $~lib/set/Set<f32>#constructor (; 54 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<f32>#constructor (; 55 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 11
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -4616,12 +4576,12 @@
call $~lib/set/Set<i8>#clear
local.get $0
)
(func $~lib/util/hash/HASH<f32> (; 55 ;) (type $FUNCSIG$if) (param $0 f32) (result i32)
(func $~lib/util/hash/HASH<f32> (; 56 ;) (type $FUNCSIG$if) (param $0 f32) (result i32)
local.get $0
i32.reinterpret_f32
call $~lib/util/hash/hash32
)
(func $~lib/set/Set<f32>#find (; 56 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32)
(func $~lib/set/Set<f32>#find (; 57 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -4664,7 +4624,7 @@
end
i32.const 0
)
(func $~lib/set/Set<f32>#has (; 57 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32)
(func $~lib/set/Set<f32>#has (; 58 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32)
local.get $0
local.get $1
local.get $1
@ -4673,7 +4633,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<f32>#rehash (; 58 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<f32>#rehash (; 59 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -4771,7 +4731,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<f32>#add (; 59 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32)
(func $~lib/set/Set<f32>#add (; 60 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -4854,7 +4814,7 @@
i32.store
end
)
(func $~lib/set/Set<f32>#delete (; 60 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32)
(func $~lib/set/Set<f32>#delete (; 61 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32)
(local $2 i32)
(local $3 i32)
local.get $0
@ -4916,7 +4876,7 @@
call $~lib/set/Set<f32>#rehash
end
)
(func $std/set/test<f32> (; 61 ;) (type $FUNCSIG$v)
(func $std/set/test<f32> (; 62 ;) (type $FUNCSIG$v)
(local $0 f32)
(local $1 i32)
call $~lib/set/Set<f32>#constructor
@ -5161,18 +5121,13 @@
unreachable
end
)
(func $~lib/set/Set<f64>#constructor (; 62 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/set/Set<f64>#constructor (; 63 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
i32.const 24
call $~lib/runtime/ALLOCATE
local.tee $0
call $~lib/runtime/ASSERT_UNREGISTERED
local.get $0
i32.const 8
i32.sub
call $~lib/runtime/doAllocate
i32.const 12
i32.store
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 0
i32.store
local.get $0
@ -5194,12 +5149,12 @@
call $~lib/set/Set<i64>#clear
local.get $0
)
(func $~lib/util/hash/HASH<f64> (; 63 ;) (type $FUNCSIG$id) (param $0 f64) (result i32)
(func $~lib/util/hash/HASH<f64> (; 64 ;) (type $FUNCSIG$id) (param $0 f64) (result i32)
local.get $0
i64.reinterpret_f64
call $~lib/util/hash/hash64
)
(func $~lib/set/Set<f64>#find (; 64 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32)
(func $~lib/set/Set<f64>#find (; 65 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32)
local.get $0
i32.load
local.get $0
@ -5242,7 +5197,7 @@
end
i32.const 0
)
(func $~lib/set/Set<f64>#has (; 65 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32)
(func $~lib/set/Set<f64>#has (; 66 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32)
local.get $0
local.get $1
local.get $1
@ -5251,7 +5206,7 @@
i32.const 0
i32.ne
)
(func $~lib/set/Set<f64>#rehash (; 66 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/set/Set<f64>#rehash (; 67 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -5349,7 +5304,7 @@
i32.load offset=20
i32.store offset=16
)
(func $~lib/set/Set<f64>#add (; 67 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64)
(func $~lib/set/Set<f64>#add (; 68 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -5432,7 +5387,7 @@
i32.store
end
)
(func $~lib/set/Set<f64>#delete (; 68 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64)
(func $~lib/set/Set<f64>#delete (; 69 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64)
(local $2 i32)
(local $3 i32)
local.get $0
@ -5494,7 +5449,7 @@
call $~lib/set/Set<f64>#rehash
end
)
(func $std/set/test<f64> (; 69 ;) (type $FUNCSIG$v)
(func $std/set/test<f64> (; 70 ;) (type $FUNCSIG$v)
(local $0 f64)
(local $1 i32)
call $~lib/set/Set<f64>#constructor
@ -5739,7 +5694,7 @@
unreachable
end
)
(func $start (; 70 ;) (type $FUNCSIG$v)
(func $start (; 71 ;) (type $FUNCSIG$v)
i32.const 128
global.set $~lib/allocator/arena/startOffset
global.get $~lib/allocator/arena/startOffset
@ -5755,7 +5710,7 @@
call $std/set/test<f32>
call $std/set/test<f64>
)
(func $null (; 71 ;) (type $FUNCSIG$v)
(func $null (; 72 ;) (type $FUNCSIG$v)
nop
)
)

File diff suppressed because it is too large Load Diff