From b8a08da7a5d1836142258105d78d286669f22ebb Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 16 Mar 2019 07:26:33 +0100 Subject: [PATCH] more static array --- src/compiler.ts | 243 +- src/program.ts | 43 +- std/assembly/runtime.ts | 81 +- std/portable/index.d.ts | 22 +- .../compiler/std/array-literal.optimized.wat | 2402 +++++++--- .../compiler/std/array-literal.untouched.wat | 3844 ++++++++++++----- tests/compiler/std/map.optimized.wat | 293 +- tests/compiler/std/map.untouched.wat | 348 +- tests/compiler/std/set.optimized.wat | 281 +- tests/compiler/std/set.untouched.wat | 348 +- 10 files changed, 5328 insertions(+), 2577 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index d26a4244..180f10a0 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -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(expression, contextualType); + expr = this.compileLiteralExpression(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], (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() - // )); - // 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,34 +6577,54 @@ 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 wrapArrayInstance = this.resolver.resolveFunction(wrapArrayPrototype, [ elementType ]); - if (!wrapArrayInstance) { + 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 module.createUnreachable(); + 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; + return module.createUnreachable(); + } + let previousFlow = this.currentFlow; + let tempLocal = previousFlow.getTempLocal(arrayBufferInstance.type, false); + let flow = Flow.createInline(previousFlow.parentFunction, wrapArrayInstance); + flow.addScopedAlias(wrapArrayInstance.signature.getParameterName(0), arrayBufferInstance.type, tempLocal.index); + this.currentFlow = flow; + let body = this.compileFunctionBody(wrapArrayInstance); + body.unshift( + module.createSetLocal(tempLocal.index, + program.options.isWasm64 + ? this.module.createI64(i64_low(bufferAddress), i64_high(bufferAddress)) + : this.module.createI32(i64_low(bufferAddress)) + ) + ); + previousFlow.freeTempLocal(tempLocal); + this.currentFlow = previousFlow; + this.currentType = arrayType; + return module.createBlock(flow.inlineReturnLabel, body, this.options.nativeSizeType); } - 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); - this.currentFlow = flow; - let body = this.compileFunctionBody(wrapArrayInstance); - body.unshift( - module.createSetLocal(tempLocal.index, - this.ensureStaticArrayBuffer(elementType, constantValues) - ) - ); - previousFlow.freeTempLocal(tempLocal); - this.currentFlow = previousFlow; - this.currentType = arrayType; - return module.createBlock(flow.inlineReturnLabel, body, this.options.nativeSizeType); } // otherwise compile an explicit instantiation with indexed sets @@ -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( diff --git a/src/program.ts b/src/program.ts index 681c4f6e..60663d52 100644 --- a/src/program.ts +++ b/src/program.ts @@ -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).memoryOffset; } + + /** Writes a field value to a buffer and returns the number of bytes written. */ + writeField(name: string, value: T, buffer: Uint8Array, baseOffset: i32): i32 { + var field = this.lookupInSelf(name); + if (field && field.kind == ElementKind.FIELD) { + let offset = baseOffset + (field).memoryOffset; + switch ((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. */ diff --git a/std/assembly/runtime.ts b/std/assembly/runtime.ts index 2aed821d..2635ef59 100644 --- a/std/assembly/runtime.ts +++ b/std/assembly/runtime.ts @@ -40,7 +40,7 @@ export declare function CLASSID(): 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
(memory.allocate(ADJUST(payloadSize))); + return doAllocate(payloadSize); +} + +function doAllocate(payloadSize: usize): usize { + var header = changetype
(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
(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
(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(ref: usize): T { - ASSERT_UNREGISTERED(ref); - changetype
(ref - HEADER_SIZE).classId = CLASSID(); + return changetype(doRegister(ref, CLASSID())); +} + +function doRegister(ref: usize, classId: u32): usize { + if (!ASC_NO_ASSERT) assertUnregistered(ref); + changetype
(ref - HEADER_SIZE).classId = classId; // @ts-ignore: stub if (GC_IMPLEMENTED) __gc_register(ref); - return changetype(ref); + return ref; } /** Links a registered object with the (registered) object now referencing it. */ // @ts-ignore: decorator @unsafe @inline export function LINK(ref: T, parentRef: TParent): void { - ASSERT_REGISTERED(changetype(ref)); - ASSERT_REGISTERED(changetype(parentRef)); + doLink(changetype(ref), changetype(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(ref), changetype(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(ref - HEADER_SIZE)); } @@ -142,39 +165,33 @@ export function DISCARD(ref: usize): void { // @ts-ignore: decorator @unsafe @inline export function WRAPARRAY(buffer: ArrayBuffer): T[] { - // TODO: this is quite a lot to compile inline - var array = REGISTER(ALLOCATE(offsetof())); + return changetype(doWrapArray(buffer, CLASSID(), alignof())); +} + +function doWrapArray(buffer: ArrayBuffer, classId: u32, alignLog2: usize): usize { + var array = doRegister(doAllocate(offsetof()), classId); var bufferSize = buffer.byteLength; - var newBuffer = REGISTER(ALLOCATE(bufferSize)); - changetype(array).data = newBuffer; // links + var newBuffer = doRegister(doAllocate(bufferSize), classId); + changetype(array).data = changetype(newBuffer); // links changetype(array).dataStart = changetype(newBuffer); changetype(array).dataEnd = changetype(newBuffer) + bufferSize; - store(changetype(array), (bufferSize >>> alignof()), offsetof("length_")); - if (isManaged()) { - ERROR("unexpected managed type"); // not used currently - let dataOffset: usize = 0; - while (dataOffset < bufferSize) { - let element: T = load(changetype(buffer) + dataOffset); - store(changetype(newBuffer) + dataOffset, element); - LINK(element, array); - dataOffset += sizeof(); - } - } else { - memory.copy(changetype(newBuffer), changetype(buffer), bufferSize); - } - return array; + store(changetype(array), (bufferSize >>> alignLog2), offsetof("length_")); + memory.copy(changetype(newBuffer), changetype(buffer), bufferSize); + return changetype(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
(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
(ref - HEADER_SIZE).classId != HEADER_MAGIC); } diff --git a/std/portable/index.d.ts b/std/portable/index.d.ts index 8ce84c9d..3e54395f 100644 --- a/std/portable/index.d.ts +++ b/std/portable/index.d.ts @@ -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; diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index 3a475bf6..cdf7ba46 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1,27 +1,30 @@ (module - (type $FUNCSIG$v (func)) - (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$ii (func (param i32) (result 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$vi (func (param i32))) (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) (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) "\03") - (data (i32.const 17) "\01\02") - (data (i32.const 24) "\08\00\00\00\03") - (data (i32.const 32) "\14\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") - (data (i32.const 80) "\0c") - (data (i32.const 92) "\01\00\00\00\02") - (data (i32.const 112) "P\00\00\00\03") - (data (i32.const 128) "x") - (data (i32.const 136) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") + (data (i32.const 8) "\01\00\00\00\03\00\00\00\00\01\02") + (data (i32.const 24) "\02\00\00\00\10\00\00\00\10\00\00\00\10\00\00\00\13\00\00\00\03") + (data (i32.const 48) "\03\00\00\00(\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") + (data (i32.const 96) "\01\00\00\00\0c\00\00\00\00\00\00\00\01\00\00\00\02") + (data (i32.const 120) "\04\00\00\00\10\00\00\00h\00\00\00h\00\00\00t\00\00\00\03") + (data (i32.const 144) "\01") + (data (i32.const 152) "\04\00\00\00\10\00\00\00\98\00\00\00\98\00\00\00\98") + (data (i32.const 176) "\03\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s") + (data (i32.const 216) "\03\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 264) "\03\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") (table $0 1 funcref) (elem (i32.const 0) $null) + (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 160)) + (global $std/array-literal/i (mut i32) (i32.const 0)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) - (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 128)) - (global $std/array-literal/i (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayRef (mut i32) (i32.const 0)) @@ -29,7 +32,7 @@ (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/memory/memory.allocate (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -52,15 +55,15 @@ i32.add i32.const -8 i32.and - local.tee $2 + local.tee $0 current_memory - local.tee $3 + local.tee $2 i32.const 16 i32.shl i32.gt_u if - local.get $3 local.get $2 + local.get $0 local.get $1 i32.sub i32.const 65535 @@ -69,16 +72,16 @@ i32.and i32.const 16 i32.shr_u - local.tee $0 + local.tee $3 + local.get $2 local.get $3 - local.get $0 i32.gt_s select grow_memory i32.const 0 i32.lt_s if - local.get $0 + local.get $3 grow_memory i32.const 0 i32.lt_s @@ -87,23 +90,12 @@ end end end - local.get $2 + local.get $0 global.set $~lib/allocator/arena/offset local.get $1 ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 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) - local.get $0 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 168 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end i32.const 1 i32.const 32 local.get $0 @@ -112,584 +104,1874 @@ i32.clz i32.sub i32.shl - call $~lib/allocator/arena/__memory_allocate + call $~lib/memory/memory.allocate local.tee $1 - local.get $0 + i32.const -1520547049 i32.store local.get $1 + local.get $0 + i32.store offset=4 + local.get $1 + i32.const 8 + i32.add ) - (func $~lib/internal/memory/memset (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/memory/memory.fill (; 3 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) - local.get $1 - i32.eqz - if - return - end - local.get $0 - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 1 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - i32.const 0 - i32.store8 - local.get $0 - i32.const 2 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 2 - i32.sub - i32.const 0 - i32.store8 - local.get $2 - i32.const 3 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - i32.const 0 - i32.store8 - local.get $0 - local.get $1 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store8 - local.get $1 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.tee $2 - local.get $0 - i32.add - local.tee $0 - i32.const 0 - i32.store - local.get $1 - local.get $2 - i32.sub - i32.const -4 - i32.and - local.tee $1 - local.get $0 - i32.add - i32.const 4 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 12 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 8 - i32.sub - i32.const 0 - i32.store - local.get $1 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 16 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 20 - i32.add - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.add - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.add - local.tee $2 - i32.const 28 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 24 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 20 - i32.sub - i32.const 0 - i32.store - local.get $2 - i32.const 16 - i32.sub - i32.const 0 - i32.store - local.get $0 - i32.const 4 - i32.and - i32.const 24 - i32.add - local.tee $2 - local.get $0 - i32.add - local.set $0 - local.get $1 - local.get $2 - i32.sub - local.set $1 - loop $continue|0 + block $~lib/util/memory/memset|inlined.0 local.get $1 - i32.const 32 - i32.ge_u - if - local.get $0 - i64.const 0 - i64.store - local.get $0 - i32.const 8 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 16 - i32.add - i64.const 0 - i64.store - local.get $0 - i32.const 24 - i32.add - i64.const 0 - i64.store + i32.eqz + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 1 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 2 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 1 + i32.add + i32.const 0 + i32.store8 + local.get $0 + i32.const 2 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 2 + i32.sub + i32.const 0 + i32.store8 + local.get $2 + i32.const 3 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 6 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 3 + i32.add + i32.const 0 + i32.store8 + local.get $0 + local.get $1 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store8 + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $1 + i32.const 0 + local.get $0 + i32.sub + i32.const 3 + i32.and + local.tee $2 + i32.sub + local.set $1 + local.get $0 + local.get $2 + i32.add + local.tee $0 + i32.const 0 + i32.store + local.get $1 + i32.const -4 + i32.and + local.tee $1 + local.get $0 + i32.add + i32.const 4 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 8 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 4 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 8 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 12 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 8 + i32.sub + i32.const 0 + i32.store + local.get $1 + i32.const 24 + i32.le_u + br_if $~lib/util/memory/memset|inlined.0 + local.get $0 + i32.const 12 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 16 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 20 + i32.add + i32.const 0 + i32.store + local.get $0 + i32.const 24 + i32.add + i32.const 0 + i32.store + local.get $0 + local.get $1 + i32.add + local.tee $2 + i32.const 28 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 24 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 20 + i32.sub + i32.const 0 + i32.store + local.get $2 + i32.const 16 + i32.sub + i32.const 0 + i32.store + local.get $0 + i32.const 4 + i32.and + i32.const 24 + i32.add + local.tee $2 + local.get $0 + i32.add + local.set $0 + local.get $1 + local.get $2 + i32.sub + local.set $1 + loop $continue|0 local.get $1 i32.const 32 - i32.sub - local.set $1 - local.get $0 - i32.const 32 - i32.add - local.set $0 - br $continue|0 + i32.ge_u + if + local.get $0 + i64.const 0 + i64.store + local.get $0 + i32.const 8 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 16 + i32.add + i64.const 0 + i64.store + local.get $0 + i32.const 24 + i32.add + i64.const 0 + i64.store + local.get $1 + i32.const 32 + i32.sub + local.set $1 + local.get $0 + i32.const 32 + i32.add + local.set $0 + br $continue|0 + end end end ) - (func $~lib/array/Array#constructor (; 4 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) - (local $1 i32) - i32.const 3 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $1 + (func $~lib/runtime/assertUnregistered (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + i32.const 300 + i32.le_u + if + i32.const 0 + i32.const 184 + i32.const 188 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 i32.const 8 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 0 - i32.store + i32.sub + i32.load + i32.const -1520547049 + i32.ne + if + i32.const 0 + i32.const 184 + i32.const 189 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/runtime/doRegister (; 5 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 - i32.const 0 - i32.store offset=4 + call $~lib/runtime/assertUnregistered local.get $0 + i32.const 8 + i32.sub local.get $1 i32.store local.get $0 - i32.const 3 - i32.store offset=4 - local.get $1 - i32.const 8 - i32.add - i32.const 3 - call $~lib/internal/memory/memset - local.get $0 ) - (func $~lib/array/Array#constructor (; 5 ;) (type $FUNCSIG$i) (result i32) - (local $0 i32) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - i32.const 12 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $1 - i32.const 8 - call $~lib/allocator/arena/__memory_allocate - local.tee $0 - i32.const 0 - i32.store local.get $0 - i32.const 0 - i32.store offset=4 + i32.const 1073741816 + i32.gt_u + if + i32.const 0 + i32.const 224 + i32.const 24 + i32.const 43 + call $~lib/env/abort + unreachable + end local.get $0 + call $~lib/runtime/doAllocate + local.tee $1 + local.get $0 + call $~lib/memory/memory.fill local.get $1 - i32.store - local.get $0 + i32.const 1 + call $~lib/runtime/doRegister + ) + (func $~lib/runtime/ArrayBufferView#constructor (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) i32.const 3 - i32.store offset=4 + i32.const 1073741816 local.get $1 - i32.const 8 + i32.shr_u + i32.gt_u + if + i32.const 0 + i32.const 184 + i32.const 223 + i32.const 57 + call $~lib/env/abort + unreachable + end + i32.const 3 + local.get $1 + i32.shl + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $1 + local.get $0 + i32.eqz + if + i32.const 12 + call $~lib/runtime/doAllocate + i32.const 5 + call $~lib/runtime/doRegister + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + local.get $1 + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.get $1 + i32.const 3 i32.add - i32.const 12 - call $~lib/internal/memory/memset + i32.store offset=8 local.get $0 ) - (func $start:std/array-literal (; 6 ;) (type $FUNCSIG$v) + (func $~lib/util/memory/memcpy (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + loop $continue|0 + local.get $1 + i32.const 3 + i32.and + local.get $2 + local.get $2 + select + if + local.get $0 + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $continue|0 + end + end + local.get $0 + i32.const 3 + i32.and + i32.eqz + if + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|1 + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $1 + i32.const 8 + i32.add + local.set $1 + local.get $0 + i32.const 8 + i32.add + local.set $0 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $1 + i32.const 4 + i32.add + local.set $1 + local.get $0 + i32.const 4 + i32.add + local.set $0 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $1 + i32.const 2 + i32.add + local.set $1 + local.get $0 + i32.const 2 + i32.add + local.set $0 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + local.get $0 + i32.const 3 + i32.and + local.tee $3 + i32.const 1 + i32.ne + if + local.get $3 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $3 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + local.get $1 + i32.load + local.set $5 + local.get $0 + local.get $1 + local.tee $3 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $1 + local.set $0 + local.get $1 + local.get $3 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.load + local.tee $3 + i32.const 8 + i32.shl + local.get $5 + i32.const 24 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 5 + i32.add + i32.load + local.tee $5 + i32.const 8 + i32.shl + local.get $3 + i32.const 24 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 9 + i32.add + i32.load + local.tee $3 + i32.const 8 + i32.shl + local.get $5 + i32.const 24 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 13 + i32.add + i32.load + local.tee $5 + i32.const 8 + i32.shl + local.get $3 + i32.const 24 + i32.shr_u + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|3 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $5 + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + local.get $0 + local.get $1 + i32.const 2 + i32.add + i32.load + local.tee $3 + i32.const 16 + i32.shl + local.get $5 + i32.const 16 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 6 + i32.add + i32.load + local.tee $5 + i32.const 16 + i32.shl + local.get $3 + i32.const 16 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 10 + i32.add + i32.load + local.tee $3 + i32.const 16 + i32.shl + local.get $5 + i32.const 16 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 14 + i32.add + i32.load + local.tee $5 + i32.const 16 + i32.shl + local.get $3 + i32.const 16 + i32.shr_u + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|4 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $5 + local.get $0 + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + local.get $0 + local.get $1 + i32.const 3 + i32.add + i32.load + local.tee $3 + i32.const 24 + i32.shl + local.get $5 + i32.const 8 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 7 + i32.add + i32.load + local.tee $5 + i32.const 24 + i32.shl + local.get $3 + i32.const 8 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 11 + i32.add + i32.load + local.tee $3 + i32.const 24 + i32.shl + local.get $5 + i32.const 8 + i32.shr_u + i32.or + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 15 + i32.add + i32.load + local.tee $5 + i32.const 24 + i32.shl + local.get $3 + i32.const 8 + i32.shr_u + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $continue|5 + end + end + end + end + local.get $2 + i32.const 16 + i32.and + if + local.get $0 + local.get $1 + local.tee $3 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $1 + local.set $0 + local.get $1 + local.get $3 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + local.tee $3 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $1 + local.set $0 + local.get $1 + local.get $3 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + local.tee $3 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $1 + local.set $0 + local.get $1 + local.get $3 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $3 + local.set $0 + local.get $3 + local.get $1 + i32.const 1 + i32.add + local.tee $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + local.get $0 + i32.const 1 + i32.add + local.tee $4 + i32.const 1 + i32.add + local.set $0 + local.get $1 + i32.const 1 + i32.add + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $3 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.get $1 + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 9 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $3 + local.get $1 + local.get $0 + local.tee $2 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $1 + local.get $3 + i32.add + local.get $2 + i32.le_u + local.tee $0 + i32.eqz + if + local.get $2 + local.get $3 + i32.add + local.get $1 + i32.le_u + local.set $0 + end + local.get $0 + if + local.get $2 + local.get $1 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $2 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $2 + i32.const 7 + i32.and + i32.eq + if + loop $continue|0 + local.get $2 + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $2 + local.tee $4 + i32.const 1 + i32.add + local.set $2 + local.get $1 + local.tee $0 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $0 + i32.load8_u + i32.store8 + br $continue|0 + end + end + loop $continue|1 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $2 + local.get $1 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $2 + i32.const 8 + i32.add + local.set $2 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $continue|1 + end + end + end + loop $continue|2 + local.get $3 + if + local.get $2 + local.tee $4 + i32.const 1 + i32.add + local.set $2 + local.get $1 + local.tee $0 + i32.const 1 + i32.add + local.set $1 + local.get $4 + local.get $0 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $2 + i32.const 7 + i32.and + i32.eq + if + loop $continue|3 + local.get $2 + local.get $3 + i32.add + i32.const 7 + i32.and + if + local.get $3 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + local.get $2 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|3 + end + end + loop $continue|4 + local.get $3 + i32.const 8 + i32.ge_u + if + local.get $3 + i32.const 8 + i32.sub + local.tee $3 + local.get $2 + i32.add + local.get $1 + local.get $3 + i32.add + i64.load + i64.store + br $continue|4 + end + end + end + loop $continue|5 + local.get $3 + if + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + local.get $2 + i32.add + local.get $1 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + ) + (func $~lib/runtime/doReallocate (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.const 8 + i32.sub + local.tee $3 + i32.load offset=4 + local.tee $2 + local.get $1 + i32.lt_u + if + i32.const 1 + i32.const 32 + local.get $2 + i32.const 7 + i32.add + i32.clz + i32.sub + i32.shl + i32.const 0 + local.get $0 + i32.const 300 + i32.gt_u + select + i32.const 1 + i32.const 32 + local.get $1 + i32.const 7 + i32.add + i32.clz + i32.sub + i32.shl + local.tee $4 + i32.lt_u + if + local.get $4 + call $~lib/memory/memory.allocate + local.tee $4 + local.get $3 + i32.load + i32.store + local.get $4 + i32.const 8 + i32.add + local.tee $5 + local.get $0 + local.get $2 + call $~lib/memory/memory.copy + local.get $2 + local.get $5 + i32.add + local.get $1 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + local.get $3 + i32.load + i32.const -1520547049 + i32.eq + if + local.get $0 + i32.const 300 + i32.le_u + if + i32.const 0 + i32.const 184 + i32.const 100 + i32.const 8 + call $~lib/env/abort + unreachable + end + end + local.get $4 + local.set $3 + local.get $5 + local.set $0 + else + local.get $0 + local.get $2 + i32.add + local.get $1 + local.get $2 + i32.sub + call $~lib/memory/memory.fill + end + end + local.get $3 + local.get $1 + i32.store offset=4 + local.get $0 + ) + (func $~lib/array/Array#resize (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $1 + local.get $0 + i32.load + local.tee $2 + i32.const 8 + i32.sub + i32.load offset=4 + i32.gt_u + if + local.get $1 + i32.const 1073741816 + i32.gt_u + if + i32.const 0 + i32.const 272 + i32.const 37 + i32.const 41 + call $~lib/env/abort + unreachable + end + local.get $2 + local.tee $3 + local.get $1 + call $~lib/runtime/doReallocate + local.tee $2 + local.get $3 + i32.ne + if + local.get $0 + local.get $2 + i32.store + local.get $0 + local.get $2 + i32.store offset=4 + local.get $0 + local.get $1 + local.get $2 + i32.add + i32.store offset=8 + end + end + ) + (func $~lib/array/Array#__set (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#resize + local.get $1 + local.get $0 + i32.load offset=4 + i32.add + local.get $2 + i32.store8 + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + ) + (func $~lib/array/Array#resize (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + local.get $1 + local.get $0 + i32.load + local.tee $2 + i32.const 8 + i32.sub + i32.load offset=4 + i32.const 2 + i32.shr_u + i32.gt_u + if + local.get $1 + i32.const 268435454 + i32.gt_u + if + i32.const 0 + i32.const 272 + i32.const 37 + i32.const 41 + call $~lib/env/abort + unreachable + end + local.get $2 + local.tee $3 + local.get $1 + i32.const 2 + i32.shl + local.tee $2 + call $~lib/runtime/doReallocate + local.tee $1 + local.get $3 + i32.ne + if + local.get $0 + local.get $1 + i32.store + local.get $0 + local.get $1 + i32.store offset=4 + local.get $0 + local.get $1 + local.get $2 + i32.add + i32.store offset=8 + end + end + ) + (func $~lib/array/Array#__set (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#resize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + ) + (func $std/array-literal/Ref#constructor (; 15 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $~lib/runtime/doAllocate + i32.const 6 + call $~lib/runtime/doRegister + ) + (func $std/array-literal/RefWithCtor#constructor (; 16 ;) (type $FUNCSIG$i) (result i32) + i32.const 0 + call $~lib/runtime/doAllocate + i32.const 8 + call $~lib/runtime/doRegister + ) + (func $start:std/array-literal (; 17 ;) (type $FUNCSIG$v) (local $0 i32) - (local $1 i32) - i32.const 232 - global.set $~lib/allocator/arena/startOffset - global.get $~lib/allocator/arena/startOffset - global.set $~lib/allocator/arena/offset - i32.const 28 + i32.const 44 i32.load i32.const 3 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 4 i32.const 0 call $~lib/env/abort unreachable end - i32.const 0 - i32.const 24 + i32.const 36 i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.load8_s if i32.const 0 - i32.const 32 + i32.const 56 i32.const 5 i32.const 0 call $~lib/env/abort unreachable end - i32.const 1 - i32.const 24 + i32.const 36 i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 1 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.load8_s offset=1 i32.const 1 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 6 i32.const 0 call $~lib/env/abort unreachable end - i32.const 2 - i32.const 24 + i32.const 36 i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.load8_s offset=2 i32.const 2 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 7 i32.const 0 call $~lib/env/abort unreachable end - i32.const 116 + i32.const 140 i32.load i32.const 3 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 10 i32.const 0 call $~lib/env/abort unreachable end - i32.const 0 - i32.const 112 + i32.const 132 i32.load - local.tee $0 i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end if i32.const 0 - i32.const 32 + i32.const 56 i32.const 11 i32.const 0 call $~lib/env/abort unreachable end - i32.const 1 - i32.const 112 + i32.const 132 i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.load offset=4 i32.const 1 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 12 i32.const 0 call $~lib/env/abort unreachable end - i32.const 2 - i32.const 112 + i32.const 132 i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + i32.load offset=8 i32.const 2 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 13 i32.const 0 call $~lib/env/abort unreachable end global.get $std/array-literal/emptyArrayI32 - i32.load offset=4 + i32.load offset=12 if i32.const 0 - i32.const 32 + i32.const 56 i32.const 16 i32.const 0 call $~lib/env/abort unreachable end - call $~lib/array/Array#constructor - local.tee $0 - i32.load - global.get $std/array-literal/i - local.tee $1 - i32.store8 offset=8 - local.get $1 - i32.const 1 - i32.add - global.set $std/array-literal/i - local.get $0 - i32.load - i32.const 1 - i32.add - global.get $std/array-literal/i - local.tee $1 - i32.store8 offset=8 - local.get $1 - i32.const 1 - i32.add - global.set $std/array-literal/i - local.get $0 - i32.load + i32.const 304 + global.set $~lib/allocator/arena/startOffset + global.get $~lib/allocator/arena/startOffset + global.set $~lib/allocator/arena/offset + i32.const 16 + call $~lib/runtime/doAllocate i32.const 2 - i32.add + call $~lib/runtime/doRegister + i32.const 0 + call $~lib/runtime/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 3 + i32.store offset=12 + local.get $0 + i32.const 0 global.get $std/array-literal/i - i32.store8 offset=8 + call $~lib/array/Array#__set + global.get $std/array-literal/i + i32.const 1 + i32.add + global.set $std/array-literal/i + local.get $0 + i32.const 1 + global.get $std/array-literal/i + call $~lib/array/Array#__set + global.get $std/array-literal/i + i32.const 1 + i32.add + global.set $std/array-literal/i + local.get $0 + i32.const 2 + global.get $std/array-literal/i + call $~lib/array/Array#__set local.get $0 global.set $std/array-literal/dynamicArrayI8 global.get $std/array-literal/dynamicArrayI8 - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 21 i32.const 0 call $~lib/env/abort unreachable end - i32.const 0 global.get $std/array-literal/dynamicArrayI8 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.load offset=4 + i32.load8_s if i32.const 0 - i32.const 32 + i32.const 56 i32.const 22 i32.const 0 call $~lib/env/abort unreachable end - i32.const 1 global.get $std/array-literal/dynamicArrayI8 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 1 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.load offset=4 + i32.load8_s offset=1 i32.const 1 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 23 i32.const 0 call $~lib/env/abort unreachable end - i32.const 2 global.get $std/array-literal/dynamicArrayI8 - i32.load - local.tee $0 - i32.load - i32.lt_u - if (result i32) - local.get $0 - i32.const 2 - i32.add - i32.load8_s offset=8 - else - unreachable - end - i32.const 255 - i32.and + i32.load offset=4 + i32.load8_s offset=2 i32.const 2 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 24 i32.const 0 call $~lib/env/abort @@ -697,208 +1979,170 @@ end i32.const 0 global.set $std/array-literal/i - call $~lib/array/Array#constructor - local.tee $0 - i32.load - global.get $std/array-literal/i - local.tee $1 - i32.store offset=8 - local.get $1 - i32.const 1 - i32.add - global.set $std/array-literal/i - local.get $0 - i32.load + i32.const 16 + call $~lib/runtime/doAllocate i32.const 4 - i32.add + call $~lib/runtime/doRegister + i32.const 2 + call $~lib/runtime/ArrayBufferView#constructor + local.tee $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 3 + i32.store offset=12 + local.get $0 + i32.const 0 + global.get $std/array-literal/i + call $~lib/array/Array#__set global.get $std/array-literal/i - local.tee $1 - i32.store offset=8 - local.get $1 i32.const 1 i32.add global.set $std/array-literal/i local.get $0 - i32.load - i32.const 8 - i32.add + i32.const 1 global.get $std/array-literal/i - i32.store offset=8 + call $~lib/array/Array#__set + global.get $std/array-literal/i + i32.const 1 + i32.add + global.set $std/array-literal/i + local.get $0 + i32.const 2 + global.get $std/array-literal/i + call $~lib/array/Array#__set local.get $0 global.set $std/array-literal/dynamicArrayI32 global.get $std/array-literal/dynamicArrayI32 - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 29 i32.const 0 call $~lib/env/abort unreachable end - i32.const 0 global.get $std/array-literal/dynamicArrayI32 + i32.load offset=4 i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.load offset=8 - else - unreachable - end if i32.const 0 - i32.const 32 + i32.const 56 i32.const 30 i32.const 0 call $~lib/env/abort unreachable end - i32.const 1 global.get $std/array-literal/dynamicArrayI32 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 4 - i32.add - i32.load offset=8 - else - unreachable - end + i32.load offset=4 + i32.load offset=4 i32.const 1 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 31 i32.const 0 call $~lib/env/abort unreachable end - i32.const 2 global.get $std/array-literal/dynamicArrayI32 - i32.load - local.tee $0 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $0 - i32.const 8 - i32.add - i32.load offset=8 - else - unreachable - end + i32.load offset=4 + i32.load offset=8 i32.const 2 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 32 i32.const 0 call $~lib/env/abort unreachable end - call $~lib/array/Array#constructor - local.set $0 + i32.const 16 + call $~lib/runtime/doAllocate + i32.const 7 + call $~lib/runtime/doRegister + i32.const 2 + call $~lib/runtime/ArrayBufferView#constructor + local.tee $0 i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + i32.store offset=12 + local.get $0 + i32.const 3 + i32.store offset=12 local.get $0 - i32.load - local.get $1 - i32.store offset=8 i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + call $std/array-literal/Ref#constructor + call $~lib/array/Array#__set local.get $0 - i32.load - i32.const 4 - i32.add - local.get $1 - i32.store offset=8 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + i32.const 1 + call $std/array-literal/Ref#constructor + call $~lib/array/Array#__set local.get $0 - i32.load - i32.const 8 - i32.add - local.get $1 - i32.store offset=8 + i32.const 2 + call $std/array-literal/Ref#constructor + call $~lib/array/Array#__set local.get $0 global.set $std/array-literal/dynamicArrayRef global.get $std/array-literal/dynamicArrayRef - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 36 i32.const 0 call $~lib/env/abort unreachable end - call $~lib/array/Array#constructor - local.set $0 + i32.const 16 + call $~lib/runtime/doAllocate + i32.const 9 + call $~lib/runtime/doRegister + i32.const 2 + call $~lib/runtime/ArrayBufferView#constructor + local.tee $0 i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + i32.store offset=12 + local.get $0 + i32.const 3 + i32.store offset=12 local.get $0 - i32.load - local.get $1 - i32.store offset=8 i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + call $std/array-literal/RefWithCtor#constructor + call $~lib/array/Array#__set local.get $0 - i32.load - i32.const 4 - i32.add - local.get $1 - i32.store offset=8 - i32.const 0 - call $~lib/allocator/arena/__memory_allocate - local.set $1 + i32.const 1 + call $std/array-literal/RefWithCtor#constructor + call $~lib/array/Array#__set local.get $0 - i32.load - i32.const 8 - i32.add - local.get $1 - i32.store offset=8 + i32.const 2 + call $std/array-literal/RefWithCtor#constructor + call $~lib/array/Array#__set local.get $0 global.set $std/array-literal/dynamicArrayRefWithCtor global.get $std/array-literal/dynamicArrayRefWithCtor - i32.load offset=4 + i32.load offset=12 i32.const 3 i32.ne if i32.const 0 - i32.const 32 + i32.const 56 i32.const 40 i32.const 0 call $~lib/env/abort unreachable end ) - (func $start (; 7 ;) (type $FUNCSIG$v) + (func $start (; 18 ;) (type $FUNCSIG$v) call $start:std/array-literal ) - (func $null (; 8 ;) (type $FUNCSIG$v) + (func $null (; 19 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 20a25ad5..5dd1c870 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -1,37 +1,2731 @@ (module - (type $FUNCSIG$v (func)) + (type $FUNCSIG$ii (func (param i32) (result i32))) (type $FUNCSIG$viiii (func (param i32 i32 i32 i32))) (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) + (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) (type $FUNCSIG$viii (func (param i32 i32 i32))) + (type $FUNCSIG$vi (func (param i32))) + (type $FUNCSIG$vii (func (param i32 i32))) + (type $FUNCSIG$v (func)) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 8) "\03\00\00\00\00\00\00\00\00\01\02\00\00\00\00\00") - (data (i32.const 24) "\08\00\00\00\03\00\00\00") - (data (i32.const 32) "\14\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") - (data (i32.const 80) "\0c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 112) "P\00\00\00\03\00\00\00") - (data (i32.const 120) "\00\00\00\00\00\00\00\00") - (data (i32.const 128) "x\00\00\00\00\00\00\00") - (data (i32.const 136) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 168) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00") + (data (i32.const 8) "\01\00\00\00\03\00\00\00\00\01\02") + (data (i32.const 24) "\02\00\00\00\10\00\00\00\10\00\00\00\10\00\00\00\13\00\00\00\03\00\00\00") + (data (i32.const 48) "\03\00\00\00(\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") + (data (i32.const 96) "\01\00\00\00\0c\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 120) "\04\00\00\00\10\00\00\00h\00\00\00h\00\00\00t\00\00\00\03\00\00\00") + (data (i32.const 144) "\01\00\00\00\00\00\00\00") + (data (i32.const 152) "\04\00\00\00\10\00\00\00\98\00\00\00\98\00\00\00\98\00\00\00\00\00\00\00") + (data (i32.const 176) "\03\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 216) "\03\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 264) "\03\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) + (global $std/array-literal/staticArrayI8 i32 (i32.const 32)) + (global $~lib/runtime/GC_IMPLEMENTED i32 (i32.const 0)) + (global $~lib/runtime/HEADER_SIZE i32 (i32.const 8)) + (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) + (global $std/array-literal/staticArrayI32 i32 (i32.const 128)) + (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 160)) + (global $std/array-literal/i (mut i32) (i32.const 0)) + (global $~lib/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 $std/array-literal/staticArrayI8 i32 (i32.const 24)) - (global $std/array-literal/staticArrayI32 i32 (i32.const 112)) - (global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 128)) - (global $std/array-literal/i (mut i32) (i32.const 0)) + (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) (global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayRef (mut i32) (i32.const 0)) (global $std/array-literal/dynamicArrayRefWithCtor (mut i32) (i32.const 0)) - (global $~lib/memory/HEAP_BASE i32 (i32.const 228)) + (global $~lib/memory/HEAP_BASE i32 (i32.const 300)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $start:~lib/allocator/arena (; 1 ;) (type $FUNCSIG$v) + (func $~lib/array/Array#get:length (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/array/Array#get:length (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $~lib/runtime/adjustToBlock (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + i32.const 1 + i32.const 32 + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.add + i32.const 1 + i32.sub + i32.clz + i32.sub + i32.shl + ) + (func $~lib/memory/memory.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/allocator/arena/__memory_allocate|inlined.0 (result i32) + local.get $0 + local.set $1 + local.get $1 + i32.const 1073741824 + i32.gt_u + if + unreachable + end + global.get $~lib/allocator/arena/offset + local.set $2 + local.get $2 + local.get $1 + local.tee $3 + i32.const 1 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select + i32.add + i32.const 7 + i32.add + i32.const 7 + i32.const -1 + i32.xor + i32.and + local.set $3 + current_memory + local.set $4 + local.get $3 + local.get $4 + i32.const 16 + i32.shl + i32.gt_u + if + local.get $3 + local.get $2 + i32.sub + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $5 + local.get $4 + local.tee $6 + local.get $5 + local.tee $7 + local.get $6 + local.get $7 + i32.gt_s + select + local.set $6 + local.get $6 + grow_memory + i32.const 0 + i32.lt_s + if + local.get $5 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $3 + global.set $~lib/allocator/arena/offset + local.get $2 + end + return + ) + (func $~lib/runtime/doAllocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + call $~lib/runtime/adjustToBlock + call $~lib/memory/memory.allocate + local.set $1 + local.get $1 + global.get $~lib/runtime/HEADER_MAGIC + i32.store + local.get $1 + local.get $0 + i32.store offset=4 + local.get $1 + global.get $~lib/runtime/HEADER_SIZE + i32.add + ) + (func $~lib/memory/memory.fill (; 6 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i64) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + local.get $5 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $3 + local.get $4 + i32.store8 + local.get $3 + local.get $5 + i32.add + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $5 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $3 + i32.const 1 + i32.add + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.add + local.get $4 + i32.store8 + local.get $3 + local.get $5 + i32.add + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $3 + local.get $5 + i32.add + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $5 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $3 + i32.const 3 + i32.add + local.get $4 + i32.store8 + local.get $3 + local.get $5 + i32.add + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $5 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $3 + i32.sub + i32.const 3 + i32.and + local.set $6 + local.get $3 + local.get $6 + i32.add + local.set $3 + local.get $5 + local.get $6 + i32.sub + local.set $5 + local.get $5 + i32.const -4 + i32.and + local.set $5 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $7 + local.get $3 + local.get $7 + i32.store + local.get $3 + local.get $5 + i32.add + i32.const 4 + i32.sub + local.get $7 + i32.store + local.get $5 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $3 + i32.const 4 + i32.add + local.get $7 + i32.store + local.get $3 + i32.const 8 + i32.add + local.get $7 + i32.store + local.get $3 + local.get $5 + i32.add + i32.const 12 + i32.sub + local.get $7 + i32.store + local.get $3 + local.get $5 + i32.add + i32.const 8 + i32.sub + local.get $7 + i32.store + local.get $5 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $3 + i32.const 12 + i32.add + local.get $7 + i32.store + local.get $3 + i32.const 16 + i32.add + local.get $7 + i32.store + local.get $3 + i32.const 20 + i32.add + local.get $7 + i32.store + local.get $3 + i32.const 24 + i32.add + local.get $7 + i32.store + local.get $3 + local.get $5 + i32.add + i32.const 28 + i32.sub + local.get $7 + i32.store + local.get $3 + local.get $5 + i32.add + i32.const 24 + i32.sub + local.get $7 + i32.store + local.get $3 + local.get $5 + i32.add + i32.const 20 + i32.sub + local.get $7 + i32.store + local.get $3 + local.get $5 + i32.add + i32.const 16 + i32.sub + local.get $7 + i32.store + i32.const 24 + local.get $3 + i32.const 4 + i32.and + i32.add + local.set $6 + local.get $3 + local.get $6 + i32.add + local.set $3 + local.get $5 + local.get $6 + i32.sub + local.set $5 + local.get $7 + i64.extend_i32_u + local.get $7 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $8 + block $break|0 + loop $continue|0 + local.get $5 + i32.const 32 + i32.ge_u + if + block + local.get $3 + local.get $8 + i64.store + local.get $3 + i32.const 8 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 16 + i32.add + local.get $8 + i64.store + local.get $3 + i32.const 24 + i32.add + local.get $8 + i64.store + local.get $5 + i32.const 32 + i32.sub + local.set $5 + local.get $3 + i32.const 32 + i32.add + local.set $3 + end + br $continue|0 + end + end + end + end + ) + (func $~lib/runtime/assertUnregistered (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + local.get $0 + global.get $~lib/memory/HEAP_BASE + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 188 + i32.const 2 + call $~lib/env/abort + unreachable + end + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + i32.load + global.get $~lib/runtime/HEADER_MAGIC + i32.eq + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 189 + i32.const 2 + call $~lib/env/abort + unreachable + end + ) + (func $~lib/runtime/doRegister (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/runtime/assertUnregistered + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + local.get $1 + i32.store + local.get $0 + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (; 9 ;) (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 + i32.gt_u + if + i32.const 0 + i32.const 224 + i32.const 24 + i32.const 43 + call $~lib/env/abort + unreachable + end + block $~lib/runtime/ALLOCATE|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/runtime/doAllocate + end + local.set $3 + local.get $3 + i32.const 0 + local.get $1 + call $~lib/memory/memory.fill + block $~lib/runtime/REGISTER|inlined.0 (result i32) + local.get $3 + local.set $2 + local.get $2 + i32.const 1 + call $~lib/runtime/doRegister + end + ) + (func $~lib/runtime/ALLOCATE (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/runtime/doAllocate + ) + (func $~lib/runtime/ArrayBufferView#constructor (; 11 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $1 + global.get $~lib/runtime/MAX_BYTELENGTH + local.get $2 + i32.shr_u + i32.gt_u + if + i32.const 0 + i32.const 184 + i32.const 223 + i32.const 57 + call $~lib/env/abort + unreachable + end + i32.const 0 + local.get $1 + local.get $2 + i32.shl + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $3 + block (result i32) + local.get $0 + i32.eqz + if + block $~lib/runtime/REGISTER|inlined.0 (result i32) + i32.const 12 + call $~lib/runtime/ALLOCATE + local.set $4 + local.get $4 + i32.const 5 + call $~lib/runtime/doRegister + end + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + end + local.get $3 + i32.store + local.get $0 + local.get $3 + i32.store offset=4 + local.get $0 + local.get $3 + local.get $1 + i32.add + i32.store offset=8 + local.get $0 + ) + (func $~lib/array/Array#constructor (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + call $~lib/runtime/ALLOCATE + local.set $2 + local.get $2 + i32.const 2 + call $~lib/runtime/doRegister + end + local.get $1 + i32.const 0 + call $~lib/runtime/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/arraybuffer/ArrayBuffer#get:byteLength (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + i32.load offset=4 + ) + (func $~lib/util/memory/memcpy (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + block $break|0 + loop $continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + local.get $2 + end + if + block + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + end + br $continue|0 + end + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + block $break|1 + loop $continue|1 + local.get $2 + i32.const 16 + i32.ge_u + if + block + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|1 + end + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + block $break|3 + loop $continue|3 + local.get $2 + i32.const 17 + i32.ge_u + if + block + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|3 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + block $break|4 + loop $continue|4 + local.get $2 + i32.const 18 + i32.ge_u + if + block + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|4 + end + end + end + br $break|2 + unreachable + end + unreachable + end + block + local.get $1 + i32.load + local.set $3 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + block $break|5 + loop $continue|5 + local.get $2 + i32.const 19 + i32.ge_u + if + block + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + end + br $continue|5 + end + end + end + br $break|2 + unreachable + end + unreachable + end + end + local.get $2 + i32.const 16 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + block (result i32) + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + end + block (result i32) + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + end + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $3 + local.get $1 + local.set $4 + local.get $2 + local.set $5 + local.get $3 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $5 + i32.add + local.get $3 + i32.le_u + local.tee $6 + if (result i32) + local.get $6 + else + local.get $3 + local.get $5 + i32.add + local.get $4 + i32.le_u + end + if + local.get $3 + local.get $4 + local.get $5 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.eq + if + block $break|0 + loop $continue|0 + local.get $3 + i32.const 7 + i32.and + if + block + local.get $5 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + i32.const 1 + i32.sub + local.set $5 + block (result i32) + local.get $3 + local.tee $6 + i32.const 1 + i32.add + local.set $3 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + end + br $continue|0 + end + end + end + block $break|1 + loop $continue|1 + local.get $5 + i32.const 8 + i32.ge_u + if + block + local.get $3 + local.get $4 + i64.load + i64.store + local.get $5 + i32.const 8 + i32.sub + local.set $5 + local.get $3 + i32.const 8 + i32.add + local.set $3 + local.get $4 + i32.const 8 + i32.add + local.set $4 + end + br $continue|1 + end + end + end + end + block $break|2 + loop $continue|2 + local.get $5 + if + block + block (result i32) + local.get $3 + local.tee $6 + i32.const 1 + i32.add + local.set $3 + local.get $6 + end + block (result i32) + local.get $4 + local.tee $6 + i32.const 1 + i32.add + local.set $4 + local.get $6 + end + i32.load8_u + i32.store8 + local.get $5 + i32.const 1 + i32.sub + local.set $5 + end + br $continue|2 + end + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.eq + if + block $break|3 + loop $continue|3 + local.get $3 + local.get $5 + i32.add + i32.const 7 + i32.and + if + block + local.get $5 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + local.get $5 + i32.const 1 + i32.sub + local.tee $5 + i32.add + local.get $4 + local.get $5 + i32.add + i32.load8_u + i32.store8 + end + br $continue|3 + end + end + end + block $break|4 + loop $continue|4 + local.get $5 + i32.const 8 + i32.ge_u + if + block + local.get $5 + i32.const 8 + i32.sub + local.set $5 + local.get $3 + local.get $5 + i32.add + local.get $4 + local.get $5 + i32.add + i64.load + i64.store + end + br $continue|4 + end + end + end + end + block $break|5 + loop $continue|5 + local.get $5 + if + local.get $3 + local.get $5 + i32.const 1 + i32.sub + local.tee $5 + i32.add + local.get $4 + local.get $5 + i32.add + i32.load8_u + i32.store8 + br $continue|5 + end + end + end + end + end + ) + (func $~lib/memory/memory.free (; 16 ;) (type $FUNCSIG$vi) (param $0 i32) + (local $1 i32) + local.get $0 + local.set $1 + ) + (func $~lib/runtime/doReallocate (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + local.set $2 + local.get $2 + i32.load offset=4 + local.set $3 + local.get $3 + local.get $1 + i32.lt_u + if + local.get $1 + call $~lib/runtime/adjustToBlock + local.set $4 + local.get $3 + call $~lib/runtime/adjustToBlock + i32.const 0 + local.get $0 + global.get $~lib/memory/HEAP_BASE + i32.gt_u + select + local.get $4 + i32.lt_u + if + local.get $4 + call $~lib/memory/memory.allocate + local.set $5 + local.get $5 + local.get $2 + i32.load + i32.store + local.get $5 + global.get $~lib/runtime/HEADER_SIZE + i32.add + local.set $6 + local.get $6 + local.get $0 + local.get $3 + call $~lib/memory/memory.copy + local.get $6 + local.get $3 + i32.add + i32.const 0 + local.get $1 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + local.get $2 + i32.load + global.get $~lib/runtime/HEADER_MAGIC + i32.eq + if + local.get $0 + global.get $~lib/memory/HEAP_BASE + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 184 + i32.const 100 + i32.const 8 + call $~lib/env/abort + unreachable + end + local.get $2 + call $~lib/memory/memory.free + else + nop + end + local.get $5 + local.set $2 + local.get $6 + local.set $0 + else + local.get $0 + local.get $3 + i32.add + i32.const 0 + local.get $1 + local.get $3 + i32.sub + call $~lib/memory/memory.fill + end + else + nop + end + local.get $2 + local.get $1 + i32.store offset=4 + local.get $0 + ) + (func $~lib/array/Array#resize (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load + local.set $2 + local.get $2 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.const 0 + i32.shr_u + local.set $3 + local.get $1 + local.get $3 + i32.gt_u + if + local.get $1 + i32.const 1073741816 + i32.gt_u + if + i32.const 0 + i32.const 272 + i32.const 37 + i32.const 41 + call $~lib/env/abort + unreachable + end + local.get $1 + i32.const 0 + i32.shl + local.set $4 + block $~lib/runtime/REALLOCATE|inlined.0 (result i32) + local.get $2 + local.set $5 + local.get $4 + local.set $6 + local.get $5 + local.get $6 + call $~lib/runtime/doReallocate + end + local.set $6 + local.get $6 + local.get $2 + i32.ne + if + local.get $0 + local.get $6 + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + local.get $0 + local.get $6 + local.get $4 + i32.add + i32.store offset=8 + end + end + ) + (func $~lib/array/Array#__set (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#resize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 0 + i32.shl + i32.add + local.get $2 + i32.store8 + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + ) + (func $~lib/array/Array#constructor (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + call $~lib/runtime/ALLOCATE + local.set $2 + local.get $2 + i32.const 4 + call $~lib/runtime/doRegister + end + local.get $1 + i32.const 2 + call $~lib/runtime/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/array/Array#resize (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load + local.set $2 + local.get $2 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.const 2 + i32.shr_u + local.set $3 + local.get $1 + local.get $3 + i32.gt_u + if + local.get $1 + i32.const 268435454 + i32.gt_u + if + i32.const 0 + i32.const 272 + i32.const 37 + i32.const 41 + call $~lib/env/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.set $4 + block $~lib/runtime/REALLOCATE|inlined.1 (result i32) + local.get $2 + local.set $5 + local.get $4 + local.set $6 + local.get $5 + local.get $6 + call $~lib/runtime/doReallocate + end + local.set $6 + local.get $6 + local.get $2 + i32.ne + if + local.get $0 + local.get $6 + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + local.get $0 + local.get $6 + local.get $4 + i32.add + i32.store offset=8 + end + end + ) + (func $~lib/array/Array#__set (; 22 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#resize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + ) + (func $std/array-literal/Ref#constructor (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.eqz + if + block $~lib/runtime/REGISTER|inlined.0 (result i32) + i32.const 0 + call $~lib/runtime/ALLOCATE + local.set $1 + local.get $1 + i32.const 6 + call $~lib/runtime/doRegister + end + local.set $0 + end + local.get $0 + ) + (func $~lib/array/Array#constructor (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + call $~lib/runtime/ALLOCATE + local.set $2 + local.get $2 + i32.const 7 + call $~lib/runtime/doRegister + end + local.get $1 + i32.const 2 + call $~lib/runtime/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/array/Array#resize (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load + local.set $2 + local.get $2 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.const 2 + i32.shr_u + local.set $3 + local.get $1 + local.get $3 + i32.gt_u + if + local.get $1 + i32.const 268435454 + i32.gt_u + if + i32.const 0 + i32.const 272 + i32.const 37 + i32.const 41 + call $~lib/env/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.set $4 + block $~lib/runtime/REALLOCATE|inlined.2 (result i32) + local.get $2 + local.set $5 + local.get $4 + local.set $6 + local.get $5 + local.get $6 + call $~lib/runtime/doReallocate + end + local.set $6 + local.get $6 + local.get $2 + i32.ne + if + local.get $0 + local.get $6 + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + local.get $0 + local.get $6 + local.get $4 + i32.add + i32.store offset=8 + end + end + ) + (func $~lib/array/Array#__set (; 26 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#resize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + ) + (func $~lib/array/Array#get:length (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $std/array-literal/RefWithCtor#constructor (; 28 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.eqz + if + block $~lib/runtime/REGISTER|inlined.0 (result i32) + i32.const 0 + call $~lib/runtime/ALLOCATE + local.set $1 + local.get $1 + i32.const 8 + call $~lib/runtime/doRegister + end + local.set $0 + end + local.get $0 + ) + (func $~lib/array/Array#constructor (; 29 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + if (result i32) + local.get $0 + else + i32.const 16 + call $~lib/runtime/ALLOCATE + local.set $2 + local.get $2 + i32.const 9 + call $~lib/runtime/doRegister + end + local.get $1 + i32.const 2 + call $~lib/runtime/ArrayBufferView#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + local.get $1 + i32.store offset=12 + local.get $0 + ) + (func $~lib/array/Array#resize (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + local.get $0 + i32.load + local.set $2 + local.get $2 + call $~lib/arraybuffer/ArrayBuffer#get:byteLength + i32.const 2 + i32.shr_u + local.set $3 + local.get $1 + local.get $3 + i32.gt_u + if + local.get $1 + i32.const 268435454 + i32.gt_u + if + i32.const 0 + i32.const 272 + i32.const 37 + i32.const 41 + call $~lib/env/abort + unreachable + end + local.get $1 + i32.const 2 + i32.shl + local.set $4 + block $~lib/runtime/REALLOCATE|inlined.3 (result i32) + local.get $2 + local.set $5 + local.get $4 + local.set $6 + local.get $5 + local.get $6 + call $~lib/runtime/doReallocate + end + local.set $6 + local.get $6 + local.get $2 + i32.ne + if + local.get $0 + local.get $6 + i32.store + local.get $0 + local.get $6 + i32.store offset=4 + local.get $0 + local.get $6 + local.get $4 + i32.add + i32.store offset=8 + end + end + ) + (func $~lib/array/Array#__set (; 31 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#resize + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 2 + i32.shl + i32.add + local.get $2 + i32.store + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_s + if + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=12 + end + ) + (func $~lib/array/Array#get:length (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + i32.load offset=12 + ) + (func $start:std/array-literal (; 33 ;) (type $FUNCSIG$v) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $std/array-literal/staticArrayI8 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 4 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/staticArrayI8 + i32.load offset=4 + i32.load8_s + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 5 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/staticArrayI8 + i32.load offset=4 + i32.load8_s offset=1 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 6 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/staticArrayI8 + i32.load offset=4 + i32.load8_s offset=2 + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 7 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/staticArrayI32 + call $~lib/array/Array#get:length + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 10 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/staticArrayI32 + i32.load offset=4 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 11 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/staticArrayI32 + i32.load offset=4 + i32.load offset=4 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 12 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/staticArrayI32 + i32.load offset=4 + i32.load offset=8 + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 13 + i32.const 0 + call $~lib/env/abort + unreachable + end + global.get $std/array-literal/emptyArrayI32 + call $~lib/array/Array#get:length + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 56 + i32.const 16 + i32.const 0 + call $~lib/env/abort + unreachable + end global.get $~lib/memory/HEAP_BASE i32.const 7 i32.add @@ -42,976 +2736,16 @@ global.set $~lib/allocator/arena/startOffset global.get $~lib/allocator/arena/startOffset global.set $~lib/allocator/arena/offset - ) - (func $~lib/array/Array#__get (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 0 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 0 - i32.shl - i32.add - local.get $5 - i32.add - i32.load8_s offset=8 - else - unreachable - end - ) - (func $~lib/array/Array#__get (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.load - i32.const 2 - i32.shr_u - i32.lt_u - if (result i32) - local.get $2 - local.set $3 - local.get $1 - local.set $4 - i32.const 0 - local.set $5 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $5 - i32.add - i32.load offset=8 - else - unreachable - end - ) - (func $~lib/internal/arraybuffer/computeSize (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - i32.const 1 - i32.const 32 - local.get $0 - i32.const 8 - i32.add - i32.const 1 - i32.sub - i32.clz - i32.sub - i32.shl - ) - (func $~lib/allocator/arena/__memory_allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.const 1073741824 - i32.gt_u - if - unreachable - end - global.get $~lib/allocator/arena/offset - local.set $1 - local.get $1 - local.get $0 - local.tee $2 - i32.const 1 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select - i32.add - i32.const 7 - i32.add - i32.const 7 - i32.const -1 - i32.xor - i32.and - local.set $4 - current_memory - local.set $5 - local.get $4 - local.get $5 - i32.const 16 - i32.shl - i32.gt_u - if - local.get $4 - local.get $1 - i32.sub - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $5 - local.tee $3 - local.get $2 - local.tee $6 - local.get $3 - local.get $6 - i32.gt_s - select - local.set $3 - local.get $3 - grow_memory - i32.const 0 - i32.lt_s - if - local.get $2 - grow_memory - i32.const 0 - i32.lt_s - if - unreachable - end - end - end - local.get $4 - global.set $~lib/allocator/arena/offset - local.get $1 - ) - (func $~lib/internal/arraybuffer/allocateUnsafe (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741816 - i32.le_u - i32.eqz - if - i32.const 0 - i32.const 168 - i32.const 26 - i32.const 2 - call $~lib/env/abort - unreachable - end - block $~lib/memory/memory.allocate|inlined.0 (result i32) - local.get $0 - call $~lib/internal/arraybuffer/computeSize - local.set $2 - local.get $2 - call $~lib/allocator/arena/__memory_allocate - br $~lib/memory/memory.allocate|inlined.0 - end - local.set $1 - local.get $1 - local.get $0 - i32.store - local.get $1 - ) - (func $~lib/memory/memory.allocate (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - call $~lib/allocator/arena/__memory_allocate - return - ) - (func $~lib/internal/memory/memset (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i64) - local.get $2 - i32.eqz - if - return - end - local.get $0 - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 1 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 2 - i32.le_u - if - return - end - local.get $0 - i32.const 1 - i32.add - local.get $1 - i32.store8 - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 2 - i32.sub - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 3 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 6 - i32.le_u - if - return - end - local.get $0 - i32.const 3 - i32.add - local.get $1 - i32.store8 - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $1 - i32.store8 - local.get $2 - i32.const 8 - i32.le_u - if - return - end - i32.const 0 - local.get $0 - i32.sub - i32.const 3 - i32.and - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $2 - i32.const -4 - i32.and - local.set $2 - i32.const -1 - i32.const 255 - i32.div_u - local.get $1 - i32.const 255 - i32.and - i32.mul - local.set $4 - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 4 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 8 - i32.le_u - if - return - end - local.get $0 - i32.const 4 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 8 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 12 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 8 - i32.sub - local.get $4 - i32.store - local.get $2 - i32.const 24 - i32.le_u - if - return - end - local.get $0 - i32.const 12 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 16 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 20 - i32.add - local.get $4 - i32.store - local.get $0 - i32.const 24 - i32.add - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 28 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 24 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 20 - i32.sub - local.get $4 - i32.store - local.get $0 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.get $4 - i32.store - i32.const 24 - local.get $0 - i32.const 4 - i32.and - i32.add - local.set $3 - local.get $0 - local.get $3 - i32.add - local.set $0 - local.get $2 - local.get $3 - i32.sub - local.set $2 - local.get $4 - i64.extend_i32_u - local.get $4 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $5 - block $break|0 - loop $continue|0 - local.get $2 - i32.const 32 - i32.ge_u - if - block - local.get $0 - local.get $5 - i64.store - local.get $0 - i32.const 8 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 16 - i32.add - local.get $5 - i64.store - local.get $0 - i32.const 24 - i32.add - local.get $5 - i64.store - local.get $2 - i32.const 32 - i32.sub - local.set $2 - local.get $0 - i32.const 32 - i32.add - local.set $0 - end - br $continue|0 - end - end - end - ) - (func $~lib/array/Array#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 1073741816 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 0 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.0 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/array/Array#__unchecked_set (; 10 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 - local.get $4 - i32.const 0 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store8 offset=8 - ) - (func $~lib/array/Array#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.1 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/array/Array#__unchecked_set (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 - ) - (func $std/array-literal/Ref#constructor (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 0 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - ) - (func $~lib/array/Array#constructor (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.2 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/array/Array#__unchecked_set (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 - ) - (func $std/array-literal/RefWithCtor#constructor (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 0 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - ) - (func $~lib/array/Array#constructor (; 17 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - i32.const 268435454 - i32.gt_u - if - i32.const 0 - i32.const 136 - i32.const 45 - i32.const 39 - call $~lib/env/abort - unreachable - end - local.get $1 - i32.const 2 - i32.shl - local.set $2 - local.get $2 - call $~lib/internal/arraybuffer/allocateUnsafe - local.set $3 - block (result i32) - local.get $0 - i32.eqz - if - i32.const 8 - call $~lib/memory/memory.allocate - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - end - local.get $3 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - block $~lib/memory/memory.fill|inlined.3 - local.get $3 - i32.const 8 - i32.add - local.set $4 - i32.const 0 - local.set $5 - local.get $2 - local.set $6 - local.get $4 - local.get $5 - local.get $6 - call $~lib/internal/memory/memset - end - local.get $0 - ) - (func $~lib/array/Array#__unchecked_set (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.load - local.set $3 - local.get $1 - local.set $4 - local.get $2 - local.set $5 - i32.const 0 - local.set $6 - local.get $3 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.add - local.get $5 - i32.store offset=8 - ) - (func $start:std/array-literal (; 19 ;) (type $FUNCSIG$v) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - call $start:~lib/allocator/arena - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/staticArrayI8 - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 4 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array-literal/staticArrayI8 - i32.const 0 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 5 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array-literal/staticArrayI8 - i32.const 1 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 6 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array-literal/staticArrayI8 - i32.const 2 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 7 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/staticArrayI32 - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 10 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array-literal/staticArrayI32 - i32.const 0 - call $~lib/array/Array#__get - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 11 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array-literal/staticArrayI32 - i32.const 1 - call $~lib/array/Array#__get - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 12 - i32.const 0 - call $~lib/env/abort - unreachable - end - global.get $std/array-literal/staticArrayI32 - i32.const 2 - call $~lib/array/Array#__get - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 13 - i32.const 0 - call $~lib/env/abort - unreachable - end - block $~lib/array/Array#get:length|inlined.1 (result i32) - global.get $std/array-literal/emptyArrayI32 - local.set $0 - local.get $0 - i32.load offset=4 - end - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 16 - i32.const 0 - call $~lib/env/abort - unreachable - end block (result i32) i32.const 0 i32.const 3 call $~lib/array/Array#constructor - local.set $1 - local.get $1 + local.set $0 + local.get $0 i32.const 0 global.get $std/array-literal/i - call $~lib/array/Array#__unchecked_set - local.get $1 + call $~lib/array/Array#__set + local.get $0 i32.const 1 block (result i32) global.get $std/array-literal/i @@ -1020,8 +2754,8 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set - local.get $1 + call $~lib/array/Array#__set + local.get $0 i32.const 2 block (result i32) global.get $std/array-literal/i @@ -1030,76 +2764,60 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set - local.get $1 + call $~lib/array/Array#__set + local.get $0 end global.set $std/array-literal/dynamicArrayI8 - block $~lib/array/Array#get:length|inlined.1 (result i32) - global.get $std/array-literal/dynamicArrayI8 - local.set $1 - local.get $1 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayI8 + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 21 i32.const 0 call $~lib/env/abort unreachable end global.get $std/array-literal/dynamicArrayI8 - i32.const 0 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s + i32.load offset=4 + i32.load8_s i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 22 i32.const 0 call $~lib/env/abort unreachable end global.get $std/array-literal/dynamicArrayI8 - i32.const 1 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s + i32.load offset=4 + i32.load8_s offset=1 i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 23 i32.const 0 call $~lib/env/abort unreachable end global.get $std/array-literal/dynamicArrayI8 - i32.const 2 - call $~lib/array/Array#__get - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s + i32.load offset=4 + i32.load8_s offset=2 i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 24 i32.const 0 call $~lib/env/abort @@ -1111,12 +2829,12 @@ i32.const 0 i32.const 3 call $~lib/array/Array#constructor - local.set $2 - local.get $2 + local.set $1 + local.get $1 i32.const 0 global.get $std/array-literal/i - call $~lib/array/Array#__unchecked_set - local.get $2 + call $~lib/array/Array#__set + local.get $1 i32.const 1 block (result i32) global.get $std/array-literal/i @@ -1125,8 +2843,8 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set - local.get $2 + call $~lib/array/Array#__set + local.get $1 i32.const 2 block (result i32) global.get $std/array-literal/i @@ -1135,64 +2853,60 @@ global.set $std/array-literal/i global.get $std/array-literal/i end - call $~lib/array/Array#__unchecked_set - local.get $2 + call $~lib/array/Array#__set + local.get $1 end global.set $std/array-literal/dynamicArrayI32 - block $~lib/array/Array#get:length|inlined.2 (result i32) - global.get $std/array-literal/dynamicArrayI32 - local.set $2 - local.get $2 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayI32 + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 29 i32.const 0 call $~lib/env/abort unreachable end global.get $std/array-literal/dynamicArrayI32 - i32.const 0 - call $~lib/array/Array#__get + i32.load offset=4 + i32.load i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 30 i32.const 0 call $~lib/env/abort unreachable end global.get $std/array-literal/dynamicArrayI32 - i32.const 1 - call $~lib/array/Array#__get + i32.load offset=4 + i32.load offset=4 i32.const 1 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 31 i32.const 0 call $~lib/env/abort unreachable end global.get $std/array-literal/dynamicArrayI32 - i32.const 2 - call $~lib/array/Array#__get + i32.load offset=4 + i32.load offset=8 i32.const 2 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 32 i32.const 0 call $~lib/env/abort @@ -1202,37 +2916,33 @@ i32.const 0 i32.const 3 call $~lib/array/Array#constructor - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.const 0 i32.const 0 call $std/array-literal/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 + call $~lib/array/Array#__set + local.get $2 i32.const 1 i32.const 0 call $std/array-literal/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 + call $~lib/array/Array#__set + local.get $2 i32.const 2 i32.const 0 call $std/array-literal/Ref#constructor - call $~lib/array/Array#__unchecked_set - local.get $3 + call $~lib/array/Array#__set + local.get $2 end global.set $std/array-literal/dynamicArrayRef - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/dynamicArrayRef - local.set $3 - local.get $3 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayRef + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 36 i32.const 0 call $~lib/env/abort @@ -1242,46 +2952,42 @@ i32.const 0 i32.const 3 call $~lib/array/Array#constructor - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 0 i32.const 0 call $std/array-literal/RefWithCtor#constructor - call $~lib/array/Array#__unchecked_set - local.get $4 + call $~lib/array/Array#__set + local.get $3 i32.const 1 i32.const 0 call $std/array-literal/RefWithCtor#constructor - call $~lib/array/Array#__unchecked_set - local.get $4 + call $~lib/array/Array#__set + local.get $3 i32.const 2 i32.const 0 call $std/array-literal/RefWithCtor#constructor - call $~lib/array/Array#__unchecked_set - local.get $4 + call $~lib/array/Array#__set + local.get $3 end global.set $std/array-literal/dynamicArrayRefWithCtor - block $~lib/array/Array#get:length|inlined.0 (result i32) - global.get $std/array-literal/dynamicArrayRefWithCtor - local.set $4 - local.get $4 - i32.load offset=4 - end + global.get $std/array-literal/dynamicArrayRefWithCtor + call $~lib/array/Array#get:length i32.const 3 i32.eq i32.eqz if i32.const 0 - i32.const 32 + i32.const 56 i32.const 40 i32.const 0 call $~lib/env/abort unreachable end ) - (func $start (; 20 ;) (type $FUNCSIG$v) + (func $start (; 34 ;) (type $FUNCSIG$v) call $start:std/array-literal ) - (func $null (; 21 ;) (type $FUNCSIG$v) + (func $null (; 35 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index b627392d..3cefcded 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -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#clear (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#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#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $~lib/map/Map#find (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#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#has (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#rehash (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#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#get (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#delete (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 14 ;) (type $FUNCSIG$v) + (func $std/map/test (; 15 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -1132,18 +1132,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 15 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $~lib/map/Map#has (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#rehash (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 18 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#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#get (; 19 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#delete (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 21 ;) (type $FUNCSIG$v) + (func $std/map/test (; 22 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -1794,18 +1789,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 22 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $~lib/map/Map#find (; 23 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#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#has (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#rehash (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 26 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#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#get (; 27 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#delete (; 28 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 29 ;) (type $FUNCSIG$v) + (func $std/map/test (; 30 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -2568,18 +2558,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 30 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $~lib/map/Map#has (; 31 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#rehash (; 32 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 33 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#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#get (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#delete (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 36 ;) (type $FUNCSIG$v) + (func $std/map/test (; 37 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -3275,18 +3260,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 37 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#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#find (; 39 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#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#has (; 40 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#rehash (; 41 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 42 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#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#get (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#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#delete (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 45 ;) (type $FUNCSIG$v) + (func $std/map/test (; 46 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -3972,18 +3952,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 46 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $std/map/test (; 47 ;) (type $FUNCSIG$v) + (func $std/map/test (; 48 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/map/Map#constructor @@ -4321,7 +4296,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 48 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#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#constructor (; 49 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#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#find (; 51 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#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#has (; 52 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#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#rehash (; 53 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 54 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#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#get (; 55 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#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#delete (; 56 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 57 ;) (type $FUNCSIG$v) + (func $std/map/test (; 58 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/map/Map#constructor @@ -5083,18 +5053,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 58 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $std/map/test (; 59 ;) (type $FUNCSIG$v) + (func $std/map/test (; 60 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/map/Map#constructor @@ -5439,18 +5404,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 60 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $~lib/map/Map#find (; 61 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/map/Map#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#has (; 62 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#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#rehash (; 63 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 64 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/map/Map#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#get (; 65 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#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#delete (; 66 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 67 ;) (type $FUNCSIG$v) + (func $std/map/test (; 68 ;) (type $FUNCSIG$v) (local $0 f32) (local $1 i32) call $~lib/map/Map#constructor @@ -6118,18 +6078,13 @@ unreachable end ) - (func $~lib/map/Map#constructor (; 68 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/map/Map#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#clear local.get $0 ) - (func $~lib/map/Map#find (; 69 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/map/Map#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#has (; 70 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#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#rehash (; 71 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#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#set (; 72 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/map/Map#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#get (; 73 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#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#delete (; 74 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/map/Map#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#rehash end ) - (func $std/map/test (; 75 ;) (type $FUNCSIG$v) + (func $std/map/test (; 76 ;) (type $FUNCSIG$v) (local $0 f64) (local $1 i32) call $~lib/map/Map#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 call $std/map/test ) - (func $null (; 77 ;) (type $FUNCSIG$v) + (func $null (; 78 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 596e1c82..8783ad08 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -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))) @@ -19,9 +19,9 @@ (type $FUNCSIG$vidi (func (param i32 f64 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\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 96) "\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s\00") + (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\00") + (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\00") + (data (i32.const 96) "\02\00\00\00\14\00\00\00s\00t\00d\00/\00m\00a\00p\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/runtime/GC_IMPLEMENTED i32 (i32.const 0)) @@ -29,12 +29,13 @@ (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741816)) (global $~lib/memory/HEAP_BASE i32 (i32.const 124)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/ADJUST (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/adjustToBlock (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -131,10 +132,10 @@ end return ) - (func $~lib/runtime/ALLOCATE (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/doAllocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUST + call $~lib/runtime/adjustToBlock call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -147,7 +148,11 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/ASSERT_UNREGISTERED (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/ALLOCATE (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/runtime/doAllocate + ) + (func $~lib/runtime/assertUnregistered (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 global.get $~lib/memory/HEAP_BASE i32.gt_u @@ -155,7 +160,7 @@ if i32.const 0 i32.const 16 - i32.const 172 + i32.const 188 i32.const 2 call $~lib/env/abort unreachable @@ -170,13 +175,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 (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/runtime/doRegister (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/runtime/assertUnregistered + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + local.get $1 + i32.store + local.get $0 + ) + (func $~lib/memory/memory.fill (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -441,7 +456,7 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (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 @@ -455,27 +470,26 @@ call $~lib/env/abort unreachable end - local.get $1 - call $~lib/runtime/ALLOCATE - local.set $2 - local.get $2 + block $~lib/runtime/ALLOCATE|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/runtime/doAllocate + end + local.set $3 + local.get $3 i32.const 0 local.get $1 call $~lib/memory/memory.fill block $~lib/runtime/REGISTER|inlined.0 (result i32) + local.get $3 + local.set $2 local.get $2 - local.set $3 - local.get $3 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $3 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 3 - i32.store - local.get $3 + call $~lib/runtime/doRegister end ) - (func $~lib/map/Map#clear (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -501,7 +515,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -512,13 +526,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub - i32.const 2 - i32.store - local.get $1 + i32.const 1 + call $~lib/runtime/doRegister end local.set $0 end @@ -545,14 +554,14 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash8 (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash8 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const -2128831035 local.get $0 i32.xor i32.const 16777619 i32.mul ) - (func $~lib/map/Map#find (; 10 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 12 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -607,7 +616,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -626,7 +635,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -760,7 +769,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 13 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -868,7 +877,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -894,11 +903,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -975,7 +984,7 @@ end i32.const 1 ) - (func $std/map/test (; 17 ;) (type $FUNCSIG$v) + (func $std/map/test (; 19 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1359,7 +1368,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -1385,7 +1394,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -1396,13 +1405,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 4 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -1429,7 +1433,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 20 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 22 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -1482,7 +1486,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 21 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -1499,7 +1503,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 22 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 24 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1633,7 +1637,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 23 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 25 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -1739,7 +1743,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -1763,11 +1767,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1842,7 +1846,7 @@ end i32.const 1 ) - (func $std/map/test (; 27 ;) (type $FUNCSIG$v) + (func $std/map/test (; 29 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -2212,7 +2216,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -2238,7 +2242,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -2249,13 +2253,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 5 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -2282,7 +2281,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash16 (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash16 (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -2304,7 +2303,7 @@ local.set $1 local.get $1 ) - (func $~lib/map/Map#find (; 31 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 33 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -2359,7 +2358,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 32 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 34 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -2378,7 +2377,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 33 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2512,7 +2511,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 34 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 36 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -2620,7 +2619,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -2646,11 +2645,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2727,7 +2726,7 @@ end i32.const 1 ) - (func $std/map/test (; 38 ;) (type $FUNCSIG$v) + (func $std/map/test (; 40 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3111,7 +3110,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -3137,7 +3136,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -3148,13 +3147,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 6 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -3181,7 +3175,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 41 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 43 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -3234,7 +3228,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 42 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 44 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -3251,7 +3245,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 43 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3385,7 +3379,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 44 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 46 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -3491,7 +3485,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -3515,11 +3509,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 48 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3594,7 +3588,7 @@ end i32.const 1 ) - (func $std/map/test (; 48 ;) (type $FUNCSIG$v) + (func $std/map/test (; 50 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3964,7 +3958,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 49 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 51 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -3990,7 +3984,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -4001,13 +3995,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 7 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -4034,7 +4023,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 53 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -4076,7 +4065,7 @@ local.set $1 local.get $1 ) - (func $~lib/map/Map#find (; 52 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 54 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -4127,7 +4116,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 55 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -4142,7 +4131,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 54 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 56 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4276,7 +4265,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 55 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 57 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -4380,7 +4369,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -4402,11 +4391,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 57 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 59 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4479,7 +4468,7 @@ end i32.const 1 ) - (func $std/map/test (; 59 ;) (type $FUNCSIG$v) + (func $std/map/test (; 61 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -4835,7 +4824,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 60 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 62 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -4861,7 +4850,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 63 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -4872,13 +4861,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 8 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -4905,7 +4889,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 62 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 64 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -4956,7 +4940,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 63 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#has (; 65 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) local.get $0 local.get $1 @@ -4971,7 +4955,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 64 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 66 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5105,7 +5089,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 65 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/map/Map#set (; 67 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -5209,7 +5193,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#get (; 68 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) local.get $0 @@ -5231,11 +5215,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 67 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 68 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/map/Map#delete (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5308,7 +5292,7 @@ end i32.const 1 ) - (func $std/map/test (; 69 ;) (type $FUNCSIG$v) + (func $std/map/test (; 71 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -5664,7 +5648,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 70 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 72 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -5690,7 +5674,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 71 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 73 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -5701,13 +5685,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 9 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -5734,7 +5713,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 72 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 74 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5822,7 +5801,7 @@ local.set $3 local.get $3 ) - (func $~lib/map/Map#find (; 73 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 75 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -5873,7 +5852,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 74 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 76 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 @@ -5888,7 +5867,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 75 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 77 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6023,7 +6002,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 76 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 78 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) @@ -6128,7 +6107,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 77 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 79 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) local.get $0 @@ -6150,11 +6129,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 78 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 79 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#delete (; 81 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -6228,7 +6207,7 @@ end i32.const 1 ) - (func $std/map/test (; 80 ;) (type $FUNCSIG$v) + (func $std/map/test (; 82 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -6591,7 +6570,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 81 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 83 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -6617,7 +6596,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 82 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 84 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -6628,13 +6607,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 10 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -6661,7 +6635,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 83 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 85 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -6712,7 +6686,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 84 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#has (; 86 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) local.get $0 local.get $1 @@ -6727,7 +6701,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 85 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 87 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6862,7 +6836,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 86 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) + (func $~lib/map/Map#set (; 88 ;) (type $FUNCSIG$viji) (param $0 i32) (param $1 i64) (param $2 i32) (local $3 i64) (local $4 i32) (local $5 i32) @@ -6967,7 +6941,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 87 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#get (; 89 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) local.get $0 @@ -6989,11 +6963,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 88 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 90 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 89 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/map/Map#delete (; 91 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -7067,7 +7041,7 @@ end i32.const 1 ) - (func $std/map/test (; 90 ;) (type $FUNCSIG$v) + (func $std/map/test (; 92 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -7430,7 +7404,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 91 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 93 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -7456,7 +7430,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 92 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 94 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -7467,13 +7441,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 11 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -7500,7 +7469,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 93 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 95 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -7551,7 +7520,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 94 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#has (; 96 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) local.get $0 local.get $1 @@ -7567,7 +7536,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 95 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 97 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7703,7 +7672,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 96 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) + (func $~lib/map/Map#set (; 98 ;) (type $FUNCSIG$vifi) (param $0 i32) (param $1 f32) (param $2 i32) (local $3 f32) (local $4 i32) (local $5 i32) @@ -7809,7 +7778,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 97 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#get (; 99 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) local.get $0 @@ -7832,11 +7801,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 98 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 100 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 99 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/map/Map#delete (; 101 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -7911,7 +7880,7 @@ end i32.const 1 ) - (func $std/map/test (; 100 ;) (type $FUNCSIG$v) + (func $std/map/test (; 102 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f32) i32.const 0 @@ -8274,7 +8243,7 @@ unreachable end ) - (func $~lib/map/Map#clear (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/map/Map#clear (; 103 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -8300,7 +8269,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/map/Map#constructor (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#constructor (; 104 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -8311,13 +8280,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 12 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -8344,7 +8308,7 @@ call $~lib/map/Map#clear local.get $0 ) - (func $~lib/map/Map#find (; 103 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/map/Map#find (; 105 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -8395,7 +8359,7 @@ end i32.const 0 ) - (func $~lib/map/Map#has (; 104 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#has (; 106 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) local.get $0 local.get $1 @@ -8411,7 +8375,7 @@ i32.const 0 i32.ne ) - (func $~lib/map/Map#rehash (; 105 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/map/Map#rehash (; 107 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -8547,7 +8511,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/map/Map#set (; 106 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) + (func $~lib/map/Map#set (; 108 ;) (type $FUNCSIG$vidi) (param $0 i32) (param $1 f64) (param $2 i32) (local $3 f64) (local $4 i32) (local $5 i32) @@ -8653,7 +8617,7 @@ i32.store end ) - (func $~lib/map/Map#get (; 107 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#get (; 109 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) local.get $0 @@ -8676,11 +8640,11 @@ unreachable end ) - (func $~lib/map/Map#get:size (; 108 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/map/Map#get:size (; 110 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/map/Map#delete (; 109 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/map/Map#delete (; 111 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) (local $4 i32) @@ -8755,7 +8719,7 @@ end i32.const 1 ) - (func $std/map/test (; 110 ;) (type $FUNCSIG$v) + (func $std/map/test (; 112 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f64) i32.const 0 @@ -9118,7 +9082,7 @@ unreachable end ) - (func $start:std/map (; 111 ;) (type $FUNCSIG$v) + (func $start:std/map (; 113 ;) (type $FUNCSIG$v) global.get $~lib/memory/HEAP_BASE i32.const 7 i32.add @@ -9140,9 +9104,9 @@ call $std/map/test call $std/map/test ) - (func $start (; 112 ;) (type $FUNCSIG$v) + (func $start (; 114 ;) (type $FUNCSIG$v) call $start:std/map ) - (func $null (; 113 ;) (type $FUNCSIG$v) + (func $null (; 115 ;) (type $FUNCSIG$v) ) ) diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index c384219a..b1834c3e 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -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#clear (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#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#constructor (; 7 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $~lib/set/Set#find (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#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#has (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#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#rehash (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 11 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#delete (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 13 ;) (type $FUNCSIG$v) + (func $std/set/test (; 14 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -999,18 +999,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 14 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $~lib/set/Set#has (; 15 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#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#rehash (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 17 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#delete (; 18 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 19 ;) (type $FUNCSIG$v) + (func $std/set/test (; 20 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -1546,18 +1541,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 20 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $~lib/set/Set#find (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#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#has (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#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#rehash (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 24 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#delete (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 26 ;) (type $FUNCSIG$v) + (func $std/set/test (; 27 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -2180,18 +2170,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 27 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $~lib/set/Set#has (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#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#rehash (; 29 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 30 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#delete (; 31 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 32 ;) (type $FUNCSIG$v) + (func $std/set/test (; 33 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -2763,18 +2748,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 33 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#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#find (; 35 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#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#has (; 36 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#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#rehash (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 38 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#delete (; 39 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 40 ;) (type $FUNCSIG$v) + (func $std/set/test (; 41 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -3366,18 +3346,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 41 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $std/set/test (; 42 ;) (type $FUNCSIG$v) + (func $std/set/test (; 43 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) call $~lib/set/Set#constructor @@ -3644,7 +3619,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 43 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#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#constructor (; 44 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#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#find (; 46 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#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#has (; 47 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#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#rehash (; 48 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 49 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#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#delete (; 50 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 51 ;) (type $FUNCSIG$v) + (func $std/set/test (; 52 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/set/Set#constructor @@ -4305,18 +4275,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 52 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $std/set/test (; 53 ;) (type $FUNCSIG$v) + (func $std/set/test (; 54 ;) (type $FUNCSIG$v) (local $0 i64) (local $1 i32) call $~lib/set/Set#constructor @@ -4583,18 +4548,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 54 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 55 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + (func $~lib/util/hash/HASH (; 56 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) local.get $0 i32.reinterpret_f32 call $~lib/util/hash/hash32 ) - (func $~lib/set/Set#find (; 56 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/set/Set#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#has (; 57 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#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#rehash (; 58 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 59 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#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#delete (; 60 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 61 ;) (type $FUNCSIG$v) + (func $std/set/test (; 62 ;) (type $FUNCSIG$v) (local $0 f32) (local $1 i32) call $~lib/set/Set#constructor @@ -5161,18 +5121,13 @@ unreachable end ) - (func $~lib/set/Set#constructor (; 62 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/set/Set#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#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 63 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/hash/HASH (; 64 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 i64.reinterpret_f64 call $~lib/util/hash/hash64 ) - (func $~lib/set/Set#find (; 64 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/set/Set#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#has (; 65 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#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#rehash (; 66 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#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#add (; 67 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#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#delete (; 68 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#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#rehash end ) - (func $std/set/test (; 69 ;) (type $FUNCSIG$v) + (func $std/set/test (; 70 ;) (type $FUNCSIG$v) (local $0 f64) (local $1 i32) call $~lib/set/Set#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 call $std/set/test ) - (func $null (; 71 ;) (type $FUNCSIG$v) + (func $null (; 72 ;) (type $FUNCSIG$v) nop ) ) diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index fdca5899..2d28d36c 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -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))) @@ -21,9 +21,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\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 96) "\01\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s\00") + (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\00") + (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\00") + (data (i32.const 96) "\02\00\00\00\14\00\00\00s\00t\00d\00/\00s\00e\00t\00.\00t\00s\00") (table $0 1 funcref) (elem (i32.const 0) $null) (global $~lib/runtime/GC_IMPLEMENTED i32 (i32.const 0)) @@ -31,12 +31,13 @@ (global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_NO_ASSERT i32 (i32.const 0)) (global $~lib/runtime/MAX_BYTELENGTH i32 (i32.const 1073741816)) (global $~lib/memory/HEAP_BASE i32 (i32.const 124)) (export "memory" (memory $0)) (export "table" (table $0)) (start $start) - (func $~lib/runtime/ADJUST (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/adjustToBlock (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const 1 i32.const 32 local.get $0 @@ -133,10 +134,10 @@ end return ) - (func $~lib/runtime/ALLOCATE (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/runtime/doAllocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) local.get $0 - call $~lib/runtime/ADJUST + call $~lib/runtime/adjustToBlock call $~lib/memory/memory.allocate local.set $1 local.get $1 @@ -149,7 +150,11 @@ global.get $~lib/runtime/HEADER_SIZE i32.add ) - (func $~lib/runtime/ASSERT_UNREGISTERED (; 4 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/runtime/ALLOCATE (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + local.get $0 + call $~lib/runtime/doAllocate + ) + (func $~lib/runtime/assertUnregistered (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 global.get $~lib/memory/HEAP_BASE i32.gt_u @@ -157,7 +162,7 @@ if i32.const 0 i32.const 16 - i32.const 172 + i32.const 188 i32.const 2 call $~lib/env/abort unreachable @@ -172,13 +177,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 (; 5 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/runtime/doRegister (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + local.get $0 + call $~lib/runtime/assertUnregistered + local.get $0 + global.get $~lib/runtime/HEADER_SIZE + i32.sub + local.get $1 + i32.store + local.get $0 + ) + (func $~lib/memory/memory.fill (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) @@ -443,7 +458,7 @@ end end ) - (func $~lib/arraybuffer/ArrayBuffer#constructor (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (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 @@ -457,27 +472,26 @@ call $~lib/env/abort unreachable end - local.get $1 - call $~lib/runtime/ALLOCATE - local.set $2 - local.get $2 + block $~lib/runtime/ALLOCATE|inlined.0 (result i32) + local.get $1 + local.set $2 + local.get $2 + call $~lib/runtime/doAllocate + end + local.set $3 + local.get $3 i32.const 0 local.get $1 call $~lib/memory/memory.fill block $~lib/runtime/REGISTER|inlined.0 (result i32) + local.get $3 + local.set $2 local.get $2 - local.set $3 - local.get $3 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $3 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 3 - i32.store - local.get $3 + call $~lib/runtime/doRegister end ) - (func $~lib/set/Set#clear (; 7 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -503,7 +517,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -514,13 +528,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub - i32.const 2 - i32.store - local.get $1 + i32.const 1 + call $~lib/runtime/doRegister end local.set $0 end @@ -547,14 +556,14 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash8 (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash8 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) i32.const -2128831035 local.get $0 i32.xor i32.const 16777619 i32.mul ) - (func $~lib/util/hash/HASH (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 24 i32.shl @@ -563,7 +572,7 @@ call $~lib/util/hash/hash8 return ) - (func $~lib/set/Set#find (; 11 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 13 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -618,7 +627,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 14 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -627,7 +636,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 15 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -757,7 +766,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 16 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -850,11 +859,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 16 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 18 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -931,7 +940,7 @@ end i32.const 1 ) - (func $std/set/test (; 17 ;) (type $FUNCSIG$v) + (func $std/set/test (; 19 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1214,7 +1223,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 18 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 20 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -1240,7 +1249,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -1251,13 +1260,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 4 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -1284,14 +1288,14 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (; 22 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 255 i32.and call $~lib/util/hash/hash8 return ) - (func $~lib/set/Set#find (; 21 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 23 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -1344,7 +1348,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 24 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -1353,7 +1357,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 23 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 25 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1483,7 +1487,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 24 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 26 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1576,11 +1580,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 25 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 27 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 28 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1655,7 +1659,7 @@ end i32.const 1 ) - (func $std/set/test (; 27 ;) (type $FUNCSIG$v) + (func $std/set/test (; 29 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -1938,7 +1942,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 28 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 30 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -1964,7 +1968,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 29 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -1975,13 +1979,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 5 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -2008,7 +2007,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash16 (; 30 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash16 (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -2030,7 +2029,7 @@ local.set $1 local.get $1 ) - (func $~lib/util/hash/HASH (; 31 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (; 33 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 16 i32.shl @@ -2039,7 +2038,7 @@ call $~lib/util/hash/hash16 return ) - (func $~lib/set/Set#find (; 32 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 34 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -2094,7 +2093,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 33 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 35 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -2103,7 +2102,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 34 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 36 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2233,7 +2232,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 35 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 37 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2326,11 +2325,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 36 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 38 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 39 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2407,7 +2406,7 @@ end i32.const 1 ) - (func $std/set/test (; 38 ;) (type $FUNCSIG$v) + (func $std/set/test (; 40 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -2690,7 +2689,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 39 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 41 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -2716,7 +2715,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 40 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 42 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -2727,13 +2726,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 6 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -2760,14 +2754,14 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 41 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (; 43 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.const 65535 i32.and call $~lib/util/hash/hash16 return ) - (func $~lib/set/Set#find (; 42 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 44 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -2820,7 +2814,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 43 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 45 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -2829,7 +2823,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 44 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 46 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -2959,7 +2953,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 45 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 47 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3052,11 +3046,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 46 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 48 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 47 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 49 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3131,7 +3125,7 @@ end i32.const 1 ) - (func $std/set/test (; 48 ;) (type $FUNCSIG$v) + (func $std/set/test (; 50 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -3414,7 +3408,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 49 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 51 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -3440,7 +3434,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 50 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -3451,13 +3445,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 7 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -3484,7 +3473,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash32 (; 51 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/hash32 (; 53 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) i32.const -2128831035 local.set $1 @@ -3526,12 +3515,12 @@ local.set $1 local.get $1 ) - (func $~lib/util/hash/HASH (; 52 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (; 54 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 call $~lib/util/hash/hash32 return ) - (func $~lib/set/Set#find (; 53 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 55 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -3582,7 +3571,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 54 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 56 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -3591,7 +3580,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 55 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3721,7 +3710,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 56 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 58 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3814,11 +3803,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 57 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 59 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 58 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 60 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -3891,7 +3880,7 @@ end i32.const 1 ) - (func $std/set/test (; 59 ;) (type $FUNCSIG$v) + (func $std/set/test (; 61 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -4174,7 +4163,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 60 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 62 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -4200,7 +4189,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 61 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 63 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -4211,13 +4200,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 8 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -4244,12 +4228,12 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 62 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (; 64 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 call $~lib/util/hash/hash32 return ) - (func $~lib/set/Set#find (; 63 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 65 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -4300,7 +4284,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 64 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#has (; 66 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 @@ -4309,7 +4293,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 65 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 67 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4439,7 +4423,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 66 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#add (; 68 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4532,11 +4516,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 67 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 69 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 68 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (; 70 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -4609,7 +4593,7 @@ end i32.const 1 ) - (func $std/set/test (; 69 ;) (type $FUNCSIG$v) + (func $std/set/test (; 71 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i32) i32.const 0 @@ -4892,7 +4876,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 70 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 72 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -4918,7 +4902,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 71 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 73 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -4929,13 +4913,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 9 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -4962,7 +4941,7 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/hash64 (; 72 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/hash64 (; 74 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -5050,12 +5029,12 @@ local.set $3 local.get $3 ) - (func $~lib/util/hash/HASH (; 73 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/HASH (; 75 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 call $~lib/util/hash/hash64 return ) - (func $~lib/set/Set#find (; 74 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 76 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -5106,7 +5085,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 75 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 77 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 @@ -5115,7 +5094,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 76 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 78 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5246,7 +5225,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 77 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#add (; 79 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5339,11 +5318,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 78 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 80 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 79 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#delete (; 81 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -5417,7 +5396,7 @@ end i32.const 1 ) - (func $std/set/test (; 80 ;) (type $FUNCSIG$v) + (func $std/set/test (; 82 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -5700,7 +5679,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 81 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 83 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -5726,7 +5705,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 82 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 84 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -5737,13 +5716,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 10 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -5770,12 +5744,12 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 83 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) + (func $~lib/util/hash/HASH (; 85 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32) local.get $0 call $~lib/util/hash/hash64 return ) - (func $~lib/set/Set#find (; 84 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 86 ;) (type $FUNCSIG$iiji) (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -5826,7 +5800,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 85 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#has (; 87 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) local.get $0 local.get $1 local.get $1 @@ -5835,7 +5809,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 86 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 88 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -5966,7 +5940,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 87 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) + (func $~lib/set/Set#add (; 89 ;) (type $FUNCSIG$vij) (param $0 i32) (param $1 i64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6059,11 +6033,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 88 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 90 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 89 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#delete (; 91 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32) (local $2 i64) (local $3 i32) (local $4 i32) @@ -6137,7 +6111,7 @@ end i32.const 1 ) - (func $std/set/test (; 90 ;) (type $FUNCSIG$v) + (func $std/set/test (; 92 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 i64) i32.const 0 @@ -6420,7 +6394,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 91 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 93 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -6446,7 +6420,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 92 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 94 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -6457,13 +6431,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 11 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -6490,13 +6459,13 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 93 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) + (func $~lib/util/hash/HASH (; 95 ;) (type $FUNCSIG$if) (param $0 f32) (result i32) local.get $0 i32.reinterpret_f32 call $~lib/util/hash/hash32 return ) - (func $~lib/set/Set#find (; 94 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 96 ;) (type $FUNCSIG$iifi) (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -6547,7 +6516,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 95 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#has (; 97 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) local.get $0 local.get $1 local.get $1 @@ -6556,7 +6525,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 96 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 98 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6688,7 +6657,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 97 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) + (func $~lib/set/Set#add (; 99 ;) (type $FUNCSIG$vif) (param $0 i32) (param $1 f32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -6781,11 +6750,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 98 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 100 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 99 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) + (func $~lib/set/Set#delete (; 101 ;) (type $FUNCSIG$iif) (param $0 i32) (param $1 f32) (result i32) (local $2 f32) (local $3 i32) (local $4 i32) @@ -6860,7 +6829,7 @@ end i32.const 1 ) - (func $std/set/test (; 100 ;) (type $FUNCSIG$v) + (func $std/set/test (; 102 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f32) i32.const 0 @@ -7143,7 +7112,7 @@ unreachable end ) - (func $~lib/set/Set#clear (; 101 ;) (type $FUNCSIG$vi) (param $0 i32) + (func $~lib/set/Set#clear (; 103 ;) (type $FUNCSIG$vi) (param $0 i32) local.get $0 i32.const 0 i32.const 16 @@ -7169,7 +7138,7 @@ i32.const 0 i32.store offset=20 ) - (func $~lib/set/Set#constructor (; 102 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#constructor (; 104 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) block (result i32) local.get $0 @@ -7180,13 +7149,8 @@ call $~lib/runtime/ALLOCATE local.set $1 local.get $1 - call $~lib/runtime/ASSERT_UNREGISTERED - local.get $1 - global.get $~lib/runtime/HEADER_SIZE - i32.sub i32.const 12 - i32.store - local.get $1 + call $~lib/runtime/doRegister end local.set $0 end @@ -7213,13 +7177,13 @@ call $~lib/set/Set#clear local.get $0 ) - (func $~lib/util/hash/HASH (; 103 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) + (func $~lib/util/hash/HASH (; 105 ;) (type $FUNCSIG$id) (param $0 f64) (result i32) local.get $0 i64.reinterpret_f64 call $~lib/util/hash/hash64 return ) - (func $~lib/set/Set#find (; 104 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (func $~lib/set/Set#find (; 106 ;) (type $FUNCSIG$iidi) (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) local.get $0 @@ -7270,7 +7234,7 @@ end i32.const 0 ) - (func $~lib/set/Set#has (; 105 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#has (; 107 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) local.get $0 local.get $1 local.get $1 @@ -7279,7 +7243,7 @@ i32.const 0 i32.ne ) - (func $~lib/set/Set#rehash (; 106 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) + (func $~lib/set/Set#rehash (; 108 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7411,7 +7375,7 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/set/Set#add (; 107 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) + (func $~lib/set/Set#add (; 109 ;) (type $FUNCSIG$vid) (param $0 i32) (param $1 f64) (local $2 i32) (local $3 i32) (local $4 i32) @@ -7504,11 +7468,11 @@ i32.store end ) - (func $~lib/set/Set#get:size (; 108 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/set/Set#get:size (; 110 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) local.get $0 i32.load offset=20 ) - (func $~lib/set/Set#delete (; 109 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) + (func $~lib/set/Set#delete (; 111 ;) (type $FUNCSIG$iid) (param $0 i32) (param $1 f64) (result i32) (local $2 f64) (local $3 i32) (local $4 i32) @@ -7583,7 +7547,7 @@ end i32.const 1 ) - (func $std/set/test (; 110 ;) (type $FUNCSIG$v) + (func $std/set/test (; 112 ;) (type $FUNCSIG$v) (local $0 i32) (local $1 f64) i32.const 0 @@ -7866,7 +7830,7 @@ unreachable end ) - (func $start:std/set (; 111 ;) (type $FUNCSIG$v) + (func $start:std/set (; 113 ;) (type $FUNCSIG$v) global.get $~lib/memory/HEAP_BASE i32.const 7 i32.add @@ -7888,9 +7852,9 @@ call $std/set/test call $std/set/test ) - (func $start (; 112 ;) (type $FUNCSIG$v) + (func $start (; 114 ;) (type $FUNCSIG$v) call $start:std/set ) - (func $null (; 113 ;) (type $FUNCSIG$v) + (func $null (; 115 ;) (type $FUNCSIG$v) ) )