From dacbd97af08e8647cfddf1189d0f82234599b0fa Mon Sep 17 00:00:00 2001 From: dcode Date: Mon, 22 Jun 2020 19:35:26 +0200 Subject: [PATCH 1/8] Enforce strict field initialization --- src/ast.ts | 29 +- src/compiler.ts | 386 +++--- src/diagnosticMessages.generated.ts | 4 + src/diagnosticMessages.json | 2 + src/flow.ts | 111 +- src/program.ts | 49 +- src/resolver.ts | 36 +- src/tokenizer.ts | 17 +- src/types.ts | 45 +- src/util/collections.ts | 26 +- tests/compiler/extends-baseaggregate.ts | 2 +- .../compiler/field-initialization-errors.json | 19 + tests/compiler/field-initialization-errors.ts | 133 +++ tests/compiler/field-initialization.json | 5 + .../field-initialization.optimized.wat | 451 +++++++ tests/compiler/field-initialization.ts | 171 +++ .../field-initialization.untouched.wat | 1051 +++++++++++++++++ tests/compiler/retain-release-sanity.ts | 4 +- tests/compiler/retain-release.ts | 2 +- tests/compiler/rt/finalize.ts | 4 +- 20 files changed, 2315 insertions(+), 232 deletions(-) create mode 100644 tests/compiler/field-initialization-errors.json create mode 100644 tests/compiler/field-initialization-errors.ts create mode 100644 tests/compiler/field-initialization.json create mode 100644 tests/compiler/field-initialization.optimized.wat create mode 100644 tests/compiler/field-initialization.ts create mode 100644 tests/compiler/field-initialization.untouched.wat diff --git a/src/ast.ts b/src/ast.ts index 8d33ce4fff..5e19d4160a 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -748,15 +748,27 @@ export abstract class Node { return false; } - /** Checks if this is a call calling a method on super. */ - get isCallOnSuper(): bool { - if (this.kind != NodeKind.CALL) return false; - var expression = changetype(this).expression; - if (expression.kind != NodeKind.PROPERTYACCESS) return false; - var target = (expression).expression; - if (target.kind == NodeKind.SUPER) return true; + private isAccessOn(kind: NodeKind): bool { + let node = changetype(this); + if (node.kind == NodeKind.CALL) { + node = (node).expression; + } + if (node.kind == NodeKind.PROPERTYACCESS) { + let target = (node).expression; + if (target.kind == kind) return true; + } return false; } + + /** Checks if this node accesses a method or property on `this`. */ + get isAccessOnThis(): bool { + return this.isAccessOn(NodeKind.THIS); + } + + /** Checks if this node accesses a method or property on `super`. */ + get isAccessOnSuper(): bool { + return this.isAccessOn(NodeKind.SUPER); + } } // types @@ -1519,11 +1531,12 @@ export class Source extends Node { public text: string ) { super(NodeKind.SOURCE, changetype(0)); // ¯\(ツ)/¯ - this.range = new Range(this, 0, text.length); + this.range = new Range(null, 0, text.length); var internalPath = mangleInternalPath(normalizedPath); this.internalPath = internalPath; var pos = internalPath.lastIndexOf(PATH_DELIMITER); this.simplePath = pos >= 0 ? internalPath.substring(pos + 1) : internalPath; + this.range.source = this; } /** Path used internally. */ diff --git a/src/compiler.ts b/src/compiler.ts index 0c6614477d..bd4789e467 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -97,6 +97,7 @@ import { FlowFlags, Flow, LocalFlags, + FieldFlags, ConditionKind, findUsedLocals } from "./flow"; @@ -191,7 +192,7 @@ import { writeI64, writeF32, writeF64, - makeMap, + uniqueMap, isPowerOf2 } from "./util"; @@ -287,7 +288,9 @@ export const enum Constraints { /** Indicates that the value will be retained immediately. */ WILL_RETAIN = 1 << 4, /** Indicates that static data is preferred. */ - PREFER_STATIC = 1 << 5 + PREFER_STATIC = 1 << 5, + /** Indicates that the value will become `this` of a property access or instance call. */ + IS_THIS = 1 << 6 } /** Runtime features to be activated by the compiler. */ @@ -2996,7 +2999,7 @@ export class Compiler extends DiagnosticEmitter { type = resolver.resolveType( // reports typeNode, flow.actualFunction, - makeMap(flow.contextualTypeArguments) + uniqueMap(flow.contextualTypeArguments) ); if (!type) continue; this.checkTypeSupported(type, typeNode); @@ -3806,7 +3809,7 @@ export class Compiler extends DiagnosticEmitter { let toType = this.resolver.resolveType( // reports assert(expression.toType), flow.actualFunction, - makeMap(flow.contextualTypeArguments) + uniqueMap(flow.contextualTypeArguments) ); if (!toType) return this.module.unreachable(); return this.compileExpression(expression.expression, toType, inheritedConstraints | Constraints.CONV_EXPLICIT); @@ -6055,7 +6058,11 @@ export class Compiler extends DiagnosticEmitter { return this.makeCallDirect(operatorInstance, [ leftExpr, rightExpr ], reportNode); } - private compileAssignment(expression: Expression, valueExpression: Expression, contextualType: Type): ExpressionRef { + private compileAssignment( + expression: Expression, + valueExpression: Expression, + contextualType: Type + ): ExpressionRef { var program = this.program; var resolver = program.resolver; var flow = this.currentFlow; @@ -6214,28 +6221,34 @@ export class Compiler extends DiagnosticEmitter { case ElementKind.FIELD: { let fieldInstance = target; let initializerNode = fieldInstance.initializerNode; - if ( - fieldInstance.is(CommonFlags.READONLY) && - !( - flow.actualFunction.is(CommonFlags.CONSTRUCTOR) || - initializerNode !== null - ) - ) { - this.error( - DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, - valueExpression.range, fieldInstance.internalName - ); - return module.unreachable(); + let isConstructor = flow.actualFunction.is(CommonFlags.CONSTRUCTOR); + + // Cannot assign to readonly fields except in constructors if there's no initializer + if (fieldInstance.is(CommonFlags.READONLY)) { + if (!isConstructor || initializerNode !== null) { + this.error( + DiagnosticCode.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, + valueExpression.range, fieldInstance.internalName + ); + return module.unreachable(); + } + } + + // Mark initialized fields in constructors + thisExpression = assert(thisExpression); + if (isConstructor && thisExpression.kind == NodeKind.THIS) { + flow.setThisFieldFlag(fieldInstance, FieldFlags.INITIALIZED); } + let fieldParent = fieldInstance.parent; assert(fieldParent.kind == ElementKind.CLASS); return this.makeFieldAssignment(fieldInstance, valueExpr, valueType, this.compileExpression( - assert(thisExpression), + thisExpression, (fieldParent).type, - Constraints.CONV_IMPLICIT + Constraints.CONV_IMPLICIT | Constraints.IS_THIS ), tee ); @@ -6258,7 +6271,7 @@ export class Compiler extends DiagnosticEmitter { let thisExpr = this.compileExpression( assert(thisExpression), thisType, - Constraints.CONV_IMPLICIT + Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); if (!tee) return this.makeCallDirect(setterInstance, [ thisExpr, valueExpr ], valueExpression); let getterInstance = assert((target).getterInstance); @@ -6313,7 +6326,11 @@ export class Compiler extends DiagnosticEmitter { assert(setterInstance.signature.parameterTypes.length == 2); let valueType = setterInstance.signature.parameterTypes[1]; if (this.skippedAutoreleases.has(valueExpr)) valueExpr = this.makeAutorelease(valueExpr, valueType, flow); // (*) - let thisExpr = this.compileExpression(assert(thisExpression), classInstance.type); + let thisExpr = this.compileExpression( + assert(thisExpression), + classInstance.type, + Constraints.CONV_IMPLICIT | Constraints.IS_THIS + ); let elementExpr = this.compileExpression(assert(indexExpression), Type.i32, Constraints.CONV_IMPLICIT); if (tee) { let tempTarget = flow.getTempLocal(classInstance.type); @@ -6654,7 +6671,7 @@ export class Compiler extends DiagnosticEmitter { thisArg = this.compileExpression( assert(thisExpression), assert(functionInstance.signature.thisType), - Constraints.CONV_IMPLICIT + Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); } return this.compileCallDirect( @@ -6708,7 +6725,7 @@ export class Compiler extends DiagnosticEmitter { this.compileExpression( assert(thisExpression), (fieldParent).type, - Constraints.CONV_IMPLICIT + Constraints.CONV_IMPLICIT | Constraints.IS_THIS ), NativeType.I32, fieldInstance.memoryOffset @@ -6742,7 +6759,7 @@ export class Compiler extends DiagnosticEmitter { thisArg = this.compileExpression( assert(thisExpression), assert(getterInstance.signature.thisType), - Constraints.CONV_IMPLICIT + Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); } indexArg = this.compileCallDirect(getterInstance, [], expression.expression, thisArg); @@ -6808,7 +6825,7 @@ export class Compiler extends DiagnosticEmitter { assert(typeParameterNodes), typeArgumentNodes, this.currentFlow.actualFunction.parent, - makeMap(this.currentFlow.contextualTypeArguments), + uniqueMap(this.currentFlow.contextualTypeArguments), expression ); } @@ -6926,8 +6943,16 @@ export class Compiler extends DiagnosticEmitter { } if (instance.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(reportNode); + // handle call on `this` in constructors + let actualFunction = this.currentFlow.actualFunction; + if (actualFunction.is(CommonFlags.CONSTRUCTOR) && reportNode.isAccessOnThis) { + let parent = actualFunction.parent; + assert(parent.kind == ElementKind.CLASS); + this.checkFieldInitialization(parent, reportNode); + } + // Inline if explicitly requested - if (instance.hasDecorator(DecoratorFlags.INLINE) && (!instance.is(CommonFlags.VIRTUAL) || reportNode.isCallOnSuper)) { + if (instance.hasDecorator(DecoratorFlags.INLINE) && (!instance.is(CommonFlags.VIRTUAL) || reportNode.isAccessOnSuper)) { assert(!instance.is(CommonFlags.STUB)); // doesn't make sense let inlineStack = this.inlineStack; if (inlineStack.includes(instance)) { @@ -7876,7 +7901,7 @@ export class Compiler extends DiagnosticEmitter { } // Call the virtual stub with the vtable if the function has overloads - if (instance.is(CommonFlags.VIRTUAL) && !reportNode.isCallOnSuper) { + if (instance.is(CommonFlags.VIRTUAL) && !reportNode.isAccessOnSuper) { instance = this.ensureVirtualStub(instance); } @@ -7916,6 +7941,19 @@ export class Compiler extends DiagnosticEmitter { return this.module.unreachable(); } + // handle call with `this` in constructors + let actualFunction = this.currentFlow.actualFunction; + if (actualFunction.is(CommonFlags.CONSTRUCTOR)) { + let parent = actualFunction.parent; + assert(parent.kind == ElementKind.CLASS); + for (let i = 0, k = argumentExpressions.length; i < k; ++i) { + if (argumentExpressions[i].kind == NodeKind.THIS) { + this.checkFieldInitialization(parent, argumentExpressions[i]); + break; + } + } + } + var numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments; var operands = new Array(numArgumentsInclThis); var index = 0; @@ -8082,7 +8120,7 @@ export class Compiler extends DiagnosticEmitter { DecoratorFlags.NONE ); var instance: Function | null; - var contextualTypeArguments = makeMap(flow.contextualTypeArguments); + var contextualTypeArguments = uniqueMap(flow.contextualTypeArguments); // compile according to context. this differs from a normal function in that omitted parameter // and return types can be inferred and omitted arguments can be replaced with dummies. @@ -8255,21 +8293,26 @@ export class Compiler extends DiagnosticEmitter { return module.i32(0); } case NodeKind.THIS: { - if (actualFunction.is(CommonFlags.INSTANCE)) { - let thisLocal = assert(flow.lookupLocal(CommonNames.this_)); - let thisType = assert(actualFunction.signature.thisType); - let parent = assert(actualFunction.parent); + if (!actualFunction.is(CommonFlags.INSTANCE)) { + this.error( + DiagnosticCode._this_cannot_be_referenced_in_current_location, + expression.range + ); + this.currentType = this.options.usizeType; + return module.unreachable(); + } + if (actualFunction.is(CommonFlags.CONSTRUCTOR) && !(constraints & Constraints.IS_THIS)) { + let parent = actualFunction.parent; assert(parent.kind == ElementKind.CLASS); - flow.set(FlowFlags.ACCESSES_THIS); - this.currentType = thisType; - return module.local_get(thisLocal.index, thisType.toNativeType()); + this.checkFieldInitialization(parent, expression); } - this.error( - DiagnosticCode._this_cannot_be_referenced_in_current_location, - expression.range - ); - this.currentType = this.options.usizeType; - return module.unreachable(); + let thisLocal = assert(flow.lookupLocal(CommonNames.this_)); + let thisType = assert(actualFunction.signature.thisType); + let parent = assert(actualFunction.parent); + assert(parent.kind == ElementKind.CLASS); + flow.set(FlowFlags.ACCESSES_THIS); + this.currentType = thisType; + return module.local_get(thisLocal.index, thisType.toNativeType()); } case NodeKind.SUPER: { let flow = this.currentFlow; @@ -8419,7 +8462,7 @@ export class Compiler extends DiagnosticEmitter { let functionInstance = this.resolver.resolveFunction( functionPrototype, null, - makeMap(flow.contextualTypeArguments) + uniqueMap(flow.contextualTypeArguments) ); if (!functionInstance || !this.compileFunction(functionInstance)) return module.unreachable(); if (contextualType.is(TypeFlags.HOST | TypeFlags.REFERENCE)) { @@ -8461,7 +8504,7 @@ export class Compiler extends DiagnosticEmitter { var expectedType = this.resolver.resolveType( expression.isType, flow.actualFunction, - makeMap(flow.contextualTypeArguments) + uniqueMap(flow.contextualTypeArguments) ); if (!expectedType) { this.currentType = Type.bool; @@ -9274,14 +9317,14 @@ export class Compiler extends DiagnosticEmitter { classInstance = this.resolver.resolveClass( classPrototype, classReference.typeArguments, - makeMap(flow.contextualTypeArguments) + uniqueMap(flow.contextualTypeArguments) ); } else { classInstance = this.resolver.resolveClassInclTypeArguments( classPrototype, typeArguments, flow.actualFunction.parent, // relative to caller - makeMap(flow.contextualTypeArguments), + uniqueMap(flow.contextualTypeArguments), expression ); } @@ -9294,113 +9337,152 @@ export class Compiler extends DiagnosticEmitter { ensureConstructor(classInstance: Class, reportNode: Node): Function { var instance = classInstance.constructorInstance; if (instance) { - // do not attempt to compile it if inlined anyway + // shortcut if already compiled + if (instance.is(CommonFlags.COMPILED)) return instance; + // do not attempt to compile if inlined anyway if (!instance.hasDecorator(DecoratorFlags.INLINE)) this.compileFunction(instance); - return instance; - } - - // clone base constructor if a derived class - var baseClass = classInstance.base; - var contextualTypeArguments = makeMap(classInstance.contextualTypeArguments); - if (baseClass) { - let baseCtor = this.ensureConstructor(baseClass, reportNode); - instance = new Function( - CommonNames.constructor, - new FunctionPrototype( + } else { + // clone base constructor if a derived class + let baseClass = classInstance.base; + let contextualTypeArguments = uniqueMap(classInstance.contextualTypeArguments); + if (baseClass) { + let baseCtor = this.ensureConstructor(baseClass, reportNode); + instance = new Function( CommonNames.constructor, - classInstance, - // declaration is important, i.e. to access optional parameter initializers - (baseCtor.declaration).clone() - ), - null, - baseCtor.signature, - contextualTypeArguments - ); + new FunctionPrototype( + CommonNames.constructor, + classInstance, + // declaration is important, i.e. to access optional parameter initializers + (baseCtor.declaration).clone() + ), + null, + baseCtor.signature, + contextualTypeArguments + ); - // otherwise make a default constructor - } else { - instance = new Function( - CommonNames.constructor, - new FunctionPrototype( + // otherwise make a default constructor + } else { + instance = new Function( CommonNames.constructor, - classInstance, // bound - this.program.makeNativeFunctionDeclaration(CommonNames.constructor, - CommonFlags.INSTANCE | CommonFlags.CONSTRUCTOR - ) - ), - null, - new Signature(this.program, null, classInstance.type, classInstance.type), - contextualTypeArguments - ); - let members = classInstance.members; - if (!members) classInstance.members = members = new Map(); - members.set("constructor", instance.prototype); - } + new FunctionPrototype( + CommonNames.constructor, + classInstance, // bound + this.program.makeNativeFunctionDeclaration(CommonNames.constructor, + CommonFlags.INSTANCE | CommonFlags.CONSTRUCTOR + ) + ), + null, + new Signature(this.program, null, classInstance.type, classInstance.type), + contextualTypeArguments + ); + let members = classInstance.members; + if (!members) classInstance.members = members = new Map(); + members.set("constructor", instance.prototype); + } - instance.internalName = classInstance.internalName + INSTANCE_DELIMITER + "constructor"; - instance.set(CommonFlags.COMPILED); - instance.prototype.setResolvedInstance("", instance); - classInstance.constructorInstance = instance; - var previousFlow = this.currentFlow; - var flow = instance.flow; - this.currentFlow = flow; + instance.internalName = classInstance.internalName + INSTANCE_DELIMITER + "constructor"; + instance.set(CommonFlags.COMPILED); + instance.prototype.setResolvedInstance("", instance); + classInstance.constructorInstance = instance; + let previousFlow = this.currentFlow; + let flow = instance.flow; + this.currentFlow = flow; - // generate body - var signature = instance.signature; - var module = this.module; - var nativeSizeType = this.options.nativeSizeType; - var stmts = new Array(); + // generate body + let signature = instance.signature; + let module = this.module; + let nativeSizeType = this.options.nativeSizeType; + let stmts = new Array(); - // { - // if (!this) this = - // IF_DERIVED: this = super(this, ...args) - // this.a = X - // this.b = Y - // return this - // } - var allocExpr = this.makeAllocation(classInstance); - var classType = classInstance.type; - if (classType.isManaged) allocExpr = this.makeRetain(allocExpr, classType); - stmts.push( - module.if( - module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, - module.local_get(0, nativeSizeType) - ), - module.local_set(0, allocExpr) - ) - ); - if (baseClass) { - let parameterTypes = signature.parameterTypes; - let numParameters = parameterTypes.length; - let operands = new Array(1 + numParameters); - operands[0] = module.local_get(0, nativeSizeType); - for (let i = 0; i < numParameters; ++i) { - operands[i + 1] = module.local_get(i + 1, parameterTypes[i].toNativeType()); - } + // { + // if (!this) this = + // IF_DERIVED: this = super(this, ...args) + // this.a = X + // this.b = Y + // return this + // } + let allocExpr = this.makeAllocation(classInstance); + let classType = classInstance.type; + if (classType.isManaged) allocExpr = this.makeRetain(allocExpr, classType); stmts.push( - module.local_set(0, - this.makeCallDirect(assert(baseClass.constructorInstance), operands, reportNode, false, true) + module.if( + module.unary(nativeSizeType == NativeType.I64 ? UnaryOp.EqzI64 : UnaryOp.EqzI32, + module.local_get(0, nativeSizeType) + ), + module.local_set(0, allocExpr) ) ); - } - this.makeFieldInitializationInConstructor(classInstance, stmts); - var body = this.performAutoreleasesWithValue(flow, module.local_get(0, nativeSizeType), classInstance.type, stmts); - flow.freeScopedLocals(); - this.currentFlow = previousFlow; + if (baseClass) { + let parameterTypes = signature.parameterTypes; + let numParameters = parameterTypes.length; + let operands = new Array(1 + numParameters); + operands[0] = module.local_get(0, nativeSizeType); + for (let i = 0; i < numParameters; ++i) { + operands[i + 1] = module.local_get(i + 1, parameterTypes[i].toNativeType()); + } + stmts.push( + module.local_set(0, + this.makeCallDirect(assert(baseClass.constructorInstance), operands, reportNode, false, true) + ) + ); + } + this.makeFieldInitializationInConstructor(classInstance, stmts); + let body = this.performAutoreleasesWithValue(flow, module.local_get(0, nativeSizeType), classInstance.type, stmts); + flow.freeScopedLocals(); + this.currentFlow = previousFlow; - // make the function - var locals = instance.localsByIndex; - var varTypes = new Array(); // of temp. vars added while compiling initializers - var numOperands = 1 + signature.parameterTypes.length; - var numLocals = locals.length; - if (numLocals > numOperands) { - for (let i = numOperands; i < numLocals; ++i) varTypes.push(locals[i].type.toNativeType()); + // make the function + let locals = instance.localsByIndex; + let varTypes = new Array(); // of temp. vars added while compiling initializers + let numOperands = 1 + signature.parameterTypes.length; + let numLocals = locals.length; + if (numLocals > numOperands) { + for (let i = numOperands; i < numLocals; ++i) varTypes.push(locals[i].type.toNativeType()); + } + let funcRef = module.addFunction(instance.internalName, signature.nativeParams, signature.nativeResults, varTypes, body); + instance.finalize(module, funcRef); } - var funcRef = module.addFunction(instance.internalName, signature.nativeParams, signature.nativeResults, varTypes, body); - instance.finalize(module, funcRef); + + // check that fields are initialized when returning + this.checkFieldInitialization(classInstance); + return instance; } + /** Checks that all class fields have been initialized. */ + private checkFieldInitialization(classInstance: Class, relatedNode: Node | null = null): void { + var members = classInstance.members; + if (members) { + let ctor = assert(classInstance.constructorInstance); + let flow = ctor.flow; + for (let _values = Map_values(members), i = 0, k = _values.length; i < k; ++i) { + let element = _values[i]; + if (element.kind == ElementKind.FIELD && element.parent == classInstance) { + let field = element; + if (!field.initializerNode && !flow.isThisFieldFlag(field, FieldFlags.INITIALIZED)) { + if (!field.is(CommonFlags.ERRORED)) { + field.set(CommonFlags.ERRORED); + if (relatedNode) { + this.errorRelated( + DiagnosticCode.Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned, + field.declaration.name.range, + relatedNode.range, + field.internalName + ); + } else { + this.error( + DiagnosticCode.Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned, + field.declaration.name.range, + field.internalName + ); + } + } + } + } + } + } + } + compileInstantiate( /** Class to instantiate. */ classInstance: Class, @@ -9490,15 +9572,27 @@ export class Compiler extends DiagnosticEmitter { let thisExpr = this.compileExpression( thisExpression, (fieldParent).type, - Constraints.CONV_IMPLICIT + Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); - let thisType = this.currentType; - if (thisType.is(TypeFlags.NULLABLE)) { - if (!flow.isNonnull(thisExpr, thisType)) { - this.error( - DiagnosticCode.Object_is_possibly_null, - thisExpression.range - ); + if ( + flow.actualFunction.is(CommonFlags.CONSTRUCTOR) && + thisExpression.kind == NodeKind.THIS && + !flow.isThisFieldFlag(fieldInstance, FieldFlags.INITIALIZED) + ) { + this.error( + DiagnosticCode.Property_0_is_used_before_being_assigned, + expression.range, + fieldInstance.internalName + ); + } else { + let thisType = this.currentType; + if (thisType.is(TypeFlags.NULLABLE)) { + if (!flow.isNonnull(thisExpr, thisType)) { + this.error( + DiagnosticCode.Object_is_possibly_null, + thisExpression.range + ); + } } } if (!fieldInstance.is(CommonFlags.COMPILED)) { @@ -9530,7 +9624,7 @@ export class Compiler extends DiagnosticEmitter { thisArg = this.compileExpression( assert(thisExpression), assert(getterInstance.signature.thisType), - Constraints.CONV_IMPLICIT + Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); } return this.compileCallDirect(getterInstance, [], expression, thisArg); diff --git a/src/diagnosticMessages.generated.ts b/src/diagnosticMessages.generated.ts index aa2cf67cf8..1c1e7a6009 100644 --- a/src/diagnosticMessages.generated.ts +++ b/src/diagnosticMessages.generated.ts @@ -163,6 +163,8 @@ export enum DiagnosticCode { Expected_0_arguments_but_got_1 = 2554, Expected_at_least_0_arguments_but_got_1 = 2555, Expected_0_type_arguments_but_got_1 = 2558, + Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned = 2564, + Property_0_is_used_before_being_assigned = 2565, A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums = 2651, Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration = 2673, Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration = 2674, @@ -338,6 +340,8 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 2554: return "Expected {0} arguments, but got {1}."; case 2555: return "Expected at least {0} arguments, but got {1}."; case 2558: return "Expected {0} type arguments, but got {1}."; + case 2564: return "Property '{0}' has no initializer and is not assigned in the constructor before 'this' is used or returned."; + case 2565: return "Property '{0}' is used before being assigned."; case 2651: return "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."; case 2673: return "Constructor of class '{0}' is private and only accessible within the class declaration."; case 2674: return "Constructor of class '{0}' is protected and only accessible within the class declaration."; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index 00e3bea6ec..77992594c2 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -159,6 +159,8 @@ "Expected {0} arguments, but got {1}.": 2554, "Expected at least {0} arguments, but got {1}.": 2555, "Expected {0} type arguments, but got {1}.": 2558, + "Property '{0}' has no initializer and is not assigned in the constructor before 'this' is used or returned.": 2564, + "Property '{0}' is used before being assigned.": 2565, "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.": 2651, "Constructor of class '{0}' is private and only accessible within the class declaration.": 2673, "Constructor of class '{0}' is protected and only accessible within the class declaration.": 2674, diff --git a/src/flow.ts b/src/flow.ts index 5de4c8129c..fc42948602 100644 --- a/src/flow.ts +++ b/src/flow.ts @@ -26,7 +26,9 @@ import { Function, Element, ElementKind, - Global + Global, + Field, + Class } from "./program"; import { @@ -171,6 +173,12 @@ export enum LocalFlags { | CONDITIONALLY_RETAINED } +/** Flags indicating the current state of a field. */ +export enum FieldFlags { + NONE = 0, + INITIALIZED = 1 << 0 +} + /** Condition kinds. */ export const enum ConditionKind { /** Outcome of the condition is unknown */ @@ -186,7 +194,11 @@ export class Flow { /** Creates the parent flow of the specified function. */ static createParent(parentFunction: Function): Flow { - return new Flow(parentFunction); + var flow = new Flow(parentFunction); + if (parentFunction.is(CommonFlags.CONSTRUCTOR)) { + flow.initThisFieldFlags(); + } + return flow; } /** Creates an inline flow within `parentFunction`. */ @@ -194,6 +206,9 @@ export class Flow { var flow = new Flow(parentFunction); flow.inlineFunction = inlineFunction; flow.inlineReturnLabel = inlineFunction.internalName + "|inlined." + (inlineFunction.nextInlineId++).toString(); + if (inlineFunction.is(CommonFlags.CONSTRUCTOR)) { + flow.initThisFieldFlags(); + } return flow; } @@ -216,6 +231,8 @@ export class Flow { scopedLocals: Map | null = null; /** Local flags. */ localFlags: LocalFlags[] = []; + /** Field flags on `this`. Constructors only. */ + thisFieldFlags: Map | null = null; /** Function being inlined, when inlining. */ inlineFunction: Function | null = null; /** The label we break to when encountering a return statement, when inlining. */ @@ -269,6 +286,17 @@ export class Flow { branch.breakLabel = this.breakLabel; } branch.localFlags = this.localFlags.slice(); + if (this.actualFunction.is(CommonFlags.CONSTRUCTOR)) { + let fieldFlags = assert(this.thisFieldFlags); + let clonedFieldFlags = new Map(); + for (let _keys = Map_keys(fieldFlags), i = 0, k = _keys.length; i < k; ++i) { + let key = _keys[i]; + clonedFieldFlags.set(key, changetype(fieldFlags.get(key))); + } + branch.thisFieldFlags = clonedFieldFlags; + } else { + assert(!this.thisFieldFlags); + } branch.inlineFunction = this.inlineFunction; branch.inlineReturnLabel = this.inlineReturnLabel; return branch; @@ -537,6 +565,62 @@ export class Flow { localFlags[index] = flags & ~flag; } + /** Initializes `this` field flags. */ + initThisFieldFlags(): void { + var actualFunction = this.actualFunction; + assert(actualFunction.is(CommonFlags.CONSTRUCTOR)); + var actualParent = actualFunction.parent; + assert(actualParent.kind == ElementKind.CLASS); + var actualClass = actualParent; + this.thisFieldFlags = new Map(); + var members = actualClass.members; + if (members) { + for (let _values = Map_values(members), i = 0, k = _values.length; i < k; ++i) { + let member = _values[i]; + if (member.kind == ElementKind.FIELD) { + let field = member; + if ( + // guaranteed by super + field.parent != actualClass || + // has field initializer + field.initializerNode !== null || + // is initialized as a ctor parameter + field.prototype.parameterIndex != -1 || + // is safe to initialize with zero + field.type.isAny(TypeFlags.VALUE | TypeFlags.NULLABLE) + ) { + this.setThisFieldFlag(field, FieldFlags.INITIALIZED); + } + } + } + } + } + + /** Tests if the specified `this` field has the specified flag or flags. */ + isThisFieldFlag(field: Field, flag: FieldFlags): bool { + var fieldFlags = this.thisFieldFlags; + if (fieldFlags) { + return (changetype(fieldFlags.get(field)) & flag) == flag; + } + return false; + } + + /** Sets the specified flag or flags on the given `this` field. */ + setThisFieldFlag(field: Field, flag: FieldFlags): void { + var fieldFlags = this.thisFieldFlags; + if (fieldFlags) { + assert(this.actualFunction.is(CommonFlags.CONSTRUCTOR)); + if (fieldFlags.has(field)) { + let flags = changetype(fieldFlags.get(field)); + fieldFlags.set(field, flags | flag); + } else { + fieldFlags.set(field, flag); + } + } else { + assert(!this.actualFunction.is(CommonFlags.CONSTRUCTOR)); + } + } + /** Pushes a new break label to the stack, for example when entering a loop that one can `break` from. */ pushBreakLabel(): string { var parentFunction = this.parentFunction; @@ -582,6 +666,7 @@ export class Flow { this.flags = this.flags | otherFlags; // what happens before is still true this.localFlags = other.localFlags; + this.thisFieldFlags = other.thisFieldFlags; } /** Inherits flags of a conditional branch joining again with this one, i.e. then without else. */ @@ -667,6 +752,7 @@ export class Flow { this.flags = newFlags | (thisFlags & FlowFlags.UNCHECKED_CONTEXT); + // local flags var thisLocalFlags = this.localFlags; var numThisLocalFlags = thisLocalFlags.length; var otherLocalFlags = other.localFlags; @@ -694,6 +780,9 @@ export class Flow { } thisLocalFlags[i] = newFlags; } + + // field flags do not matter here since there's only INITIALIZED, which can + // only be set if it has been observed prior to entering the branch. } /** Inherits mutual flags of two alternate branches becoming this one, i.e. then with else. */ @@ -787,6 +876,7 @@ export class Flow { this.flags = newFlags | (this.flags & FlowFlags.UNCHECKED_CONTEXT); + // local flags var thisLocalFlags = this.localFlags; if (leftFlags & FlowFlags.TERMINATES) { if (!(rightFlags & FlowFlags.TERMINATES)) { @@ -829,6 +919,23 @@ export class Flow { thisLocalFlags[i] = newFlags; } } + + // field flags (currently only INITIALIZED, so can simplify) + var leftFieldFlags = left.thisFieldFlags; + if (leftFieldFlags) { + let newFieldFlags = new Map(); + let rightFieldFlags = assert(right.thisFieldFlags); + for (let _keys = Map_keys(leftFieldFlags), i = 0, k = _keys.length; i < k; ++i) { + let key = _keys[i]; + let leftFlags = changetype(leftFieldFlags.get(key)); + if ((leftFlags & FieldFlags.INITIALIZED) != 0 && rightFieldFlags.has(key) && (changetype(rightFieldFlags.get(key)) & FieldFlags.INITIALIZED)) { + newFieldFlags.set(key, FieldFlags.INITIALIZED); + } + } + this.thisFieldFlags = newFieldFlags; + } else { + assert(!right.thisFieldFlags); + } } /** Tests if the specified flows have differing local states. */ diff --git a/src/program.ts b/src/program.ts index f3bf0dafb1..7302c6122b 100644 --- a/src/program.ts +++ b/src/program.ts @@ -425,17 +425,17 @@ export class Program extends DiagnosticEmitter { super(diagnostics); var nativeSource = new Source(SourceKind.LIBRARY_ENTRY, LIBRARY_SUBST + ".wasm", "[native code]"); this.nativeSource = nativeSource; + this.parser = new Parser(this.diagnostics, this.sources); + this._resolver = new Resolver(this); var nativeFile = new File(this, nativeSource); - this.nativeFile = nativeFile; + this._nativeFile = nativeFile; this.filesByName.set(nativeFile.internalName, nativeFile); - this.parser = new Parser(this.diagnostics, this.sources); - this.resolver = new Resolver(this); } /** Parser instance. */ parser: Parser; /** Resolver instance. */ - resolver: Resolver; + private _resolver: Resolver | null = null; /** Array of sources. */ sources: Source[] = []; /** Diagnostic offset used where successively obtaining the next diagnostic. */ @@ -443,7 +443,7 @@ export class Program extends DiagnosticEmitter { /** Special native code source. */ nativeSource: Source; /** Special native code file. */ - nativeFile: File; + private _nativeFile: File | null = null; /** Next class id. */ nextClassId: u32 = 0; /** Next signature id. */ @@ -451,6 +451,16 @@ export class Program extends DiagnosticEmitter { /** An indicator if the program has been initialized. */ initialized: bool = false; + /** Gets the singleton native file. */ + get nativeFile(): File { + return assert(this._nativeFile); + } + + /** Gets the corresponding resolver. */ + get resolver(): Resolver { + return assert(this._resolver); + } + // Lookup maps /** Files by unique internal name. */ @@ -2600,7 +2610,7 @@ export namespace DecoratorFlags { export abstract class Element { /** Parent element. */ - parent: Element; + private _parent: Element | null; /** Common flags indicating specific traits. */ flags: CommonFlags = CommonFlags.NONE; /** Decorator flags indicating annotated traits. */ @@ -2627,13 +2637,18 @@ export abstract class Element { this.name = name; this.internalName = internalName; if (parent) { - this.parent = parent; + this._parent = parent; } else { assert(this.kind == ElementKind.FILE); - this.parent = this; // special case to keep this.parent non-nullable + this._parent = this; // special case to keep this.parent non-nullable } } + /** Gets the parent element. */ + get parent(): Element { + return assert(this._parent); + } + /** Gets the enclosing file. */ get file(): File { var current: Element = this; @@ -2881,7 +2896,7 @@ export class File extends Element { /** File re-exports. */ exportsStar: File[] | null = null; /** Top-level start function of this file. */ - startFunction: Function; + private _startFunction: Function | null; /** Constructs a new file. */ constructor( @@ -2906,7 +2921,12 @@ export class File extends Element { this ); startFunction.internalName = startFunction.name; - this.startFunction = startFunction; + this._startFunction = startFunction; + } + + /** Gets this file's start function. */ + get startFunction(): Function { + return assert(this._startFunction); } /* @override */ @@ -3436,7 +3456,7 @@ export class Function extends TypedElement { /** Contextual type arguments. */ contextualTypeArguments: Map | null; /** Default control flow. */ - flow: Flow; + private _flow: Flow | null; /** Remembered debug locations. */ debugLocations: Range[] = []; /** Function reference, if compiled. */ @@ -3510,10 +3530,15 @@ export class Function extends TypedElement { this.localsByIndex[local.index] = local; } } - this.flow = Flow.createParent(this); + this._flow = Flow.createParent(this); registerConcreteElement(program, this); } + /** Gets the default control flow. */ + get flow(): Flow { + return assert(this._flow); + } + /** Creates a stub for use with this function, i.e. for varargs or virtual calls. */ newStub(postfix: string): Function { var stub = new Function( diff --git a/src/resolver.ts b/src/resolver.ts index 39b6f89543..9ab9b80d9c 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -97,7 +97,7 @@ import { } from "./common"; import { - makeMap, + uniqueMap, isPowerOf2 } from "./util"; @@ -255,7 +255,7 @@ export class Resolver extends DiagnosticEmitter { element, typeArgumentNodes, ctxElement, - makeMap(ctxTypes), // don't inherit + uniqueMap(ctxTypes), // don't inherit node, reportMode ); @@ -311,7 +311,7 @@ export class Resolver extends DiagnosticEmitter { typeParameterNodes, typeArgumentNodes, ctxElement, - ctxTypes = makeMap(ctxTypes), // inherit + ctxTypes = uniqueMap(ctxTypes), // inherit node, reportMode ); @@ -666,7 +666,7 @@ export class Resolver extends DiagnosticEmitter { /** Contextual element. */ ctxElement: Element, /** Contextual types, i.e. `T`. */ - ctxTypes: Map = makeMap(), + ctxTypes: Map = uniqueMap(), /** Alternative report node in case of empty type arguments. */ alternativeReportNode: Node | null = null, /** How to proceed with eventual diagnostics. */ @@ -742,7 +742,7 @@ export class Resolver extends DiagnosticEmitter { prototype, typeArguments, ctxFlow.actualFunction, - makeMap(ctxFlow.contextualTypeArguments), // don't inherit + uniqueMap(ctxFlow.contextualTypeArguments), // don't inherit node, reportMode ); @@ -750,7 +750,7 @@ export class Resolver extends DiagnosticEmitter { // infer generic call if type arguments have been omitted if (prototype.is(CommonFlags.GENERIC)) { - let contextualTypeArguments = makeMap(ctxFlow.contextualTypeArguments); + let contextualTypeArguments = uniqueMap(ctxFlow.contextualTypeArguments); // fill up contextual types with auto for each generic component let typeParameterNodes = assert(prototype.typeParameterNodes); @@ -810,13 +810,13 @@ export class Resolver extends DiagnosticEmitter { return this.resolveFunction( prototype, resolvedTypeArguments, - makeMap(ctxFlow.contextualTypeArguments), + uniqueMap(ctxFlow.contextualTypeArguments), reportMode ); } // otherwise resolve the non-generic call as usual - return this.resolveFunction(prototype, null, makeMap(), reportMode); + return this.resolveFunction(prototype, null, uniqueMap(), reportMode); } /** Updates contextual types with a possibly encapsulated inferred type. */ @@ -1228,7 +1228,7 @@ export class Resolver extends DiagnosticEmitter { var element = this.lookupIdentifierExpression(node, ctxFlow, ctxElement, reportMode); if (!element) return null; if (element.kind == ElementKind.FUNCTION_PROTOTYPE) { - let instance = this.resolveFunction(element, null, makeMap(), reportMode); + let instance = this.resolveFunction(element, null, uniqueMap(), reportMode); if (!instance) return null; element = instance; } @@ -2549,7 +2549,7 @@ export class Resolver extends DiagnosticEmitter { element, node.typeArguments, ctxFlow.actualFunction, - makeMap(ctxFlow.contextualTypeArguments), + uniqueMap(ctxFlow.contextualTypeArguments), node, reportMode ); @@ -2636,7 +2636,7 @@ export class Resolver extends DiagnosticEmitter { /** Type arguments provided. */ typeArguments: Type[] | null, /** Contextual types, i.e. `T`. */ - ctxTypes: Map = makeMap(), + ctxTypes: Map = uniqueMap(), /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Function | null { @@ -2878,7 +2878,7 @@ export class Resolver extends DiagnosticEmitter { /** Type arguments provided. */ typeArguments: Type[] | null, /** Contextual types, i.e. `T`. */ - ctxTypes: Map = makeMap(), + ctxTypes: Map = uniqueMap(), /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Class | null { @@ -2939,7 +2939,7 @@ export class Resolver extends DiagnosticEmitter { basePrototype, extendsNode.typeArguments, prototype.parent, // relative to derived class - makeMap(ctxTypes), // don't inherit + uniqueMap(ctxTypes), // don't inherit extendsNode, reportMode ); @@ -2975,7 +2975,7 @@ export class Resolver extends DiagnosticEmitter { interfacePrototype, implementsNode.typeArguments, prototype.parent, - makeMap(ctxTypes), + uniqueMap(ctxTypes), implementsNode, reportMode ); @@ -3214,14 +3214,14 @@ export class Resolver extends DiagnosticEmitter { operatorInstance = this.resolveFunction( boundPrototype, null, - makeMap(), + uniqueMap(), reportMode ); } else { operatorInstance = this.resolveFunction( overloadPrototype, null, - makeMap(), + uniqueMap(), reportMode ); } @@ -3359,7 +3359,7 @@ export class Resolver extends DiagnosticEmitter { let getterInstance = this.resolveFunction( getterPrototype, null, - makeMap(), + uniqueMap(), reportMode ); if (getterInstance) { @@ -3372,7 +3372,7 @@ export class Resolver extends DiagnosticEmitter { let setterInstance = this.resolveFunction( setterPrototype, null, - makeMap(), + uniqueMap(), reportMode ); if (setterInstance) { diff --git a/src/tokenizer.ts b/src/tokenizer.ts index d37bb36a7d..0aba7e66aa 100644 --- a/src/tokenizer.ts +++ b/src/tokenizer.ts @@ -399,15 +399,26 @@ export function operatorTokenToString(token: Token): string { export class Range { - source: Source; + private _source: Source | null; start: i32; end: i32; debugInfoRef: usize = 0; - constructor(source: Source, start: i32, end: i32) { - this.source = source; + constructor(source: Source | null, start: i32, end: i32) { this.start = start; this.end = end; + this._source = source; + } + + /** Gets the corresponding source. */ + get source(): Source { + return assert(this._source); + } + + /** Sets the corresponding source. */ + set source(source: Source) { + assert(!this._source); + this._source = source; } static join(a: Range, b: Range): Range { diff --git a/src/types.ts b/src/types.ts index 173aea04e2..fad02f6c24 100644 --- a/src/types.ts +++ b/src/types.ts @@ -114,9 +114,9 @@ export class Type { /** Underlying signature reference, if a function type. */ signatureReference: Signature | null; /** Respective non-nullable type, if nullable. */ - nonNullableType: Type; - /** Cached nullable type, if non-nullable. */ - private cachedNullableType: Type | null = null; + private _nonNullableType: Type | null = null; + /** Respective nullable type, if non-nullable. */ + private _nullableType: Type | null = null; /** Constructs a new resolved type. */ constructor(kind: TypeKind, flags: TypeFlags, size: u32) { @@ -126,7 +126,11 @@ export class Type { this.byteSize = ceil(size / 8); this.classReference = null; this.signatureReference = null; - this.nonNullableType = this; + if (!(flags & TypeFlags.NULLABLE)) { + this._nonNullableType = this; + } else { + this._nullableType = this; + } } /** Returns the closest int type representing this type. */ @@ -177,6 +181,16 @@ export class Type { return classReference !== null && classReference.hasDecorator(DecoratorFlags.UNMANAGED); } + /** Gets the corresponding non-nullable type. */ + get nonNullableType(): Type { + return assert(this._nonNullableType); // set either in ctor or asNullable + } + + /** Gets the corresponding nullable type, if applicable. */ + get nullableType(): Type | null { + return this._nullableType; // set either in ctor or asNullable + } + /** Computes the sign-extending shift in the target type. */ computeSmallIntegerShift(targetType: Type): i32 { return targetType.size - this.size; @@ -212,15 +226,15 @@ export class Type { /** Composes the respective nullable type of this type. */ asNullable(): Type { assert(this.is(TypeFlags.REFERENCE)); - var cachedNullableType = this.cachedNullableType; - if (!cachedNullableType) { + var nullableType = this._nullableType; + if (!nullableType) { assert(!this.is(TypeFlags.NULLABLE)); - this.cachedNullableType = cachedNullableType = new Type(this.kind, this.flags | TypeFlags.NULLABLE, this.size); - cachedNullableType.nonNullableType = this; - cachedNullableType.classReference = this.classReference; // either a class reference - cachedNullableType.signatureReference = this.signatureReference; // or a function reference + this._nullableType = nullableType = new Type(this.kind, this.flags | TypeFlags.NULLABLE, this.size); + nullableType.classReference = this.classReference; // either a class reference + nullableType.signatureReference = this.signatureReference; // or a function reference + nullableType._nonNullableType = this; } - return cachedNullableType; + return nullableType; } /** Tests if this type equals the specified. */ @@ -555,7 +569,7 @@ export class Signature { /** Cached {@link FunctionTarget}. */ cachedFunctionTarget: FunctionTarget | null = null; /** Respective function type. */ - type: Type; + private _type: Type | null; /** The program that created this signature. */ program: Program; @@ -573,7 +587,7 @@ export class Signature { this.thisType = thisType; this.program = program; this.hasRest = false; - this.type = program.options.usizeType.asFunction(this); + this._type = program.options.usizeType.asFunction(this); var signatureTypes = program.uniqueSignatures; var length = signatureTypes.length; @@ -588,6 +602,11 @@ export class Signature { program.uniqueSignatures.push(this); } + /** Gets the respective function type matching this signature. */ + get type(): Type { + return assert(this._type); + } + get nativeParams(): NativeType { var thisType = this.thisType; var parameterTypes = this.parameterTypes; diff --git a/src/util/collections.ts b/src/util/collections.ts index fc84409560..8736666238 100644 --- a/src/util/collections.ts +++ b/src/util/collections.ts @@ -3,30 +3,8 @@ * @license Apache-2.0 */ -export function makeArray(original: Array | null = null): Array { - if (original) { - let len = original.length; - let cloned = new Array(len); - for (let i = 0; i < len; ++i) unchecked(cloned[i] = original[i]); - return cloned; - } - return new Array(); -} - -export function makeSet(original: Set | null = null): Set { - if (original) { - let cloned = new Set(); - // TODO: for (let v of original) { - for (let _values = Set_values(original), i = 0, k = _values.length; i < k; ++i) { - let v = unchecked(_values[i]); - cloned.add(v); - } - return cloned; - } - return new Set(); -} - -export function makeMap(original: Map | null = null, overrides: Map | null = null): Map { +/** Makes a unique map. Typically used to track contextual type arguemnts. */ +export function uniqueMap(original: Map | null = null, overrides: Map | null = null): Map { var cloned = new Map(); if (original) { // TODO: for (let [k, v] of original) { diff --git a/tests/compiler/extends-baseaggregate.ts b/tests/compiler/extends-baseaggregate.ts index dfc2522675..b5f3e0b506 100644 --- a/tests/compiler/extends-baseaggregate.ts +++ b/tests/compiler/extends-baseaggregate.ts @@ -1,7 +1,7 @@ class A1 { private padding0: f64; private padding1: f64; - private c1: C1; + private c1: C1 | null; } class A2 extends A1 { } diff --git a/tests/compiler/field-initialization-errors.json b/tests/compiler/field-initialization-errors.json new file mode 100644 index 0000000000..f4dcc1ced1 --- /dev/null +++ b/tests/compiler/field-initialization-errors.json @@ -0,0 +1,19 @@ +{ + "asc_flags": [ + "--runtime none" + ], + "stderr": [ + "TS2564: Property 'field-initialization-errors/Ref.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Ref_Ctor.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Ref_Ctor_Branch.a' has no initializer", + "TS2565: Property 'field-initialization-errors/Ref_Ctor_Use_Init.a' is used before being assigned.", + "TS2564: Property 'field-initialization-errors/Ref_Ctor_Call_Init.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Ref_Ctor_Prop_Init.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Ref_Ctor_Callwith_Init.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Ref_Ctor_Alias_Init.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Ref_Ctor_Assign_Init.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Ref_Ctor_Icallwith_Init.a' has no initializer", + "TS2564: Property 'field-initialization-errors/Inherit_Base.a' has no initializer", + "EOF" + ] +} \ No newline at end of file diff --git a/tests/compiler/field-initialization-errors.ts b/tests/compiler/field-initialization-errors.ts new file mode 100644 index 0000000000..3281ac317f --- /dev/null +++ b/tests/compiler/field-initialization-errors.ts @@ -0,0 +1,133 @@ +// Uninitialized without ctor +class Ref { + a: ArrayBuffer; // TS2564 +} +{ + new Ref(); +} + +// Uninitialized with ctor +class Ref_Ctor { + a: ArrayBuffer; // TS2564 + constructor() { + } +} +{ + new Ref_Ctor(); +} + +// Uninitialized in any branch +class Ref_Ctor_Branch { + a: ArrayBuffer; // TS2564 + constructor(cond: bool) { + if (cond) { + this.a = new ArrayBuffer(0); + } else { + // uninitialized + } + } +} +{ + new Ref_Ctor_Branch(true); +} + +// Access before initialize +class Ref_Ctor_Use_Init { + a: ArrayBuffer; + constructor() { + this.a; // TS2565 + this.a = new ArrayBuffer(0); + } +} +{ + new Ref_Ctor_Use_Init(); +} + +// Call before initialize +class Ref_Ctor_Call_Init { + a: ArrayBuffer; + constructor() { + this.foo(); + this.a = new ArrayBuffer(0); + } + foo(): void {} +} +{ + new Ref_Ctor_Call_Init(); +} + +// Property (call) before initialize +class Ref_Ctor_Prop_Init { + a: ArrayBuffer; + constructor() { + this.foo; + this.a = new ArrayBuffer(0); + } + get foo(): i32 { return 1; } +} +{ + new Ref_Ctor_Prop_Init(); +} + +// Called with before initialize +class Ref_Ctor_Callwith_Init { + a: ArrayBuffer; + constructor() { + Ref_Ctor_Callwith_Init.foo(this); + this.a = new ArrayBuffer(0); + } + static foo(o: Ref_Ctor_Callwith_Init): void {} +} +{ + new Ref_Ctor_Callwith_Init(); +} + +// Aliase before initialize +class Ref_Ctor_Alias_Init { + a: ArrayBuffer; + constructor() { + var b = this; + this.a = new ArrayBuffer(0); + } +} +{ + new Ref_Ctor_Alias_Init(); +} + +// Assignment before initialize +class Ref_Ctor_Assign_Init { + a: ArrayBuffer; + constructor() { + var b: this; + b = this; + this.a = new ArrayBuffer(0); + } +} +{ + new Ref_Ctor_Assign_Init(); +} + +// Indirectly called with before initialize +class Ref_Ctor_Icallwith_Init { + a: ArrayBuffer; + constructor() { + Ref_Ctor_Icallwith_Init_fn(this); + this.a = new ArrayBuffer(0); + } +} +var Ref_Ctor_Icallwith_Init_fn = (o: Ref_Ctor_Icallwith_Init): void => {}; +{ + new Ref_Ctor_Icallwith_Init(); +} + +// Uninitialized inherited +class Inherit_Base { + a: ArrayBuffer; // TS2564 +} +class Inherit extends Inherit_Base { +} +{ + new Inherit(); +} + +ERROR("EOF"); diff --git a/tests/compiler/field-initialization.json b/tests/compiler/field-initialization.json new file mode 100644 index 0000000000..b1da366ff4 --- /dev/null +++ b/tests/compiler/field-initialization.json @@ -0,0 +1,5 @@ +{ + "asc_flags": [ + "--runtime none" + ] +} \ No newline at end of file diff --git a/tests/compiler/field-initialization.optimized.wat b/tests/compiler/field-initialization.optimized.wat new file mode 100644 index 0000000000..ee291242ee --- /dev/null +++ b/tests/compiler/field-initialization.optimized.wat @@ -0,0 +1,451 @@ +(module + (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 1024) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00f\00i\00e\00l\00d\00-\00i\00n\00i\00t\00i\00a\00l\00i\00z\00a\00t\00i\00o\00n\00.\00t\00s") + (data (i32.const 1088) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") + (data (i32.const 1136) "&\00\00\00\01\00\00\00\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") + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (start $~start) + (func $~lib/rt/stub/__alloc (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 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.tee $4 + local.get $0 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $2 + i32.const 16 + local.get $2 + i32.const 16 + i32.gt_u + select + local.tee $6 + i32.add + local.tee $2 + memory.size + local.tee $5 + i32.const 16 + i32.shl + local.tee $3 + i32.gt_u + if + local.get $5 + local.get $2 + local.get $3 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.tee $3 + local.get $5 + local.get $3 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $2 + global.set $~lib/rt/stub/offset + local.get $4 + i32.const 16 + i32.sub + local.tee $2 + local.get $6 + i32.store + local.get $2 + i32.const 1 + i32.store offset=4 + local.get $2 + local.get $1 + i32.store offset=8 + local.get $2 + local.get $0 + i32.store offset=12 + local.get $4 + ) + (func $field-initialization/Inherit_Base#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 18 + call $~lib/rt/stub/__alloc + local.set $0 + end + local.get $0 + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + i32.store + local.get $0 + ) + (func $start:field-initialization + (local $0 i32) + (local $1 i32) + i32.const 1200 + global.set $~lib/rt/stub/offset + i32.const 4 + i32.const 3 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 1 + i32.store + local.get $0 + i32.load + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 1040 + i32.const 8 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.load + if + i32.const 0 + i32.const 1040 + i32.const 16 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 5 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + i32.store + local.get $0 + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 24 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 6 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + i32.store + local.get $0 + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 32 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 7 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.load + if + i32.const 0 + i32.const 1040 + i32.const 40 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 8 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.load + if + i32.const 0 + i32.const 1040 + i32.const 52 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 9 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 1 + i32.store + local.get $0 + i32.load + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 1040 + i32.const 62 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 10 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 1 + i32.store + local.get $0 + i32.load + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 1040 + i32.const 73 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 11 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + i32.store + local.get $0 + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 83 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 12 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $1 + local.get $0 + i32.load + drop + local.get $0 + local.get $1 + i32.store + local.get $0 + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 94 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $0 + i32.const 4 + i32.const 13 + call $~lib/rt/stub/__alloc + local.tee $1 + local.get $0 + i32.store + local.get $0 + local.get $1 + i32.load + i32.ne + if + i32.const 0 + i32.const 1040 + i32.const 104 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 14 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.load + if + i32.const 0 + i32.const 1040 + i32.const 114 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 15 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + i32.store + local.get $0 + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 124 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 16 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $1 + local.get $0 + i32.load + drop + local.get $0 + local.get $1 + i32.store + local.get $0 + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 135 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 17 + call $~lib/rt/stub/__alloc + call $field-initialization/Inherit_Base#constructor + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 147 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 19 + call $~lib/rt/stub/__alloc + call $field-initialization/Inherit_Base#constructor + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 153 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 4 + i32.const 20 + call $~lib/rt/stub/__alloc + local.tee $0 + i32.const 0 + i32.store + i32.const 0 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $1 + local.get $0 + i32.load + drop + local.get $0 + local.get $1 + i32.store + local.get $0 + i32.load + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 170 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + ) + (func $~start + call $start:field-initialization + ) +) diff --git a/tests/compiler/field-initialization.ts b/tests/compiler/field-initialization.ts new file mode 100644 index 0000000000..ba3afd0145 --- /dev/null +++ b/tests/compiler/field-initialization.ts @@ -0,0 +1,171 @@ +// without constructor + +class Value_Init { + a: i32 = 1; // OK +} +{ + let o = new Value_Init(); + assert(o.a == 1); +} + +class Value { + a: i32; // OK (zeroed) +} +{ + let o = new Value(); + assert(o.a == 0); +} + +class Ref_Init { + a: ArrayBuffer = new ArrayBuffer(0); // OK +} +{ + let o = new Ref_Init(); + assert(o.a != null); +} + +class Nullable_Init { + a: ArrayBuffer | null = new ArrayBuffer(0); // OK +} +{ + let o = new Nullable_Init(); + assert(o.a != null); +} + +class Nullable { + a: ArrayBuffer | null; // OK (zeroed) +} +{ + let o = new Nullable(); + assert(o.a == null); +} + +// with constructor + +class Value_Ctor { + a: i32; // OK (zeroed) + constructor() { + } +} +{ + let o = new Value_Ctor(); + assert(o.a == 0); +} + +class Value_Init_Ctor { + a: i32 = 1; // OK + constructor() { + } +} +{ + let o = new Value_Init_Ctor(); + assert(o.a == 1); +} + +class Value_Ctor_Init { + a: i32; // OK (zeroed) + constructor() { + this.a = 1; + } +} +{ + let o = new Value_Ctor_Init(); + assert(o.a == 1); +} + +class Ref_Init_Ctor { + a: ArrayBuffer = new ArrayBuffer(0); // OK + constructor() { + } +} +{ + let o = new Ref_Init_Ctor(); + assert(o.a != null); +} + +class Ref_Ctor_Init { + a: ArrayBuffer; // OK (in ctor) + constructor() { + this.a = new ArrayBuffer(0); + } +} +{ + let o = new Ref_Ctor_Init(); + assert(o.a != null); +} + +class Ref_Ctor_Param { + constructor(public a: ArrayBuffer) { // OK + } +} +{ + let a = new ArrayBuffer(0); + let o = new Ref_Ctor_Param(a); + assert(o.a == a); +} + +class Nullable_Ctor { + a: ArrayBuffer | null; // OK (zeroed) + constructor() { + } +} +{ + let o = new Nullable_Ctor(); + assert(o.a == null); +} + +class Nullable_Init_Ctor { + a: ArrayBuffer | null = new ArrayBuffer(0); // OK + constructor() { + } +} +{ + let o = new Nullable_Init_Ctor(); + assert(o.a != null); +} + +class Nullable_Ctor_Init { + a: ArrayBuffer | null; // OK (zeroed) + constructor() { + this.a = new ArrayBuffer(0); + } +} +{ + let o = new Nullable_Ctor_Init(); + assert(o.a != null); +} + +// inheritance + +class Inherit_Base { + a: ArrayBuffer = new ArrayBuffer(0); +} +class Inherit extends Inherit_Base { +} +{ + let o = new Inherit(); + assert(o.a != null); +} +class Inherit_Ctor extends Inherit_Base { +} +{ + let o = new Inherit_Ctor(); + assert(o.a != null); +} + +// flow sanity + +class Flow_Balanced { + a: ArrayBuffer; // OK (any branch) + constructor(cond: bool) { + if (cond) { + this.a = new ArrayBuffer(0); + } else { + this.a = new ArrayBuffer(0); + } + } +} +{ + let o = new Flow_Balanced(true); + assert(o.a != null); +} diff --git a/tests/compiler/field-initialization.untouched.wat b/tests/compiler/field-initialization.untouched.wat new file mode 100644 index 0000000000..dc80b6a510 --- /dev/null +++ b/tests/compiler/field-initialization.untouched.wat @@ -0,0 +1,1051 @@ +(module + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (memory $0 1) + (data (i32.const 16) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00f\00i\00e\00l\00d\00-\00i\00n\00i\00t\00i\00a\00l\00i\00z\00a\00t\00i\00o\00n\00.\00t\00s\00") + (data (i32.const 80) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") + (data (i32.const 128) "&\00\00\00\01\00\00\00\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") + (table $0 1 funcref) + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 184)) + (export "memory" (memory $0)) + (start $~start) + (func $~lib/rt/stub/maybeGrowMemory (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + memory.size + local.set $1 + local.get $1 + i32.const 16 + i32.shl + local.set $2 + local.get $0 + local.get $2 + i32.gt_u + if + local.get $0 + 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 $3 + local.get $1 + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.set $4 + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $3 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + local.get $0 + global.set $~lib/rt/stub/offset + ) + (func $~lib/rt/stub/__alloc (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 + i32.const 1073741808 + i32.gt_u + if + unreachable + end + global.get $~lib/rt/stub/offset + i32.const 16 + i32.add + local.set $2 + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $3 + i32.const 16 + local.tee $4 + local.get $3 + local.get $4 + i32.gt_u + select + local.set $5 + local.get $2 + local.get $5 + i32.add + call $~lib/rt/stub/maybeGrowMemory + local.get $2 + i32.const 16 + i32.sub + local.set $6 + local.get $6 + local.get $5 + i32.store + i32.const 1 + drop + local.get $6 + i32.const 1 + i32.store offset=4 + local.get $6 + local.get $1 + i32.store offset=8 + local.get $6 + local.get $0 + i32.store offset=12 + local.get $2 + ) + (func $~lib/rt/stub/__retain (param $0 i32) (result i32) + local.get $0 + ) + (func $field-initialization/Value_Init#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 3 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 1 + i32.store + local.get $0 + ) + (func $~lib/rt/stub/__release (param $0 i32) + nop + ) + (func $field-initialization/Value#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 4 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $~lib/memory/memory.fill (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 i32) + (local $9 i64) + (local $10 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + i32.const 0 + i32.const 1 + i32.gt_s + drop + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $3 + i32.add + i32.const 4 + i32.sub + local.set $6 + local.get $5 + local.get $4 + i32.store8 + local.get $6 + local.get $4 + i32.store8 offset=3 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 offset=1 + local.get $5 + local.get $4 + i32.store8 offset=2 + local.get $6 + local.get $4 + i32.store8 offset=2 + local.get $6 + local.get $4 + i32.store8 offset=1 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 offset=3 + local.get $6 + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $7 + local.get $5 + local.get $7 + i32.add + local.set $5 + local.get $3 + local.get $7 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $8 + local.get $5 + local.get $3 + i32.add + i32.const 28 + i32.sub + local.set $6 + local.get $5 + local.get $8 + i32.store + local.get $6 + local.get $8 + i32.store offset=24 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $8 + i32.store offset=4 + local.get $5 + local.get $8 + i32.store offset=8 + local.get $6 + local.get $8 + i32.store offset=16 + local.get $6 + local.get $8 + i32.store offset=20 + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $8 + i32.store offset=12 + local.get $5 + local.get $8 + i32.store offset=16 + local.get $5 + local.get $8 + i32.store offset=20 + local.get $5 + local.get $8 + i32.store offset=24 + local.get $6 + local.get $8 + i32.store + local.get $6 + local.get $8 + i32.store offset=4 + local.get $6 + local.get $8 + i32.store offset=8 + local.get $6 + local.get $8 + i32.store offset=12 + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $7 + local.get $5 + local.get $7 + i32.add + local.set $5 + local.get $3 + local.get $7 + i32.sub + local.set $3 + local.get $8 + i64.extend_i32_u + local.get $8 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $9 + loop $while-continue|0 + local.get $3 + i32.const 32 + i32.ge_u + local.set $10 + local.get $10 + if + local.get $5 + local.get $9 + i64.store + local.get $5 + local.get $9 + i64.store offset=8 + local.get $5 + local.get $9 + i64.store offset=16 + local.get $5 + local.get $9 + i64.store offset=24 + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $while-continue|0 + end + end + end + ) + (func $~lib/arraybuffer/ArrayBuffer#constructor (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + i32.const 1073741808 + i32.gt_u + if + i32.const 96 + i32.const 144 + i32.const 49 + i32.const 43 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 0 + call $~lib/rt/stub/__alloc + local.set $2 + local.get $2 + i32.const 0 + local.get $1 + call $~lib/memory/memory.fill + local.get $2 + call $~lib/rt/stub/__retain + local.set $3 + local.get $0 + call $~lib/rt/stub/__release + local.get $3 + ) + (func $field-initialization/Ref_Init#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 5 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + i32.store + local.get $0 + ) + (func $field-initialization/Nullable_Init#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 6 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + i32.store + local.get $0 + ) + (func $field-initialization/Nullable#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 7 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $field-initialization/Value_Ctor#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 8 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $field-initialization/Value_Init_Ctor#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 9 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 1 + i32.store + local.get $0 + ) + (func $field-initialization/Value_Ctor_Init#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 10 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 1 + i32.store + local.get $0 + ) + (func $field-initialization/Ref_Init_Ctor#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 11 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + i32.store + local.get $0 + ) + (func $field-initialization/Ref_Ctor_Init#constructor (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 12 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + local.tee $1 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/stub/__release + local.get $2 + i32.store + local.get $0 + ) + (func $field-initialization/Ref_Ctor_Param#constructor (param $0 i32) (param $1 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 13 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + local.get $1 + call $~lib/rt/stub/__retain + i32.store + local.get $1 + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + ) + (func $field-initialization/Nullable_Ctor#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 14 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + ) + (func $field-initialization/Nullable_Init_Ctor#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 15 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + i32.store + local.get $0 + ) + (func $field-initialization/Nullable_Ctor_Init#constructor (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 16 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $0 + local.tee $1 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $1 + i32.load + call $~lib/rt/stub/__release + local.get $2 + i32.store + local.get $0 + ) + (func $field-initialization/Inherit_Base#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 18 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + i32.store + local.get $0 + ) + (func $field-initialization/Inherit#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 17 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + call $field-initialization/Inherit_Base#constructor + local.set $0 + local.get $0 + ) + (func $field-initialization/Inherit_Ctor#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 19 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + call $field-initialization/Inherit_Base#constructor + local.set $0 + local.get $0 + ) + (func $field-initialization/Flow_Balanced#constructor (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.eqz + if + i32.const 4 + i32.const 20 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + i32.const 0 + i32.store + local.get $1 + if + local.get $0 + local.tee $2 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $3 + local.get $2 + i32.load + call $~lib/rt/stub/__release + local.get $3 + i32.store + else + local.get $0 + local.tee $3 + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $2 + local.get $3 + i32.load + call $~lib/rt/stub/__release + local.get $2 + i32.store + end + local.get $0 + ) + (func $start:field-initialization + (local $0 i32) + (local $1 i32) + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + global.set $~lib/rt/stub/startOffset + global.get $~lib/rt/stub/startOffset + global.set $~lib/rt/stub/offset + i32.const 0 + call $field-initialization/Value_Init#constructor + local.set $0 + local.get $0 + i32.load + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 8 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Value#constructor + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 16 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Ref_Init#constructor + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 24 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Nullable_Init#constructor + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 32 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Nullable#constructor + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 40 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Value_Ctor#constructor + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 52 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Value_Init_Ctor#constructor + local.set $0 + local.get $0 + i32.load + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 62 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Value_Ctor_Init#constructor + local.set $0 + local.get $0 + i32.load + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 73 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Ref_Init_Ctor#constructor + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 83 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Ref_Ctor_Init#constructor + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 94 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + i32.const 0 + i32.const 0 + call $~lib/arraybuffer/ArrayBuffer#constructor + local.set $0 + i32.const 0 + local.get $0 + call $field-initialization/Ref_Ctor_Param#constructor + local.set $1 + local.get $1 + i32.load + local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 104 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Nullable_Ctor#constructor + local.set $1 + local.get $1 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 114 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Nullable_Init_Ctor#constructor + local.set $1 + local.get $1 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 124 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Nullable_Ctor_Init#constructor + local.set $1 + local.get $1 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 135 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Inherit#constructor + local.set $1 + local.get $1 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 147 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/Inherit_Ctor#constructor + local.set $1 + local.get $1 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 153 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/stub/__release + i32.const 0 + i32.const 1 + call $field-initialization/Flow_Balanced#constructor + local.set $1 + local.get $1 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 170 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/stub/__release + ) + (func $~start + call $start:field-initialization + ) +) diff --git a/tests/compiler/retain-release-sanity.ts b/tests/compiler/retain-release-sanity.ts index b46f26d95b..413cad7f52 100644 --- a/tests/compiler/retain-release-sanity.ts +++ b/tests/compiler/retain-release-sanity.ts @@ -21,10 +21,10 @@ } class A { - b: B; + b: B | null; } class B { - a: A; + a: A | null; } { diff --git a/tests/compiler/retain-release.ts b/tests/compiler/retain-release.ts index d6e9d930f3..70868e28a5 100644 --- a/tests/compiler/retain-release.ts +++ b/tests/compiler/retain-release.ts @@ -115,7 +115,7 @@ export function assignGlobal(): void { glo = /* __retainRelease( */ REF /* , glo) */; } -class Target { fld: Ref; } +class Target { fld: Ref | null; } var TARGET = new Target(); diff --git a/tests/compiler/rt/finalize.ts b/tests/compiler/rt/finalize.ts index d9a0ada7a2..2c0568d125 100644 --- a/tests/compiler/rt/finalize.ts +++ b/tests/compiler/rt/finalize.ts @@ -31,10 +31,10 @@ assert(expectedReadIndex == expectedWriteIndex); // Cyclic test with locals becoming deferred until collected class Foo { - bar: Bar; + bar: Bar | null; } class Bar { - foo: Foo; + foo: Foo | null; } function testCyclic(): void { From 1defee7d35de64d9783115ff5a074db48b25fa8f Mon Sep 17 00:00:00 2001 From: dcode Date: Mon, 22 Jun 2020 22:32:20 +0200 Subject: [PATCH 2/8] exclude object literals --- src/builtins.ts | 4 +++- src/compiler.ts | 59 ++++++++++++++++++++++++++----------------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/builtins.ts b/src/builtins.ts index 37d0e73b3b..6b874ebc37 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -2894,7 +2894,9 @@ function builtin_instantiate(ctx: BuiltinContext): ExpressionRef { return module.unreachable(); } compiler.currentType = classInstance.type; - return compiler.compileInstantiate(classInstance, operands, Constraints.NONE, ctx.reportNode); + var ctor = compiler.ensureConstructor(classInstance, ctx.reportNode); + compiler.checkFieldInitialization(classInstance, ctx.reportNode); + return compiler.compileInstantiate(ctor, operands, Constraints.NONE, ctx.reportNode); } builtins.set(BuiltinNames.instantiate, builtin_instantiate); diff --git a/src/compiler.ts b/src/compiler.ts index bd4789e467..d9bb876fe7 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -1666,6 +1666,8 @@ export class Compiler extends DiagnosticEmitter { } } this.ensureConstructor(instance, instance.identifierNode); + this.checkFieldInitialization(instance); + var instanceMembers = instance.members; if (instanceMembers) { // TODO: for (let element of instanceMembers.values()) { @@ -6618,8 +6620,10 @@ export class Compiler extends DiagnosticEmitter { let thisLocal = assert(flow.lookupLocal(CommonNames.this_)); let nativeSizeType = this.options.nativeSizeType; + let baseCtorInstance = this.ensureConstructor(baseClassInstance, expression); + this.checkFieldInitialization(baseClassInstance, expression); let superCall = this.compileCallDirect( - this.ensureConstructor(baseClassInstance, expression), + baseCtorInstance, expression.args, expression, module.local_get(thisLocal.index, nativeSizeType), @@ -7941,19 +7945,6 @@ export class Compiler extends DiagnosticEmitter { return this.module.unreachable(); } - // handle call with `this` in constructors - let actualFunction = this.currentFlow.actualFunction; - if (actualFunction.is(CommonFlags.CONSTRUCTOR)) { - let parent = actualFunction.parent; - assert(parent.kind == ElementKind.CLASS); - for (let i = 0, k = argumentExpressions.length; i < k; ++i) { - if (argumentExpressions[i].kind == NodeKind.THIS) { - this.checkFieldInitialization(parent, argumentExpressions[i]); - break; - } - } - } - var numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments; var operands = new Array(numArgumentsInclThis); var index = 0; @@ -9211,11 +9202,10 @@ export class Compiler extends DiagnosticEmitter { let fieldType = fieldInstance.type; if (fieldInstance.initializerNode) { - continue; // set by default ctor + continue; // set by generated ctor } if (fieldType.is(TypeFlags.REFERENCE) && fieldType.classReference !== null) { - // TODO: Check if it is a class, with a default value (constructor with no params). if (!fieldType.is(TypeFlags.NULLABLE)) { this.error( DiagnosticCode.Property_0_is_missing_in_type_1_but_required_in_type_2, @@ -9263,10 +9253,15 @@ export class Compiler extends DiagnosticEmitter { } if (hasErrors) return module.unreachable(); + // generate the default constructor + var ctor = this.ensureConstructor(classReference, expression); + // note that this is not checking field initialization within the ctor, but + // instead checks conditions above with provided fields taken into account. + // allocate a new instance first and assign 'this' to the temp. local exprs.unshift( module.local_set(tempLocal.index, - this.compileInstantiate(classReference, [], Constraints.WILL_RETAIN, expression) + this.compileInstantiate(ctor, [], Constraints.WILL_RETAIN, expression) ) ); @@ -9330,11 +9325,18 @@ export class Compiler extends DiagnosticEmitter { } if (!classInstance) return module.unreachable(); if (contextualType == Type.void) constraints |= Constraints.WILL_DROP; - return this.compileInstantiate(classInstance, expression.args, constraints, expression); + var ctor = this.ensureConstructor(classInstance, expression); + this.checkFieldInitialization(classInstance, expression); + return this.compileInstantiate(ctor, expression.args, constraints, expression); } /** Gets the compiled constructor of the specified class or generates one if none is present. */ - ensureConstructor(classInstance: Class, reportNode: Node): Function { + ensureConstructor( + /** Class wanting a constructor. */ + classInstance: Class, + /** Report node. */ + reportNode: Node + ): Function { var instance = classInstance.constructorInstance; if (instance) { // shortcut if already compiled @@ -9347,6 +9349,7 @@ export class Compiler extends DiagnosticEmitter { let contextualTypeArguments = uniqueMap(classInstance.contextualTypeArguments); if (baseClass) { let baseCtor = this.ensureConstructor(baseClass, reportNode); + this.checkFieldInitialization(baseClass, reportNode); instance = new Function( CommonNames.constructor, new FunctionPrototype( @@ -9443,14 +9446,11 @@ export class Compiler extends DiagnosticEmitter { instance.finalize(module, funcRef); } - // check that fields are initialized when returning - this.checkFieldInitialization(classInstance); - return instance; } /** Checks that all class fields have been initialized. */ - private checkFieldInitialization(classInstance: Class, relatedNode: Node | null = null): void { + checkFieldInitialization(classInstance: Class, relatedNode: Node | null = null): void { var members = classInstance.members; if (members) { let ctor = assert(classInstance.constructorInstance); @@ -9484,8 +9484,8 @@ export class Compiler extends DiagnosticEmitter { } compileInstantiate( - /** Class to instantiate. */ - classInstance: Class, + /** Constructor to call. */ + ctorInstance: Function, /** Constructor arguments. */ argumentExpressions: Expression[], /** Contextual flags. */ @@ -9493,10 +9493,13 @@ export class Compiler extends DiagnosticEmitter { /** Node to report on. */ reportNode: Node ): ExpressionRef { - var ctor = this.ensureConstructor(classInstance, reportNode); - if (classInstance.type.isUnmanaged || ctor.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(reportNode); + assert(ctorInstance.is(CommonFlags.CONSTRUCTOR)); + var parent = ctorInstance.parent; + assert(parent.kind == ElementKind.CLASS); + var classInstance = parent; + if (classInstance.type.isUnmanaged || ctorInstance.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(reportNode); var expr = this.compileCallDirect( // no need for another autoreleased local - ctor, + ctorInstance, argumentExpressions, reportNode, this.makeZero(this.options.usizeType), From 901c02bb40abeb0305cefaf83d2b554042d5303e Mon Sep 17 00:00:00 2001 From: dcode Date: Mon, 22 Jun 2020 22:41:39 +0200 Subject: [PATCH 3/8] related object literal tests --- .../field-initialization.optimized.wat | 383 +++++++++++- tests/compiler/field-initialization.ts | 37 +- .../field-initialization.untouched.wat | 549 +++++++++++++++++- 3 files changed, 958 insertions(+), 11 deletions(-) diff --git a/tests/compiler/field-initialization.optimized.wat b/tests/compiler/field-initialization.optimized.wat index ee291242ee..d268a19863 100644 --- a/tests/compiler/field-initialization.optimized.wat +++ b/tests/compiler/field-initialization.optimized.wat @@ -1,13 +1,20 @@ (module - (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 1024) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00f\00i\00e\00l\00d\00-\00i\00n\00i\00t\00i\00a\00l\00i\00z\00a\00t\00i\00o\00n\00.\00t\00s") (data (i32.const 1088) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") (data (i32.const 1136) "&\00\00\00\01\00\00\00\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 1200) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b") + (data (i32.const 1232) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00b") + (data (i32.const 1264) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00c") + (data (i32.const 1296) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00b\00b\00b") + (data (i32.const 1328) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00c\00c") (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (export "memory" (memory $0)) (start $~start) @@ -111,10 +118,154 @@ i32.store local.get $0 ) + (func $field-initialization/SomeObject#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 8 + i32.const 20 + call $~lib/rt/stub/__alloc + 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 + ) + (func $~lib/string/String#get:length (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + local.get $0 + i32.const 7 + i32.and + local.get $1 + i32.const 7 + i32.and + i32.or + i32.eqz + i32.const 0 + local.get $2 + i32.const 4 + i32.ge_u + select + if + loop $do-continue|0 + local.get $0 + i64.load + local.get $1 + i64.load + i64.eq + if + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + local.get $2 + i32.const 4 + i32.sub + local.tee $2 + i32.const 4 + i32.ge_u + br_if $do-continue|0 + end + end + end + loop $while-continue|1 + local.get $2 + local.tee $3 + i32.const 1 + i32.sub + local.set $2 + local.get $3 + if + local.get $0 + i32.load16_u + local.tee $3 + local.get $1 + i32.load16_u + local.tee $4 + i32.ne + if + local.get $3 + local.get $4 + i32.sub + return + end + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + br $while-continue|1 + end + end + i32.const 0 + ) + (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + return + end + block $folding-inner0 + local.get $1 + i32.eqz + i32.const 1 + local.get $0 + select + br_if $folding-inner0 + local.get $0 + call $~lib/string/String#get:length + local.tee $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + br_if $folding-inner0 + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz + return + end + i32.const 0 + ) + (func $field-initialization/SomeOtherObject#constructor (result i32) + (local $0 i32) + i32.const 12 + i32.const 21 + call $~lib/rt/stub/__alloc + call $field-initialization/SomeObject#constructor + local.tee $0 + i32.const 0 + i32.store offset=8 + local.get $0 + ) (func $start:field-initialization (local $0 i32) (local $1 i32) - i32.const 1200 + i32.const 1360 global.set $~lib/rt/stub/offset i32.const 4 i32.const 3 @@ -417,8 +568,230 @@ call $~lib/builtins/abort unreachable end + i32.const 0 + call $field-initialization/SomeObject#constructor + local.tee $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.load + if + i32.const 0 + i32.const 1040 + i32.const 164 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 165 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $field-initialization/SomeObject#constructor + local.tee $0 + i32.const 1 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.load + i32.const 1 + i32.ne + if + i32.const 0 + i32.const 1040 + i32.const 167 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 168 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $field-initialization/SomeObject#constructor + local.tee $0 + i32.const 1216 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.load + if + i32.const 0 + i32.const 1040 + i32.const 170 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 1216 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 171 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $field-initialization/SomeObject#constructor + local.tee $0 + i32.const 2 + i32.store + local.get $0 + i32.const 1248 + i32.store offset=4 + local.get $0 + i32.load + i32.const 2 + i32.ne + if + i32.const 0 + i32.const 1040 + i32.const 173 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 1248 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 174 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + call $field-initialization/SomeOtherObject#constructor + local.tee $0 + i32.const 1280 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.load + if + i32.const 0 + i32.const 1040 + i32.const 182 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 183 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + i32.const 1280 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 184 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + call $field-initialization/SomeOtherObject#constructor + local.tee $0 + i32.const 3 + i32.store + local.get $0 + i32.const 1312 + i32.store offset=4 + local.get $0 + i32.const 1344 + i32.store offset=8 + local.get $0 + i32.load + i32.const 3 + i32.ne + if + i32.const 0 + i32.const 1040 + i32.const 186 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 1312 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 187 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + i32.const 1344 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1040 + i32.const 188 + i32.const 3 + call $~lib/builtins/abort + unreachable + end i32.const 4 - i32.const 20 + i32.const 22 call $~lib/rt/stub/__alloc local.tee $0 i32.const 0 @@ -439,7 +812,7 @@ if i32.const 0 i32.const 1040 - i32.const 170 + i32.const 205 i32.const 3 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/field-initialization.ts b/tests/compiler/field-initialization.ts index ba3afd0145..19f90a57c9 100644 --- a/tests/compiler/field-initialization.ts +++ b/tests/compiler/field-initialization.ts @@ -153,7 +153,42 @@ class Inherit_Ctor extends Inherit_Base { assert(o.a != null); } -// flow sanity +// related object literal cases + +class SomeObject { + a: i32; + b: string | null; +} +{ + let a: SomeObject = {}; // OK + assert(a.a == 0); + assert(a.b == null); + let b: SomeObject = { a: 1 }; // OK + assert(b.a == 1); + assert(b.b == null); + let c: SomeObject = { b: "b" }; // OK + assert(c.a == 0); + assert(c.b == "b"); + let d: SomeObject = { a: 2, b: "bb" }; // OK + assert(d.a == 2); + assert(d.b == "bb"); +} + +class SomeOtherObject extends SomeObject { + c: string; +} +{ + let a: SomeOtherObject = { c: "c" }; // OK + assert(a.a == 0); + assert(a.b == null); + assert(a.c == "c"); + let b: SomeOtherObject = { a: 3, b: "bbb", c: "cc" }; + assert(b.a == 3); + assert(b.b == "bbb"); + assert(b.c == "cc"); +} + +// related flow cases class Flow_Balanced { a: ArrayBuffer; // OK (any branch) diff --git a/tests/compiler/field-initialization.untouched.wat b/tests/compiler/field-initialization.untouched.wat index dc80b6a510..ea917db9da 100644 --- a/tests/compiler/field-initialization.untouched.wat +++ b/tests/compiler/field-initialization.untouched.wat @@ -5,16 +5,22 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 16) ".\00\00\00\01\00\00\00\01\00\00\00.\00\00\00f\00i\00e\00l\00d\00-\00i\00n\00i\00t\00i\00a\00l\00i\00z\00a\00t\00i\00o\00n\00.\00t\00s\00") (data (i32.const 80) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") (data (i32.const 128) "&\00\00\00\01\00\00\00\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 192) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b\00") + (data (i32.const 224) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00b\00") + (data (i32.const 256) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00c\00") + (data (i32.const 288) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00b\00b\00b\00") + (data (i32.const 320) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00c\00c\00") (table $0 1 funcref) (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/heap/__heap_base i32 (i32.const 184)) + (global $~lib/heap/__heap_base i32 (i32.const 340)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/stub/maybeGrowMemory (param $0 i32) @@ -674,6 +680,249 @@ local.set $0 local.get $0 ) + (func $field-initialization/SomeObject#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 8 + i32.const 20 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + 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 + ) + (func $~lib/string/String#get:length (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.sub + i32.load offset=12 + i32.const 1 + i32.shr_u + ) + (func $~lib/util/string/compareImpl (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $0 + local.get $2 + call $~lib/rt/stub/__retain + local.set $2 + local.get $0 + local.get $1 + i32.const 1 + i32.shl + i32.add + local.set $5 + local.get $2 + local.get $3 + i32.const 1 + i32.shl + i32.add + local.set $6 + i32.const 0 + i32.const 2 + i32.lt_s + drop + local.get $4 + i32.const 4 + i32.ge_u + if (result i32) + local.get $5 + i32.const 7 + i32.and + local.get $6 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end + if + block $do-break|0 + loop $do-continue|0 + local.get $5 + i64.load + local.get $6 + i64.load + i64.ne + if + br $do-break|0 + end + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $6 + i32.const 8 + i32.add + local.set $6 + local.get $4 + i32.const 4 + i32.sub + local.set $4 + local.get $4 + i32.const 4 + i32.ge_u + local.set $7 + local.get $7 + br_if $do-continue|0 + end + end + end + loop $while-continue|1 + local.get $4 + local.tee $7 + i32.const 1 + i32.sub + local.set $4 + local.get $7 + local.set $7 + local.get $7 + if + local.get $5 + i32.load16_u + local.set $8 + local.get $6 + i32.load16_u + local.set $9 + local.get $8 + local.get $9 + i32.ne + if + local.get $8 + local.get $9 + i32.sub + local.set $10 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $10 + return + end + local.get $5 + i32.const 2 + i32.add + local.set $5 + local.get $6 + i32.const 2 + i32.add + local.set $6 + br $while-continue|1 + end + end + i32.const 0 + local.set $7 + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $7 + ) + (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $0 + local.get $1 + call $~lib/rt/stub/__retain + local.set $1 + local.get $0 + local.get $1 + i32.eq + if + i32.const 1 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + return + end + local.get $0 + i32.const 0 + i32.eq + if (result i32) + i32.const 1 + else + local.get $1 + i32.const 0 + i32.eq + end + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $3 + local.get $1 + call $~lib/string/String#get:length + i32.ne + if + i32.const 0 + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + return + end + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $3 + call $~lib/util/string/compareImpl + i32.eqz + local.set $2 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + ) + (func $field-initialization/SomeOtherObject#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 12 + i32.const 21 + call $~lib/rt/stub/__alloc + call $~lib/rt/stub/__retain + local.set $0 + end + local.get $0 + call $field-initialization/SomeObject#constructor + local.set $0 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + ) (func $field-initialization/Flow_Balanced#constructor (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -681,7 +930,7 @@ i32.eqz if i32.const 4 - i32.const 20 + i32.const 22 call $~lib/rt/stub/__alloc call $~lib/rt/stub/__retain local.set $0 @@ -720,6 +969,12 @@ (func $start:field-initialization (local $0 i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) global.get $~lib/heap/__heap_base i32.const 15 i32.add @@ -1026,13 +1281,97 @@ local.get $1 call $~lib/rt/stub/__release i32.const 0 - i32.const 1 - call $field-initialization/Flow_Balanced#constructor + call $field-initialization/SomeObject#constructor local.set $1 local.get $1 + i32.const 0 + i32.store + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + call $~lib/rt/stub/__retain + local.set $0 + local.get $0 i32.load i32.const 0 - i32.ne + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 164 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 165 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $field-initialization/SomeObject#constructor + local.set $2 + local.get $2 + i32.const 1 + i32.store + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + call $~lib/rt/stub/__retain + local.set $3 + local.get $3 + i32.load + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 167 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.load offset=4 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 168 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $field-initialization/SomeObject#constructor + local.set $4 + local.get $4 + i32.const 208 + i32.store offset=4 + local.get $4 + i32.const 0 + i32.store + local.get $4 + call $~lib/rt/stub/__retain + local.set $5 + local.get $5 + i32.load + i32.const 0 + i32.eq i32.eqz if i32.const 0 @@ -1042,8 +1381,208 @@ call $~lib/builtins/abort unreachable end + local.get $5 + i32.load offset=4 + i32.const 208 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 171 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $field-initialization/SomeObject#constructor + local.set $6 + local.get $6 + i32.const 2 + i32.store + local.get $6 + i32.const 240 + i32.store offset=4 + local.get $6 + call $~lib/rt/stub/__retain + local.set $7 + local.get $7 + i32.load + i32.const 2 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 173 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.load offset=4 + i32.const 240 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 174 + i32.const 3 + call $~lib/builtins/abort + unreachable + end local.get $1 call $~lib/rt/stub/__release + local.get $0 + call $~lib/rt/stub/__release + local.get $2 + call $~lib/rt/stub/__release + local.get $3 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release + local.get $6 + call $~lib/rt/stub/__release + local.get $7 + call $~lib/rt/stub/__release + i32.const 0 + call $field-initialization/SomeOtherObject#constructor + local.set $7 + local.get $7 + i32.const 272 + i32.store offset=8 + local.get $7 + i32.const 0 + i32.store + local.get $7 + i32.const 0 + i32.store offset=4 + local.get $7 + call $~lib/rt/stub/__retain + local.set $6 + local.get $6 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 182 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.load offset=4 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 183 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $6 + i32.load offset=8 + i32.const 272 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 184 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + call $field-initialization/SomeOtherObject#constructor + local.set $5 + local.get $5 + i32.const 3 + i32.store + local.get $5 + i32.const 304 + i32.store offset=4 + local.get $5 + i32.const 336 + i32.store offset=8 + local.get $5 + call $~lib/rt/stub/__retain + local.set $4 + local.get $4 + i32.load + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 186 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.load offset=4 + i32.const 304 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 187 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.load offset=8 + i32.const 336 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 188 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $7 + call $~lib/rt/stub/__release + local.get $6 + call $~lib/rt/stub/__release + local.get $5 + call $~lib/rt/stub/__release + local.get $4 + call $~lib/rt/stub/__release + i32.const 0 + i32.const 1 + call $field-initialization/Flow_Balanced#constructor + local.set $4 + local.get $4 + i32.load + i32.const 0 + i32.ne + i32.eqz + if + i32.const 0 + i32.const 32 + i32.const 205 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $4 + call $~lib/rt/stub/__release ) (func $~start call $start:field-initialization From e8ad2efca328b735d9df584c3b188cd35aa6705c Mon Sep 17 00:00:00 2001 From: dcode Date: Tue, 23 Jun 2020 19:06:32 +0200 Subject: [PATCH 4/8] automate asserts on top of '!' --- src/ast.ts | 3 +- src/common.ts | 2 +- src/compiler.ts | 80 +++++++++++++------ src/diagnosticMessages.generated.ts | 4 + src/diagnosticMessages.json | 2 + src/extra/ast.ts | 4 +- src/flow.ts | 13 ++- src/parser.ts | 8 +- src/program.ts | 49 +++--------- src/tokenizer.ts | 32 ++++---- .../field-initialization-warnings.json | 10 +++ .../compiler/field-initialization-warnings.ts | 21 +++++ 12 files changed, 135 insertions(+), 93 deletions(-) create mode 100644 tests/compiler/field-initialization-warnings.json create mode 100644 tests/compiler/field-initialization-warnings.ts diff --git a/src/ast.ts b/src/ast.ts index 5e19d4160a..f789983047 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -1530,8 +1530,7 @@ export class Source extends Node { /** Full source text. */ public text: string ) { - super(NodeKind.SOURCE, changetype(0)); // ¯\(ツ)/¯ - this.range = new Range(null, 0, text.length); + super(NodeKind.SOURCE, new Range(0, text.length)); var internalPath = mangleInternalPath(normalizedPath); this.internalPath = internalPath; var pos = internalPath.lastIndexOf(PATH_DELIMITER); diff --git a/src/common.ts b/src/common.ts index 67208951db..20dae5d0a3 100644 --- a/src/common.ts +++ b/src/common.ts @@ -37,7 +37,7 @@ export enum CommonFlags { /** Has a `set` modifier. */ SET = 1 << 12, /** Has a definite assignment assertion `!` as in `x!: i32;`. */ - DEFINITE_ASSIGNMENT = 1 << 13, + DEFINITELY_ASSIGNED = 1 << 13, // Extended modifiers usually derived from basic modifiers diff --git a/src/compiler.ts b/src/compiler.ts index d9bb876fe7..c2695a46d9 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -9451,6 +9451,8 @@ export class Compiler extends DiagnosticEmitter { /** Checks that all class fields have been initialized. */ checkFieldInitialization(classInstance: Class, relatedNode: Node | null = null): void { + if (classInstance.didCheckFieldInitialization) return; + classInstance.didCheckFieldInitialization = true; var members = classInstance.members; if (members) { let ctor = assert(classInstance.constructorInstance); @@ -9460,8 +9462,7 @@ export class Compiler extends DiagnosticEmitter { if (element.kind == ElementKind.FIELD && element.parent == classInstance) { let field = element; if (!field.initializerNode && !flow.isThisFieldFlag(field, FieldFlags.INITIALIZED)) { - if (!field.is(CommonFlags.ERRORED)) { - field.set(CommonFlags.ERRORED); + if (!field.is(CommonFlags.DEFINITELY_ASSIGNED)) { if (relatedNode) { this.errorRelated( DiagnosticCode.Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned, @@ -9477,6 +9478,19 @@ export class Compiler extends DiagnosticEmitter { ); } } + } else if (field.is(CommonFlags.DEFINITELY_ASSIGNED)) { + if (field.type.is(TypeFlags.REFERENCE)) { + this.warning( // involves a runtime check + DiagnosticCode.Property_0_is_always_assigned_before_being_used, + field.identifierNode.range, + field.internalName + ); + } else { + this.pedantic( // is a nop anyway + DiagnosticCode.Unnecessary_definite_assignment, + field.identifierNode.range + ); + } } } } @@ -9577,25 +9591,26 @@ export class Compiler extends DiagnosticEmitter { (fieldParent).type, Constraints.CONV_IMPLICIT | Constraints.IS_THIS ); + let thisType = this.currentType; if ( flow.actualFunction.is(CommonFlags.CONSTRUCTOR) && thisExpression.kind == NodeKind.THIS && - !flow.isThisFieldFlag(fieldInstance, FieldFlags.INITIALIZED) + !flow.isThisFieldFlag(fieldInstance, FieldFlags.INITIALIZED) && + !fieldInstance.is(CommonFlags.DEFINITELY_ASSIGNED) ) { - this.error( + this.errorRelated( DiagnosticCode.Property_0_is_used_before_being_assigned, expression.range, + fieldInstance.identifierNode.range, fieldInstance.internalName ); - } else { - let thisType = this.currentType; - if (thisType.is(TypeFlags.NULLABLE)) { - if (!flow.isNonnull(thisExpr, thisType)) { - this.error( - DiagnosticCode.Object_is_possibly_null, - thisExpression.range - ); - } + } + if (thisType.is(TypeFlags.NULLABLE)) { + if (!flow.isNonnull(thisExpr, thisType)) { + this.error( + DiagnosticCode.Object_is_possibly_null, + thisExpression.range + ); } } if (!fieldInstance.is(CommonFlags.COMPILED)) { @@ -9604,13 +9619,17 @@ export class Compiler extends DiagnosticEmitter { if (typeNode) this.checkTypeSupported(fieldInstance.type, typeNode); } this.currentType = fieldType; - return module.load( + let ret = module.load( fieldType.byteSize, fieldType.is(TypeFlags.SIGNED | TypeFlags.INTEGER), thisExpr, fieldType.toNativeType(), fieldInstance.memoryOffset ); + if (fieldInstance.is(CommonFlags.DEFINITELY_ASSIGNED) && fieldType.is(TypeFlags.REFERENCE) && !fieldType.is(TypeFlags.NULLABLE)) { + ret = this.makeRuntimeNonNullCheck(ret, fieldType, expression); + } + return ret; } case ElementKind.PROPERTY_PROTOTYPE: { let propertyPrototype = target; @@ -10835,11 +10854,10 @@ export class Compiler extends DiagnosticEmitter { codeLocation: Node ): ExpressionRef { var program = this.program; - var module = this.module; - var stringInstance = program.stringInstance; var abortInstance = program.abortInstance; - if (!abortInstance || !this.compileFunction(abortInstance)) return module.unreachable(); + if (!abortInstance || !this.compileFunction(abortInstance)) return this.module.unreachable(); + var stringInstance = program.stringInstance; var messageArg: ExpressionRef; if (message !== null) { // The message argument works much like an arm of an IF that does not become executed if the @@ -10851,14 +10869,29 @@ export class Compiler extends DiagnosticEmitter { messageArg = this.makeZero(stringInstance.type); } - var filenameArg = this.ensureStaticString(codeLocation.range.source.normalizedPath); + return this.makeStaticAbort(messageArg, codeLocation); + } + + /** Makes a call to `abort`, if present, otherwise creates a trap. */ + makeStaticAbort( + /** Message argument of type string. May be zero. */ + messageExpr: ExpressionRef, + /** Code location to report when aborting. */ + codeLocation: Node + ): ExpressionRef { + var program = this.program; + var module = this.module; + var abortInstance = program.abortInstance; + if (!abortInstance || !this.compileFunction(abortInstance)) return module.unreachable(); + + var filenameExpr = this.ensureStaticString(codeLocation.range.source.normalizedPath); var range = codeLocation.range; var source = range.source; return module.block(null, [ module.call( abortInstance.internalName, [ - messageArg, - filenameArg, + messageExpr, + filenameExpr, module.i32(source.lineAt(range.start)), module.i32(source.columnAt()) ], @@ -10877,7 +10910,6 @@ export class Compiler extends DiagnosticEmitter { /** Report node. */ reportNode: Node ): ExpressionRef { - assert(type.is(TypeFlags.NULLABLE | TypeFlags.REFERENCE)); var module = this.module; var flow = this.currentFlow; var temp = flow.getTempLocal(type); @@ -10886,9 +10918,10 @@ export class Compiler extends DiagnosticEmitter { expr = module.if( module.local_tee(temp.index, expr), module.local_get(temp.index, type.toNativeType()), - this.makeAbort(null, reportNode) // TODO: throw + this.makeStaticAbort(this.ensureStaticString("unexpected null"), reportNode) // TODO: throw ); flow.freeTempLocal(temp); + this.currentType = type.nonNullableType; return expr; } @@ -10915,9 +10948,10 @@ export class Compiler extends DiagnosticEmitter { module.i32(toType.classReference!.id) ], NativeType.I32), module.local_get(temp.index, type.toNativeType()), - this.makeAbort(null, reportNode) // TODO: throw + this.makeStaticAbort(this.ensureStaticString("unexpected upcast"), reportNode) // TODO: throw ); flow.freeTempLocal(temp); + this.currentType = toType; return expr; } } diff --git a/src/diagnosticMessages.generated.ts b/src/diagnosticMessages.generated.ts index 1c1e7a6009..3035ba2345 100644 --- a/src/diagnosticMessages.generated.ts +++ b/src/diagnosticMessages.generated.ts @@ -49,12 +49,14 @@ export enum DiagnosticCode { _0_keyword_cannot_be_used_here = 230, A_class_with_a_constructor_explicitly_returning_something_else_than_this_must_be_final = 231, Exported_generic_function_or_class_has_no_concrete_instances = 232, + Property_0_is_always_assigned_before_being_used = 233, Type_0_is_cyclic_Module_will_include_deferred_garbage_collection = 900, Importing_the_table_disables_some_indirect_call_optimizations = 901, Exporting_the_table_disables_some_indirect_call_optimizations = 902, Expression_compiles_to_a_dynamic_check_at_runtime = 903, Indexed_access_may_involve_bounds_checking = 904, Explicitly_returning_constructor_drops_this_allocation = 905, + Unnecessary_definite_assignment = 906, Unterminated_string_literal = 1002, Identifier_expected = 1003, _0_expected = 1005, @@ -226,12 +228,14 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 230: return "'{0}' keyword cannot be used here."; case 231: return "A class with a constructor explicitly returning something else than 'this' must be '@final'."; case 232: return "Exported generic function or class has no concrete instances."; + case 233: return "Property '{0}' is always assigned before being used."; case 900: return "Type '{0}' is cyclic. Module will include deferred garbage collection."; case 901: return "Importing the table disables some indirect call optimizations."; case 902: return "Exporting the table disables some indirect call optimizations."; case 903: return "Expression compiles to a dynamic check at runtime."; case 904: return "Indexed access may involve bounds checking."; case 905: return "Explicitly returning constructor drops 'this' allocation."; + case 906: return "Unnecessary definite assignment."; case 1002: return "Unterminated string literal."; case 1003: return "Identifier expected."; case 1005: return "'{0}' expected."; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index 77992594c2..fa610788ae 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -42,6 +42,7 @@ "'{0}' keyword cannot be used here.": 230, "A class with a constructor explicitly returning something else than 'this' must be '@final'.": 231, "Exported generic function or class has no concrete instances.": 232, + "Property '{0}' is always assigned before being used.": 233, "Type '{0}' is cyclic. Module will include deferred garbage collection.": 900, "Importing the table disables some indirect call optimizations.": 901, @@ -49,6 +50,7 @@ "Expression compiles to a dynamic check at runtime.": 903, "Indexed access may involve bounds checking.": 904, "Explicitly returning constructor drops 'this' allocation.": 905, + "Unnecessary definite assignment.": 906, "Unterminated string literal.": 1002, "Identifier expected.": 1003, diff --git a/src/extra/ast.ts b/src/extra/ast.ts index 855234a022..9044ac7aae 100644 --- a/src/extra/ast.ts +++ b/src/extra/ast.ts @@ -1099,7 +1099,7 @@ export class ASTBuilder { this.serializeAccessModifiers(node); this.visitIdentifierExpression(node.name); var sb = this.sb; - if (node.flags & CommonFlags.DEFINITE_ASSIGNMENT) { + if (node.flags & CommonFlags.DEFINITELY_ASSIGNED) { sb.push("!"); } var type = node.type; @@ -1528,7 +1528,7 @@ export class ASTBuilder { this.visitIdentifierExpression(node.name); var type = node.type; var sb = this.sb; - if (node.flags & CommonFlags.DEFINITE_ASSIGNMENT) { + if (node.flags & CommonFlags.DEFINITELY_ASSIGNED) { sb.push("!"); } if (type) { diff --git a/src/flow.ts b/src/flow.ts index fc42948602..3da6439518 100644 --- a/src/flow.ts +++ b/src/flow.ts @@ -82,6 +82,10 @@ import { Node } from "./ast"; +import { + uniqueMap +} from "./util"; + /** Control flow flags indicating specific conditions. */ export const enum FlowFlags { /** No specific conditions. */ @@ -287,13 +291,8 @@ export class Flow { } branch.localFlags = this.localFlags.slice(); if (this.actualFunction.is(CommonFlags.CONSTRUCTOR)) { - let fieldFlags = assert(this.thisFieldFlags); - let clonedFieldFlags = new Map(); - for (let _keys = Map_keys(fieldFlags), i = 0, k = _keys.length; i < k; ++i) { - let key = _keys[i]; - clonedFieldFlags.set(key, changetype(fieldFlags.get(key))); - } - branch.thisFieldFlags = clonedFieldFlags; + let thisFieldFlags = assert(this.thisFieldFlags); + branch.thisFieldFlags = uniqueMap(thisFieldFlags); } else { assert(!this.thisFieldFlags); } diff --git a/src/parser.ts b/src/parser.ts index 7c2dc90c8e..e0d61fa581 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -947,7 +947,7 @@ export class Parser extends DiagnosticEmitter { } var flags = parentFlags; if (tn.skip(Token.EXCLAMATION)) { - flags |= CommonFlags.DEFINITE_ASSIGNMENT; + flags |= CommonFlags.DEFINITELY_ASSIGNED; } var type: TypeNode | null = null; @@ -981,7 +981,7 @@ export class Parser extends DiagnosticEmitter { } } var range = Range.join(identifier.range, tn.range()); - if ((flags & CommonFlags.DEFINITE_ASSIGNMENT) != 0 && initializer !== null) { + if ((flags & CommonFlags.DEFINITELY_ASSIGNED) != 0 && initializer !== null) { this.error( DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context, range @@ -2271,7 +2271,7 @@ export class Parser extends DiagnosticEmitter { ); } if (tn.skip(Token.EXCLAMATION)) { - flags |= CommonFlags.DEFINITE_ASSIGNMENT; + flags |= CommonFlags.DEFINITELY_ASSIGNED; } if (tn.skip(Token.COLON)) { type = this.parseType(tn); @@ -2288,7 +2288,7 @@ export class Parser extends DiagnosticEmitter { if (!initializer) return null; } let range = tn.range(startPos, tn.pos); - if ((flags & CommonFlags.DEFINITE_ASSIGNMENT) != 0 && ((flags & CommonFlags.STATIC) != 0 || isInterface || initializer !== null)) { + if ((flags & CommonFlags.DEFINITELY_ASSIGNED) != 0 && ((flags & CommonFlags.STATIC) != 0 || isInterface || initializer !== null)) { this.error( DiagnosticCode.A_definite_assignment_assertion_is_not_permitted_in_this_context, range diff --git a/src/program.ts b/src/program.ts index 7302c6122b..67da15e8dd 100644 --- a/src/program.ts +++ b/src/program.ts @@ -426,16 +426,16 @@ export class Program extends DiagnosticEmitter { var nativeSource = new Source(SourceKind.LIBRARY_ENTRY, LIBRARY_SUBST + ".wasm", "[native code]"); this.nativeSource = nativeSource; this.parser = new Parser(this.diagnostics, this.sources); - this._resolver = new Resolver(this); + this.resolver = new Resolver(this); var nativeFile = new File(this, nativeSource); - this._nativeFile = nativeFile; + this.nativeFile = nativeFile; this.filesByName.set(nativeFile.internalName, nativeFile); } /** Parser instance. */ parser: Parser; /** Resolver instance. */ - private _resolver: Resolver | null = null; + resolver!: Resolver; /** Array of sources. */ sources: Source[] = []; /** Diagnostic offset used where successively obtaining the next diagnostic. */ @@ -443,7 +443,7 @@ export class Program extends DiagnosticEmitter { /** Special native code source. */ nativeSource: Source; /** Special native code file. */ - private _nativeFile: File | null = null; + nativeFile!: File; /** Next class id. */ nextClassId: u32 = 0; /** Next signature id. */ @@ -451,16 +451,6 @@ export class Program extends DiagnosticEmitter { /** An indicator if the program has been initialized. */ initialized: bool = false; - /** Gets the singleton native file. */ - get nativeFile(): File { - return assert(this._nativeFile); - } - - /** Gets the corresponding resolver. */ - get resolver(): Resolver { - return assert(this._resolver); - } - // Lookup maps /** Files by unique internal name. */ @@ -2610,7 +2600,7 @@ export namespace DecoratorFlags { export abstract class Element { /** Parent element. */ - private _parent: Element | null; + parent!: Element; /** Common flags indicating specific traits. */ flags: CommonFlags = CommonFlags.NONE; /** Decorator flags indicating annotated traits. */ @@ -2637,18 +2627,13 @@ export abstract class Element { this.name = name; this.internalName = internalName; if (parent) { - this._parent = parent; + this.parent = parent; } else { assert(this.kind == ElementKind.FILE); - this._parent = this; // special case to keep this.parent non-nullable + this.parent = this; // special case to keep this.parent non-nullable } } - /** Gets the parent element. */ - get parent(): Element { - return assert(this._parent); - } - /** Gets the enclosing file. */ get file(): File { var current: Element = this; @@ -2896,7 +2881,7 @@ export class File extends Element { /** File re-exports. */ exportsStar: File[] | null = null; /** Top-level start function of this file. */ - private _startFunction: Function | null; + startFunction!: Function; /** Constructs a new file. */ constructor( @@ -2921,12 +2906,7 @@ export class File extends Element { this ); startFunction.internalName = startFunction.name; - this._startFunction = startFunction; - } - - /** Gets this file's start function. */ - get startFunction(): Function { - return assert(this._startFunction); + this.startFunction = startFunction; } /* @override */ @@ -3456,7 +3436,7 @@ export class Function extends TypedElement { /** Contextual type arguments. */ contextualTypeArguments: Map | null; /** Default control flow. */ - private _flow: Flow | null; + flow!: Flow; /** Remembered debug locations. */ debugLocations: Range[] = []; /** Function reference, if compiled. */ @@ -3530,15 +3510,10 @@ export class Function extends TypedElement { this.localsByIndex[local.index] = local; } } - this._flow = Flow.createParent(this); + this.flow = Flow.createParent(this); registerConcreteElement(program, this); } - /** Gets the default control flow. */ - get flow(): Flow { - return assert(this._flow); - } - /** Creates a stub for use with this function, i.e. for varargs or virtual calls. */ newStub(postfix: string): Function { var stub = new Function( @@ -4073,6 +4048,8 @@ export class Class extends TypedElement { extendees: Set | null = null; /** Classes implementing this interface. */ implementers: Set | null = null; + /** Whether the field initialization check has already been performed. */ + didCheckFieldInitialization: bool = false; /** Gets the unique runtime id of this class. */ get id(): u32 { diff --git a/src/tokenizer.ts b/src/tokenizer.ts index 0aba7e66aa..5dbb891e00 100644 --- a/src/tokenizer.ts +++ b/src/tokenizer.ts @@ -399,34 +399,24 @@ export function operatorTokenToString(token: Token): string { export class Range { - private _source: Source | null; start: i32; end: i32; + source!: Source; debugInfoRef: usize = 0; - constructor(source: Source | null, start: i32, end: i32) { + constructor(start: i32, end: i32) { this.start = start; this.end = end; - this._source = source; - } - - /** Gets the corresponding source. */ - get source(): Source { - return assert(this._source); - } - - /** Sets the corresponding source. */ - set source(source: Source) { - assert(!this._source); - this._source = source; } static join(a: Range, b: Range): Range { if (a.source != b.source) throw new Error("source mismatch"); - return new Range(a.source, + let range = new Range( a.start < b.start ? a.start : b.start, a.end > b.end ? a.end : b.end ); + range.source = a.source; + return range; } equals(other: Range): bool { @@ -434,11 +424,15 @@ export class Range { } get atStart(): Range { - return new Range(this.source, this.start, this.start); + let range = new Range(this.start, this.start); + range.source = this.source; + return range; } get atEnd(): Range { - return new Range(this.source, this.end, this.end); + let range = new Range(this.end, this.end); + range.source = this.source; + return range; } toString(): string { @@ -1028,7 +1022,9 @@ export class Tokenizer extends DiagnosticEmitter { } else if (end < 0) { end = start; } - return new Range(this.source, start, end); + let range = new Range(start, end); + range.source = this.source; + return range; } readIdentifier(): string { diff --git a/tests/compiler/field-initialization-warnings.json b/tests/compiler/field-initialization-warnings.json new file mode 100644 index 0000000000..1d20f3ea5e --- /dev/null +++ b/tests/compiler/field-initialization-warnings.json @@ -0,0 +1,10 @@ +{ + "asc_flags": [ + "--runtime none" + ], + "stderr": [ + "AS906: Unnecessary definite assignment.", + "AS233: Property 'field-initialization-warnings/Ref_Ctor_Init.a' is always assigned", + "EOF" + ] +} \ No newline at end of file diff --git a/tests/compiler/field-initialization-warnings.ts b/tests/compiler/field-initialization-warnings.ts new file mode 100644 index 0000000000..ad99314ed4 --- /dev/null +++ b/tests/compiler/field-initialization-warnings.ts @@ -0,0 +1,21 @@ +// non-reference is unnecessary +class Nonref { + a!: i32; +} +{ + new Nonref(); +} + +// always assigned +class Ref_Ctor_Init { + a!: string; + constructor() { + this.a = "a"; + } +} +{ + var o = new Ref_Ctor_Init(); + assert(o.a == "a"); +} + +ERROR("EOF"); From 7f3b810f2f66bd7a05626520eee960a333f82eec Mon Sep 17 00:00:00 2001 From: dcode Date: Tue, 23 Jun 2020 19:14:20 +0200 Subject: [PATCH 5/8] update affected fixtures --- tests/compiler/assert-nonnull.optimized.wat | 39 +- tests/compiler/assert-nonnull.untouched.wat | 47 +- tests/compiler/issues/1095.optimized.wat | 25 +- tests/compiler/issues/1095.untouched.wat | 7 +- tests/compiler/managed-cast.optimized.wat | 109 ++-- tests/compiler/managed-cast.untouched.wat | 30 +- tests/compiler/std/array.optimized.wat | 573 ++++++++++---------- tests/compiler/std/array.untouched.wat | 541 +++++++++--------- tests/compiler/std/symbol.optimized.wat | 87 +-- tests/compiler/std/symbol.untouched.wat | 87 +-- 10 files changed, 779 insertions(+), 766 deletions(-) diff --git a/tests/compiler/assert-nonnull.optimized.wat b/tests/compiler/assert-nonnull.optimized.wat index ff3ebae31f..b32a457083 100644 --- a/tests/compiler/assert-nonnull.optimized.wat +++ b/tests/compiler/assert-nonnull.optimized.wat @@ -4,10 +4,11 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 1024) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s") - (data (i32.const 1088) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") - (data (i32.const 1152) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 1200) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") + (data (i32.const 1024) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l") + (data (i32.const 1072) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s") + (data (i32.const 1136) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 1200) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") + (data (i32.const 1248) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") (table $0 1 funcref) (export "memory" (memory $0)) (export "testVar" (func $assert-nonnull/testVar)) @@ -26,8 +27,8 @@ local.get $0 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 2 i32.const 10 call $~lib/builtins/abort @@ -39,8 +40,8 @@ local.get $0 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 11 i32.const 10 call $~lib/builtins/abort @@ -55,8 +56,8 @@ local.tee $0 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 15 i32.const 10 call $~lib/builtins/abort @@ -68,8 +69,8 @@ local.get $0 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 19 i32.const 10 call $~lib/builtins/abort @@ -80,8 +81,8 @@ i32.load offset=12 i32.ge_u if - i32.const 1104 - i32.const 1168 + i32.const 1152 + i32.const 1216 i32.const 104 i32.const 42 call $~lib/builtins/abort @@ -93,8 +94,8 @@ local.tee $0 i32.eqz if + i32.const 1264 i32.const 1216 - i32.const 1168 i32.const 108 i32.const 40 call $~lib/builtins/abort @@ -108,8 +109,8 @@ i32.load offset=12 i32.ge_u if - i32.const 1104 - i32.const 1168 + i32.const 1152 + i32.const 1216 i32.const 104 i32.const 42 call $~lib/builtins/abort @@ -125,8 +126,8 @@ local.tee $0 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 23 i32.const 10 call $~lib/builtins/abort @@ -153,8 +154,8 @@ local.get $0 return end - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 27 i32.const 10 call $~lib/builtins/abort @@ -179,8 +180,8 @@ local.get $0 return end - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 31 i32.const 10 call $~lib/builtins/abort @@ -194,8 +195,8 @@ local.get $0 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 39 i32.const 13 call $~lib/builtins/abort @@ -212,8 +213,8 @@ local.get $1 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 44 i32.const 10 call $~lib/builtins/abort @@ -234,8 +235,8 @@ local.get $1 i32.eqz if - i32.const 0 i32.const 1040 + i32.const 1088 i32.const 52 i32.const 10 call $~lib/builtins/abort diff --git a/tests/compiler/assert-nonnull.untouched.wat b/tests/compiler/assert-nonnull.untouched.wat index 01f18b6346..19ac670227 100644 --- a/tests/compiler/assert-nonnull.untouched.wat +++ b/tests/compiler/assert-nonnull.untouched.wat @@ -6,10 +6,11 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) - (data (i32.const 16) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s\00") - (data (i32.const 80) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") - (data (i32.const 144) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") - (data (i32.const 192) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") + (data (i32.const 16) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00") + (data (i32.const 64) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00a\00s\00s\00e\00r\00t\00-\00n\00o\00n\00n\00u\00l\00l\00.\00t\00s\00") + (data (i32.const 128) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00") + (data (i32.const 192) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00") + (data (i32.const 240) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") (table $0 1 funcref) (global $~argumentsLength (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -41,8 +42,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 2 i32.const 10 call $~lib/builtins/abort @@ -64,8 +65,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 11 i32.const 10 call $~lib/builtins/abort @@ -89,8 +90,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 15 i32.const 10 call $~lib/builtins/abort @@ -119,8 +120,8 @@ i32.load offset=12 i32.ge_u if - i32.const 96 - i32.const 160 + i32.const 144 + i32.const 208 i32.const 104 i32.const 42 call $~lib/builtins/abort @@ -138,8 +139,8 @@ local.get $2 i32.eqz if + i32.const 256 i32.const 208 - i32.const 160 i32.const 108 i32.const 40 call $~lib/builtins/abort @@ -157,8 +158,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 19 i32.const 10 call $~lib/builtins/abort @@ -188,8 +189,8 @@ i32.load offset=12 i32.ge_u if - i32.const 96 - i32.const 160 + i32.const 144 + i32.const 208 i32.const 104 i32.const 42 call $~lib/builtins/abort @@ -218,8 +219,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 23 i32.const 10 call $~lib/builtins/abort @@ -242,8 +243,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 27 i32.const 10 call $~lib/builtins/abort @@ -256,8 +257,8 @@ if (result i32) local.get $2 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 27 i32.const 10 call $~lib/builtins/abort @@ -268,8 +269,8 @@ if (result i32) local.get $2 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 27 i32.const 10 call $~lib/builtins/abort @@ -294,8 +295,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 31 i32.const 10 call $~lib/builtins/abort @@ -308,8 +309,8 @@ if (result i32) local.get $2 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 31 i32.const 10 call $~lib/builtins/abort @@ -320,8 +321,8 @@ if (result i32) local.get $2 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 31 i32.const 10 call $~lib/builtins/abort @@ -351,8 +352,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 39 i32.const 13 call $~lib/builtins/abort @@ -377,8 +378,8 @@ if (result i32) local.get $2 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 44 i32.const 10 call $~lib/builtins/abort @@ -423,8 +424,8 @@ if (result i32) local.get $2 else - i32.const 0 i32.const 32 + i32.const 80 i32.const 52 i32.const 10 call $~lib/builtins/abort diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index 0bc87f68c3..3845d79961 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -16,7 +16,8 @@ (data (i32.const 1072) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") (data (i32.const 1136) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") (data (i32.const 1184) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t") - (data (i32.const 1216) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\000\009\005\00.\00t\00s") + (data (i32.const 1216) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l") + (data (i32.const 1264) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\000\009\005\00.\00t\00s") (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (export "memory" (memory $0)) @@ -601,11 +602,11 @@ if unreachable end - i32.const 1264 + i32.const 1312 local.tee $0 i32.const 0 i32.store - i32.const 2832 + i32.const 2880 i32.const 0 i32.store loop $for-loop|0 @@ -616,7 +617,7 @@ local.get $1 i32.const 2 i32.shl - i32.const 1264 + i32.const 1312 i32.add i32.const 0 i32.store offset=4 @@ -634,7 +635,7 @@ i32.add i32.const 2 i32.shl - i32.const 1264 + i32.const 1312 i32.add i32.const 0 i32.store offset=96 @@ -652,13 +653,13 @@ br $for-loop|0 end end - i32.const 1264 - i32.const 2848 + i32.const 1312 + i32.const 2896 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 1264 + i32.const 1312 global.set $~lib/rt/tlsf/ROOT end local.get $0 @@ -896,7 +897,7 @@ (local $1 i32) (local $2 i32) local.get $0 - i32.const 1260 + i32.const 1308 i32.gt_u if local.get $0 @@ -945,7 +946,7 @@ ) (func $~lib/rt/pure/__release (param $0 i32) local.get $0 - i32.const 1260 + i32.const 1308 i32.gt_u if local.get $0 @@ -976,8 +977,8 @@ local.tee $0 i32.eqz if - i32.const 0 i32.const 1232 + i32.const 1280 i32.const 8 i32.const 13 call $~lib/builtins/abort @@ -1044,7 +1045,7 @@ local.tee $1 if local.get $1 - i32.const 1260 + i32.const 1308 i32.ge_u if local.get $1 diff --git a/tests/compiler/issues/1095.untouched.wat b/tests/compiler/issues/1095.untouched.wat index 465e0af1e1..63f4eb361c 100644 --- a/tests/compiler/issues/1095.untouched.wat +++ b/tests/compiler/issues/1095.untouched.wat @@ -18,13 +18,14 @@ (data (i32.const 64) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") (data (i32.const 176) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t\00") - (data (i32.const 208) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\000\009\005\00.\00t\00s\00") + (data (i32.const 208) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00") + (data (i32.const 256) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\000\009\005\00.\00t\00s\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) - (global $~lib/heap/__heap_base i32 (i32.const 252)) + (global $~lib/heap/__heap_base i32 (i32.const 300)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) @@ -1561,8 +1562,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 224 + i32.const 272 i32.const 8 i32.const 13 call $~lib/builtins/abort diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 218b948d15..08e5789bf9 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -16,8 +16,10 @@ (data (i32.const 1024) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") (data (i32.const 1072) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") (data (i32.const 1136) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s") - (data (i32.const 1184) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00m\00a\00n\00a\00g\00e\00d\00-\00c\00a\00s\00t\00.\00t\00s") - (data (i32.const 1232) "\05\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\04\00\00\00 ") + (data (i32.const 1184) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l") + (data (i32.const 1232) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00m\00a\00n\00a\00g\00e\00d\00-\00c\00a\00s\00t\00.\00t\00s") + (data (i32.const 1280) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00u\00p\00c\00a\00s\00t") + (data (i32.const 1344) "\05\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\04\00\00\00 ") (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0)) @@ -603,11 +605,11 @@ if unreachable end - i32.const 1280 + i32.const 1392 local.tee $0 i32.const 0 i32.store - i32.const 2848 + i32.const 2960 i32.const 0 i32.store loop $for-loop|0 @@ -618,7 +620,7 @@ local.get $1 i32.const 2 i32.shl - i32.const 1280 + i32.const 1392 i32.add i32.const 0 i32.store offset=4 @@ -636,7 +638,7 @@ i32.add i32.const 2 i32.shl - i32.const 1280 + i32.const 1392 i32.add i32.const 0 i32.store offset=96 @@ -654,13 +656,13 @@ br $for-loop|0 end end - i32.const 1280 - i32.const 2864 + i32.const 1392 + i32.const 2976 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 1280 + i32.const 1392 global.set $~lib/rt/tlsf/ROOT end local.get $0 @@ -904,7 +906,7 @@ (local $1 i32) (local $2 i32) local.get $0 - i32.const 1276 + i32.const 1388 i32.gt_u if local.get $0 @@ -968,7 +970,7 @@ ) (func $~lib/rt/pure/__release (param $0 i32) local.get $0 - i32.const 1276 + i32.const 1388 i32.gt_u if local.get $0 @@ -993,7 +995,7 @@ i32.sub i32.load offset=8 local.tee $0 - i32.const 1232 + i32.const 1344 i32.load i32.le_u if @@ -1008,7 +1010,7 @@ local.get $0 i32.const 3 i32.shl - i32.const 1236 + i32.const 1348 i32.add i32.load offset=4 local.tee $0 @@ -1030,13 +1032,13 @@ (local $9 i32) call $managed-cast/Cat#constructor call $managed-cast/Cat#constructor - local.tee $3 + local.tee $5 call $~lib/rt/pure/__retain local.tee $0 i32.eqz if - i32.const 0 i32.const 1200 + i32.const 1248 i32.const 14 i32.const 12 call $~lib/builtins/abort @@ -1045,20 +1047,20 @@ local.get $0 call $~lib/rt/pure/__release call $managed-cast/Cat#constructor - local.tee $4 + local.tee $6 call $managed-cast/testDowncastToNullable call $managed-cast/Cat#constructor - local.tee $5 + local.tee $7 call $managed-cast/testDowncastToNullable call $managed-cast/Cat#constructor - local.tee $6 + local.tee $8 call $~lib/rt/pure/__retain local.tee $0 call $~lib/rt/__instanceof i32.eqz if - i32.const 0 - i32.const 1200 + i32.const 1296 + i32.const 1248 i32.const 31 i32.const 9 call $~lib/builtins/abort @@ -1067,72 +1069,69 @@ local.get $0 call $~lib/rt/pure/__release call $managed-cast/Cat#constructor - local.tee $7 + local.tee $9 call $~lib/rt/pure/__retain local.tee $0 - local.set $1 - block $__inlined_func$managed-cast/testUpcastFromNullable - block $folding-inner0 - local.get $0 - i32.eqz - br_if $folding-inner0 - local.get $1 - call $~lib/rt/__instanceof - i32.eqz - br_if $folding-inner0 - local.get $0 - call $~lib/rt/pure/__release - br $__inlined_func$managed-cast/testUpcastFromNullable - end - i32.const 0 + local.get $0 + i32.eqz + if i32.const 1200 + i32.const 1248 + i32.const 36 + i32.const 9 + call $~lib/builtins/abort + unreachable + end + call $~lib/rt/__instanceof + i32.eqz + if + i32.const 1296 + i32.const 1248 i32.const 36 i32.const 9 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release call $managed-cast/Cat#constructor - local.tee $8 + local.tee $2 call $~lib/rt/pure/__retain - local.tee $1 - local.get $1 + local.tee $0 + local.get $0 call $~lib/rt/__instanceof i32.eqz if - i32.const 0 - i32.const 1200 + i32.const 1296 + i32.const 1248 i32.const 41 i32.const 30 call $~lib/builtins/abort unreachable end call $~lib/rt/pure/__retain - local.get $1 + local.get $0 call $~lib/rt/pure/__release call $~lib/rt/pure/__release call $managed-cast/Cat#constructor - local.tee $9 - call $~lib/rt/pure/__retain local.tee $1 - local.get $1 + call $~lib/rt/pure/__retain + local.tee $0 + local.get $0 call $~lib/rt/__instanceof i32.eqz if - i32.const 0 - i32.const 1200 + i32.const 1296 + i32.const 1248 i32.const 47 i32.const 30 call $~lib/builtins/abort unreachable end call $~lib/rt/pure/__retain - local.get $1 - call $~lib/rt/pure/__release - call $~lib/rt/pure/__release + local.get $0 call $~lib/rt/pure/__release - local.get $3 call $~lib/rt/pure/__release - local.get $4 call $~lib/rt/pure/__release local.get $5 call $~lib/rt/pure/__release @@ -1144,6 +1143,10 @@ call $~lib/rt/pure/__release local.get $9 call $~lib/rt/pure/__release + local.get $2 + call $~lib/rt/pure/__release + local.get $1 + call $~lib/rt/pure/__release ) (func $~start global.get $~started @@ -1196,7 +1199,7 @@ local.tee $1 if local.get $1 - i32.const 1276 + i32.const 1388 i32.ge_u if local.get $1 diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index ceadae9eda..5f6f58c1b2 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -17,16 +17,18 @@ (data (i32.const 16) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00") (data (i32.const 64) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") (data (i32.const 128) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00p\00u\00r\00e\00.\00t\00s\00") - (data (i32.const 176) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00m\00a\00n\00a\00g\00e\00d\00-\00c\00a\00s\00t\00.\00t\00s\00") - (data (i32.const 224) "\05\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\04\00\00\00 \00\00\00\00\00\00\00") + (data (i32.const 176) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00") + (data (i32.const 224) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00m\00a\00n\00a\00g\00e\00d\00-\00c\00a\00s\00t\00.\00t\00s\00") + (data (i32.const 272) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00u\00p\00c\00a\00s\00t\00") + (data (i32.const 336) "\05\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\04\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $~lib/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) (global $~lib/gc/gc.auto (mut i32) (i32.const 1)) (global $~started (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 224)) - (global $~lib/heap/__heap_base i32 (i32.const 268)) + (global $~lib/rt/__rtti_base i32 (i32.const 336)) + (global $~lib/heap/__heap_base i32 (i32.const 380)) (export "_start" (func $~start)) (export "memory" (memory $0)) (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) @@ -1582,8 +1584,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 192 + i32.const 240 i32.const 14 i32.const 12 call $~lib/builtins/abort @@ -1684,8 +1686,8 @@ if (result i32) local.get $1 else - i32.const 0 - i32.const 192 + i32.const 288 + i32.const 240 i32.const 31 i32.const 9 call $~lib/builtins/abort @@ -1705,8 +1707,8 @@ if (result i32) local.get $1 else - i32.const 0 i32.const 192 + i32.const 240 i32.const 36 i32.const 9 call $~lib/builtins/abort @@ -1718,8 +1720,8 @@ if (result i32) local.get $1 else - i32.const 0 - i32.const 192 + i32.const 288 + i32.const 240 i32.const 36 i32.const 9 call $~lib/builtins/abort @@ -1742,8 +1744,8 @@ if (result i32) local.get $1 else - i32.const 0 - i32.const 192 + i32.const 288 + i32.const 240 i32.const 41 i32.const 30 call $~lib/builtins/abort @@ -1774,8 +1776,8 @@ if (result i32) local.get $1 else - i32.const 0 - i32.const 192 + i32.const 288 + i32.const 240 i32.const 47 i32.const 30 call $~lib/builtins/abort diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 9499664b74..989a241895 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -129,111 +129,112 @@ (data (i32.const 4848) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05") (data (i32.const 4900) "\01") (data (i32.const 4912) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") - (data (i32.const 5024) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") - (data (i32.const 5072) "\ac\00\00\00\01\00\00\00\01\00\00\00\ac\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?") - (data (i32.const 5264) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") - (data (i32.const 5312) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") - (data (i32.const 5360) "@\00\00\00\01\00\00\00\00\00\00\00@") - (data (i32.const 5382) "\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?") - (data (i32.const 5422) "\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") - (data (i32.const 5440) "@\00\00\00\01\00\00\00\00\00\00\00@") - (data (i32.const 5462) "\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf") - (data (i32.const 5494) "\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") - (data (i32.const 5520) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02") - (data (i32.const 5568) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02") - (data (i32.const 5616) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02") - (data (i32.const 5664) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") - (data (i32.const 5716) "\01") - (data (i32.const 5728) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") - (data (i32.const 5760) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01") - (data (i32.const 5792) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01") - (data (i32.const 5824) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 5856) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") - (data (i32.const 5888) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") - (data (i32.const 5920) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a") - (data (i32.const 5952) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b") - (data (i32.const 5984) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b") - (data (i32.const 6016) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a") - (data (i32.const 6052) "\01\00\00\00\01") - (data (i32.const 6064) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\000\17\00\00P\17\00\000\17\00\00p\17\00\00\90\17\00\00\b0\17") - (data (i32.const 6112) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\b0\17\00\000\17\00\000\17\00\00p\17\00\00P\17\00\00\90\17") - (data (i32.const 6160) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") - (data (i32.const 6192) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01") - (data (i32.const 6224) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e") - (data (i32.const 6256) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e") - (data (i32.const 6288) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,") - (data (i32.const 6320) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e") - (data (i32.const 6368) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 6400) "d\00\00\00\01\00\00\00\01\00\00\00d\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00(\00)\00 \00r\00a\00d\00i\00x\00 \00a\00r\00g\00u\00m\00e\00n\00t\00 \00m\00u\00s\00t\00 \00b\00e\00 \00b\00e\00t\00w\00e\00e\00n\00 \002\00 \00a\00n\00d\00 \003\006") - (data (i32.const 6528) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00n\00u\00m\00b\00e\00r\00.\00t\00s") - (data (i32.const 6592) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000") - (data (i32.const 6624) "H\00\00\00\01\00\00\00\01\00\00\00H\00\00\000\001\002\003\004\005\006\007\008\009\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z") - (data (i32.const 6720) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003") - (data (i32.const 6752) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 6784) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-") - (data (i32.const 6816) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 6848) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_") - (data (i32.const 6880) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") - (data (i32.const 6944) "0\00\00\00\01\00\00\00\00\00\00\000") - (data (i32.const 6974) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 7008) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 ") - (data (i32.const 7040) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") - (data (i32.const 7072) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") - (data (i32.const 7104) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 7152) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 7184) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]") - (data (i32.const 8468) "\01") - (data (i32.const 8480) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") - (data (i32.const 8512) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") - (data (i32.const 8544) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 8576) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002") - (data (i32.const 8608) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003") - (data (i32.const 8640) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff") - (data (i32.const 8672) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000") - (data (i32.const 8704) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff") - (data (i32.const 8736) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000") - (data (i32.const 8784) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff") - (data (i32.const 8832) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000") - (data (i32.const 8896) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") - (data (i32.const 8944) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007") - (data (i32.const 9056) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\b0\17\00\000\17\00\000\17\00\00p\17\00\00P\17\00\00\90\17") - (data (i32.const 9104) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,") - (data (i32.const 9152) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002") - (data (i32.const 9184) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004") - (data (i32.const 9216) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\10 \00\00\d0#\00\00\00\00\00\00\f0#") - (data (i32.const 9248) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004") - (data (i32.const 9280) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") - (data (i32.const 9312) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04") - (data (i32.const 9344) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004") - (data (i32.const 9376) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") - (data (i32.const 9408) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") - (data (i32.const 9440) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") - (data (i32.const 9472) "\04\00\00\00\01\00\00\00\00\00\00\00\04") - (data (i32.const 9504) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") - (data (i32.const 9536) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\04\00\00\00\05\00\00\00\06") - (data (i32.const 9568) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\07\00\00\00\08\00\00\00\t") - (data (i32.const 9600) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00o\00n\00e") - (data (i32.const 9632) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\90%") - (data (i32.const 9664) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00t\00w\00o") - (data (i32.const 9696) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00t\00h\00r\00e\00e") - (data (i32.const 9728) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\d0%\00\00\00\00\00\00\f0%") - (data (i32.const 9760) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00o\00u\00r") - (data (i32.const 9792) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00i\00v\00e") - (data (i32.const 9824) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00s\00i\00x") - (data (i32.const 9856) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\000&\00\00P&\00\00p&") - (data (i32.const 9888) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00e\00v\00e\00n") - (data (i32.const 9920) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\b0&") - (data (i32.const 9952) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\90%\00\00\d0%\00\00\00\00\00\00\f0%\00\000&\00\00P&\00\00p&\00\00\b0&") - (data (i32.const 10004) "\01") - (data (i32.const 10020) "\01") + (data (i32.const 5024) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l") + (data (i32.const 5072) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s") + (data (i32.const 5120) "\ac\00\00\00\01\00\00\00\01\00\00\00\ac\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?") + (data (i32.const 5312) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") + (data (i32.const 5360) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") + (data (i32.const 5408) "@\00\00\00\01\00\00\00\00\00\00\00@") + (data (i32.const 5430) "\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?") + (data (i32.const 5470) "\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") + (data (i32.const 5488) "@\00\00\00\01\00\00\00\00\00\00\00@") + (data (i32.const 5510) "\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf") + (data (i32.const 5542) "\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") + (data (i32.const 5568) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02") + (data (i32.const 5616) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02") + (data (i32.const 5664) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02") + (data (i32.const 5712) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 5764) "\01") + (data (i32.const 5776) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 5808) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01") + (data (i32.const 5840) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01") + (data (i32.const 5872) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 5904) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 5936) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 5968) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a") + (data (i32.const 6000) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b") + (data (i32.const 6032) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b") + (data (i32.const 6064) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a") + (data (i32.const 6100) "\01\00\00\00\01") + (data (i32.const 6112) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00`\17\00\00\80\17\00\00`\17\00\00\a0\17\00\00\c0\17\00\00\e0\17") + (data (i32.const 6160) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\e0\17\00\00`\17\00\00`\17\00\00\a0\17\00\00\80\17\00\00\c0\17") + (data (i32.const 6208) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 6240) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01") + (data (i32.const 6272) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e") + (data (i32.const 6304) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e") + (data (i32.const 6336) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,") + (data (i32.const 6368) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e") + (data (i32.const 6416) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 6448) "d\00\00\00\01\00\00\00\01\00\00\00d\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00(\00)\00 \00r\00a\00d\00i\00x\00 \00a\00r\00g\00u\00m\00e\00n\00t\00 \00m\00u\00s\00t\00 \00b\00e\00 \00b\00e\00t\00w\00e\00e\00n\00 \002\00 \00a\00n\00d\00 \003\006") + (data (i32.const 6576) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00n\00u\00m\00b\00e\00r\00.\00t\00s") + (data (i32.const 6640) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000") + (data (i32.const 6672) "H\00\00\00\01\00\00\00\01\00\00\00H\00\00\000\001\002\003\004\005\006\007\008\009\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z") + (data (i32.const 6768) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003") + (data (i32.const 6800) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 6832) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-") + (data (i32.const 6864) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 6896) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_") + (data (i32.const 6928) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008") + (data (i32.const 6992) "0\00\00\00\01\00\00\00\00\00\00\000") + (data (i32.const 7022) "\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 7056) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 ") + (data (i32.const 7088) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000") + (data (i32.const 7120) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N") + (data (i32.const 7152) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 7200) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") + (data (i32.const 7232) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]") + (data (i32.const 8516) "\01") + (data (i32.const 8528) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 8560) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 8592) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 8624) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002") + (data (i32.const 8656) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003") + (data (i32.const 8688) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff") + (data (i32.const 8720) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000") + (data (i32.const 8752) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff") + (data (i32.const 8784) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000") + (data (i32.const 8832) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 8880) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000") + (data (i32.const 8944) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") + (data (i32.const 8992) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007") + (data (i32.const 9104) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\e0\17\00\00`\17\00\00`\17\00\00\a0\17\00\00\80\17\00\00\c0\17") + (data (i32.const 9152) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,") + (data (i32.const 9200) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002") + (data (i32.const 9232) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004") + (data (i32.const 9264) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00@ \00\00\00$\00\00\00\00\00\00 $") + (data (i32.const 9296) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004") + (data (i32.const 9328) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02") + (data (i32.const 9360) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04") + (data (i32.const 9392) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004") + (data (i32.const 9424) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") + (data (i32.const 9456) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") + (data (i32.const 9488) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01") + (data (i32.const 9520) "\04\00\00\00\01\00\00\00\00\00\00\00\04") + (data (i32.const 9552) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03") + (data (i32.const 9584) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\04\00\00\00\05\00\00\00\06") + (data (i32.const 9616) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\07\00\00\00\08\00\00\00\t") + (data (i32.const 9648) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00o\00n\00e") + (data (i32.const 9680) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\c0%") + (data (i32.const 9712) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00t\00w\00o") + (data (i32.const 9744) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00t\00h\00r\00e\00e") + (data (i32.const 9776) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\00&\00\00\00\00\00\00 &") + (data (i32.const 9808) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00o\00u\00r") + (data (i32.const 9840) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00i\00v\00e") + (data (i32.const 9872) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00s\00i\00x") + (data (i32.const 9904) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00`&\00\00\80&\00\00\a0&") + (data (i32.const 9936) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00e\00v\00e\00n") + (data (i32.const 9968) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\e0&") + (data (i32.const 10000) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\c0%\00\00\00&\00\00\00\00\00\00 &\00\00`&\00\00\80&\00\00\a0&\00\00\e0&") + (data (i32.const 10052) "\01") + (data (i32.const 10068) "\01") (table $0 57 funcref) (elem (i32.const 1) $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|2 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|16 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $start:std/array~anonymous|29 $start:std/array~anonymous|29 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|29 $start:std/array~anonymous|35 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $~lib/util/sort/COMPARATOR~anonymous|0 $start:std/array~anonymous|44 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -256,7 +257,7 @@ (export "memory" (memory $0)) (func $~lib/rt/pure/__release (param $0 i32) local.get $0 - i32.const 10032 + i32.const 10080 i32.gt_u if local.get $0 @@ -845,11 +846,11 @@ if unreachable end - i32.const 10032 + i32.const 10080 local.tee $0 i32.const 0 i32.store - i32.const 11600 + i32.const 11648 i32.const 0 i32.store loop $for-loop|0 @@ -860,7 +861,7 @@ local.get $1 i32.const 2 i32.shl - i32.const 10032 + i32.const 10080 i32.add i32.const 0 i32.store offset=4 @@ -878,7 +879,7 @@ i32.add i32.const 2 i32.shl - i32.const 10032 + i32.const 10080 i32.add i32.const 0 i32.store offset=96 @@ -896,13 +897,13 @@ br $for-loop|0 end end - i32.const 10032 - i32.const 11616 + i32.const 10080 + i32.const 11664 memory.size i32.const 16 i32.shl call $~lib/rt/tlsf/addMemory - i32.const 10032 + i32.const 10080 global.set $~lib/rt/tlsf/ROOT end local.get $0 @@ -1460,7 +1461,7 @@ (local $1 i32) (local $2 i32) local.get $0 - i32.const 10032 + i32.const 10080 i32.gt_u if local.get $0 @@ -2273,7 +2274,7 @@ local.get $2 call $~lib/memory/memory.copy local.get $1 - i32.const 10032 + i32.const 10080 i32.ge_u if local.get $1 @@ -3864,7 +3865,7 @@ i32.eqz if i32.const 0 - i32.const 5040 + i32.const 5088 i32.const 1398 i32.const 5 call $~lib/builtins/abort @@ -5992,7 +5993,7 @@ local.get $0 call $~lib/rt/pure/__retain local.tee $2 - i32.const 6176 + i32.const 6224 local.get $2 select local.set $3 @@ -6004,13 +6005,13 @@ i32.eqz if local.get $0 - i32.const 6176 + i32.const 6224 i32.ne if local.get $0 call $~lib/rt/pure/__release end - i32.const 6176 + i32.const 6224 local.set $0 end local.get $3 @@ -6029,7 +6030,7 @@ if local.get $0 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 br $__inlined_func$~lib/string/String#concat end local.get $1 @@ -6101,7 +6102,7 @@ local.tee $3 i32.eqz if - i32.const 6064 + i32.const 6112 return end i32.const 0 @@ -6138,7 +6139,7 @@ (local $7 i32) (local $8 i32) (local $9 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $3 local.get $1 @@ -6150,14 +6151,14 @@ if local.get $3 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $4 i32.eqz if - i32.const 6240 - i32.const 6272 + i32.const 6288 + i32.const 6320 local.get $0 i32.load8_u select @@ -6201,8 +6202,8 @@ i32.const 1 i32.shl i32.add - i32.const 6240 - i32.const 6272 + i32.const 6288 + i32.const 6320 local.get $9 select local.get $7 @@ -6251,8 +6252,8 @@ i32.const 1 i32.shl i32.add - i32.const 6240 - i32.const 6272 + i32.const 6288 + i32.const 6320 local.get $4 select local.get $0 @@ -6355,7 +6356,7 @@ local.get $0 i32.eqz if - i32.const 6608 + i32.const 6656 return end local.get $0 @@ -6451,7 +6452,7 @@ if local.get $2 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $4 @@ -6574,7 +6575,7 @@ local.get $0 i32.eqz if - i32.const 6608 + i32.const 6656 return end local.get $0 @@ -6630,7 +6631,7 @@ if local.get $2 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $4 @@ -6948,7 +6949,7 @@ local.get $4 i32.const 2 i32.shl - i32.const 8056 + i32.const 8104 i32.add i64.load32_u local.get $10 @@ -7076,7 +7077,7 @@ i32.sub i32.const 2 i32.shl - i32.const 8056 + i32.const 8104 i32.add i64.load32_u i64.mul @@ -7497,14 +7498,14 @@ i32.sub global.set $~lib/util/number/_K local.get $9 - i32.const 7184 + i32.const 7232 i32.add i64.load global.set $~lib/util/number/_frc_pow local.get $4 i32.const 1 i32.shl - i32.const 7880 + i32.const 7928 i32.add i32.load16_s global.set $~lib/util/number/_exp_pow @@ -7752,7 +7753,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) - i32.const 7024 + i32.const 7072 call $~lib/rt/pure/__retain local.set $3 local.get $1 @@ -7764,7 +7765,7 @@ if local.get $3 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $5 @@ -7777,7 +7778,7 @@ f64.const 0 f64.eq if - i32.const 7056 + i32.const 7104 local.set $0 br $__inlined_func$~lib/util/number/dtoa end @@ -7791,12 +7792,12 @@ local.get $4 f64.ne if - i32.const 7088 + i32.const 7136 local.set $0 br $__inlined_func$~lib/util/number/dtoa end - i32.const 7120 i32.const 7168 + i32.const 7216 local.get $4 f64.const 0 f64.lt @@ -7945,7 +7946,7 @@ if local.get $5 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $6 @@ -7964,7 +7965,7 @@ local.get $4 call $~lib/rt/pure/__retain else - i32.const 6064 + i32.const 6112 end local.get $5 call $~lib/rt/pure/__release @@ -7972,7 +7973,7 @@ call $~lib/rt/pure/__release return end - i32.const 6064 + i32.const 6112 local.set $1 local.get $5 call $~lib/string/String#get:length @@ -8130,7 +8131,7 @@ if local.get $6 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $7 @@ -8148,13 +8149,13 @@ call $~lib/rt/pure/__release local.get $4 call $~lib/rt/pure/__release - i32.const 8272 - i32.const 6064 + i32.const 8320 + i32.const 6112 local.get $4 select return end - i32.const 6064 + i32.const 6112 local.set $1 local.get $6 call $~lib/string/String#get:length @@ -8185,7 +8186,7 @@ if local.get $1 local.tee $5 - i32.const 8272 + i32.const 8320 call $~lib/string/String.__concat local.tee $1 local.tee $2 @@ -8252,7 +8253,7 @@ if local.get $1 local.tee $2 - i32.const 8272 + i32.const 8320 call $~lib/string/String.__concat local.tee $4 local.tee $3 @@ -8281,9 +8282,9 @@ i32.load offset=4 local.get $0 i32.load offset=12 - i32.const 6304 + i32.const 6352 call $~lib/util/string/joinReferenceArray - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release ) (func $~lib/util/number/itoa_buffered (param $0 i32) (param $1 i32) (result i32) @@ -8354,7 +8355,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $3 local.get $1 @@ -8366,7 +8367,7 @@ if local.get $3 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $4 @@ -8503,7 +8504,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $3 local.get $1 @@ -8515,7 +8516,7 @@ if local.get $3 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $4 @@ -8741,7 +8742,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $3 local.get $1 @@ -8753,14 +8754,14 @@ if local.get $3 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $4 i32.eqz if block $__inlined_func$~lib/util/number/utoa64 (result i32) - i32.const 6608 + i32.const 6656 local.get $0 i64.load local.tee $5 @@ -8964,7 +8965,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $4 local.get $1 @@ -8976,14 +8977,14 @@ if local.get $4 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $5 i32.eqz if block $__inlined_func$~lib/util/number/itoa64 (result i32) - i32.const 6608 + i32.const 6656 local.get $0 i64.load i32.wrap_i64 @@ -9150,7 +9151,7 @@ (local $7 i32) (local $8 i32) (local $9 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $5 local.get $1 @@ -9162,7 +9163,7 @@ if local.get $5 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $6 @@ -9179,10 +9180,10 @@ local.get $4 if (result i32) local.get $4 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join else - i32.const 6064 + i32.const 6112 end local.get $5 call $~lib/rt/pure/__release @@ -9190,7 +9191,7 @@ call $~lib/rt/pure/__release return end - i32.const 6064 + i32.const 6112 local.set $1 local.get $5 call $~lib/string/String#get:length @@ -9220,7 +9221,7 @@ local.get $3 if local.get $3 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $2 local.get $1 @@ -9289,7 +9290,7 @@ local.get $2 if local.get $2 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $0 local.get $1 @@ -9366,7 +9367,7 @@ if local.get $2 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $4 @@ -9471,9 +9472,9 @@ i32.load offset=4 local.get $0 i32.load offset=12 - i32.const 6304 + i32.const 6352 call $~lib/util/string/joinIntegerArray - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release ) (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (param $0 i32) (param $1 i32) (result i32) @@ -9485,7 +9486,7 @@ (local $7 i32) (local $8 i32) (local $9 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $5 local.get $1 @@ -9497,7 +9498,7 @@ if local.get $5 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $6 @@ -9516,7 +9517,7 @@ local.get $4 call $~lib/array/Array#toString else - i32.const 6064 + i32.const 6112 end local.get $5 call $~lib/rt/pure/__release @@ -9524,7 +9525,7 @@ call $~lib/rt/pure/__release return end - i32.const 6064 + i32.const 6112 local.set $1 local.get $5 call $~lib/string/String#get:length @@ -9670,7 +9671,7 @@ if local.get $5 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $6 @@ -9687,10 +9688,10 @@ local.get $4 if (result i32) local.get $4 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join else - i32.const 6064 + i32.const 6112 end local.get $5 call $~lib/rt/pure/__release @@ -9698,7 +9699,7 @@ call $~lib/rt/pure/__release return end - i32.const 6064 + i32.const 6112 local.set $1 local.get $5 call $~lib/string/String#get:length @@ -9728,7 +9729,7 @@ local.get $3 if local.get $3 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $2 local.get $1 @@ -9797,7 +9798,7 @@ local.get $2 if local.get $2 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $0 local.get $1 @@ -9831,9 +9832,9 @@ i32.load offset=4 local.get $0 i32.load offset=12 - i32.const 6304 + i32.const 6352 call $~lib/util/string/joinReferenceArray<~lib/array/Array> - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release ) (func $~lib/util/string/joinReferenceArray<~lib/array/Array<~lib/array/Array>> (param $0 i32) (param $1 i32) (result i32) @@ -9845,7 +9846,7 @@ (local $7 i32) (local $8 i32) (local $9 i32) - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__retain local.set $5 local.get $1 @@ -9857,7 +9858,7 @@ if local.get $5 call $~lib/rt/pure/__release - i32.const 6064 + i32.const 6112 return end local.get $6 @@ -9876,7 +9877,7 @@ local.get $4 call $~lib/array/Array<~lib/array/Array>#toString else - i32.const 6064 + i32.const 6112 end local.get $5 call $~lib/rt/pure/__release @@ -9884,7 +9885,7 @@ call $~lib/rt/pure/__release return end - i32.const 6064 + i32.const 6112 local.set $1 local.get $5 call $~lib/string/String#get:length @@ -13712,7 +13713,7 @@ local.get $0 i32.eqz if - i32.const 0 + i32.const 5040 i32.const 1296 i32.const 440 i32.const 10 @@ -13761,7 +13762,7 @@ local.get $2 i32.eqz if - i32.const 0 + i32.const 5040 i32.const 1296 i32.const 444 i32.const 10 @@ -14971,7 +14972,7 @@ i32.const 8 i32.const 2 i32.const 9 - i32.const 5280 + i32.const 5328 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $4 @@ -15098,7 +15099,7 @@ i32.const 8 i32.const 2 i32.const 9 - i32.const 5328 + i32.const 5376 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $18 @@ -15116,7 +15117,7 @@ i32.const 8 i32.const 3 i32.const 10 - i32.const 5376 + i32.const 5424 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $5 @@ -15243,7 +15244,7 @@ i32.const 8 i32.const 3 i32.const 10 - i32.const 5456 + i32.const 5504 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $12 @@ -15260,7 +15261,7 @@ i32.const 5 i32.const 2 i32.const 3 - i32.const 5536 + i32.const 5584 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $14 @@ -15271,7 +15272,7 @@ i32.const 5 i32.const 2 i32.const 3 - i32.const 5584 + i32.const 5632 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $21 @@ -15289,7 +15290,7 @@ i32.const 5 i32.const 2 i32.const 7 - i32.const 5632 + i32.const 5680 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $15 @@ -15300,7 +15301,7 @@ i32.const 5 i32.const 2 i32.const 7 - i32.const 5680 + i32.const 5728 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $19 @@ -15318,35 +15319,35 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 5728 + i32.const 5776 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $16 i32.const 1 i32.const 2 i32.const 3 - i32.const 5744 + i32.const 5792 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $1 i32.const 2 i32.const 2 i32.const 3 - i32.const 5776 + i32.const 5824 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $2 i32.const 4 i32.const 2 i32.const 3 - i32.const 5808 + i32.const 5856 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $3 i32.const 4 i32.const 2 i32.const 3 - i32.const 5840 + i32.const 5888 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $0 @@ -15373,7 +15374,7 @@ i32.const 1 i32.const 2 i32.const 3 - i32.const 5872 + i32.const 5920 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $22 @@ -15394,7 +15395,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 5904 + i32.const 5952 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $23 @@ -15563,14 +15564,14 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 6080 + i32.const 6128 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $5 i32.const 7 i32.const 2 i32.const 15 - i32.const 6128 + i32.const 6176 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $8 @@ -15720,7 +15721,7 @@ local.set $7 i32.const 0 local.set $6 - i32.const 6064 + i32.const 6112 local.set $0 loop $for-loop|01 local.get $6 @@ -15728,16 +15729,16 @@ i32.lt_s if block $__inlined_func$~lib/string/String#charAt (result i32) - i32.const 6064 + i32.const 6112 call $~lib/math/NativeMath.random - i32.const 5088 + i32.const 5136 call $~lib/string/String#get:length f64.convert_i32_s f64.mul f64.floor i32.trunc_f64_s local.tee $2 - i32.const 5088 + i32.const 5136 call $~lib/string/String#get:length i32.ge_u br_if $__inlined_func$~lib/string/String#charAt @@ -15749,7 +15750,7 @@ local.get $2 i32.const 1 i32.shl - i32.const 5088 + i32.const 5136 i32.add i32.load16_u i32.store16 @@ -15808,7 +15809,7 @@ i32.const 2 i32.const 0 i32.const 17 - i32.const 6208 + i32.const 6256 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $0 @@ -15817,10 +15818,10 @@ i32.load offset=12 call $~lib/util/string/joinBooleanArray local.set $1 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $1 - i32.const 6336 + i32.const 6384 call $~lib/string/String.__eq i32.eqz if @@ -15834,14 +15835,14 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 6384 + i32.const 6432 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $6 - i32.const 6064 + i32.const 6112 call $~lib/array/Array#join local.tee $8 - i32.const 6736 + i32.const 6784 call $~lib/string/String.__eq i32.eqz if @@ -15855,14 +15856,14 @@ i32.const 3 i32.const 2 i32.const 7 - i32.const 6768 + i32.const 6816 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $7 - i32.const 6800 + i32.const 6848 call $~lib/array/Array#join local.tee $10 - i32.const 6736 + i32.const 6784 call $~lib/string/String.__eq i32.eqz if @@ -15876,14 +15877,14 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 6832 + i32.const 6880 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $14 - i32.const 6864 + i32.const 6912 call $~lib/array/Array#join local.tee $15 - i32.const 6896 + i32.const 6944 call $~lib/string/String.__eq i32.eqz if @@ -15897,7 +15898,7 @@ i32.const 6 i32.const 3 i32.const 10 - i32.const 6960 + i32.const 7008 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $2 @@ -15906,10 +15907,10 @@ i32.load offset=12 call $~lib/util/string/joinFloatArray local.set $3 - i32.const 7024 + i32.const 7072 call $~lib/rt/pure/__release local.get $3 - i32.const 8112 + i32.const 8160 call $~lib/string/String.__eq i32.eqz if @@ -15923,14 +15924,14 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 8240 + i32.const 8288 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $16 - i32.const 6064 + i32.const 6112 call $~lib/array/Array<~lib/string/String | null>#join local.tee $17 - i32.const 8208 + i32.const 8256 call $~lib/string/String.__eq i32.eqz if @@ -15963,7 +15964,7 @@ local.get $4 call $~lib/array/Array#join local.tee $18 - i32.const 8320 + i32.const 8368 call $~lib/string/String.__eq i32.eqz if @@ -15993,7 +15994,7 @@ local.get $5 call $~lib/array/Array#join local.tee $12 - i32.const 8400 + i32.const 8448 call $~lib/string/String.__eq i32.eqz if @@ -16039,37 +16040,37 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 8480 + i32.const 8528 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $3 i32.const 1 i32.const 2 i32.const 3 - i32.const 8496 + i32.const 8544 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $4 i32.const 2 i32.const 2 i32.const 3 - i32.const 8528 + i32.const 8576 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $5 i32.const 4 i32.const 2 i32.const 3 - i32.const 8560 + i32.const 8608 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $6 local.get $3 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $0 local.get $0 - i32.const 6064 + i32.const 6112 call $~lib/string/String.__eq i32.eqz if @@ -16081,12 +16082,12 @@ unreachable end local.get $4 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $0 local.set $23 local.get $0 - i32.const 8208 + i32.const 8256 call $~lib/string/String.__eq i32.eqz if @@ -16098,12 +16099,12 @@ unreachable end local.get $5 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $0 local.set $26 local.get $0 - i32.const 8592 + i32.const 8640 call $~lib/string/String.__eq i32.eqz if @@ -16115,12 +16116,12 @@ unreachable end local.get $6 - i32.const 6304 + i32.const 6352 call $~lib/array/Array#join local.tee $0 local.set $27 local.get $0 - i32.const 8624 + i32.const 8672 call $~lib/string/String.__eq i32.eqz if @@ -16134,7 +16135,7 @@ i32.const 3 i32.const 0 i32.const 18 - i32.const 8656 + i32.const 8704 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $8 @@ -16143,10 +16144,10 @@ i32.load offset=12 call $~lib/util/string/joinIntegerArray local.set $7 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $7 - i32.const 8688 + i32.const 8736 call $~lib/string/String.__eq i32.eqz if @@ -16160,7 +16161,7 @@ i32.const 3 i32.const 1 i32.const 19 - i32.const 8720 + i32.const 8768 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $10 @@ -16169,10 +16170,10 @@ i32.load offset=12 call $~lib/util/string/joinIntegerArray local.set $14 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $14 - i32.const 8752 + i32.const 8800 call $~lib/string/String.__eq i32.eqz if @@ -16186,7 +16187,7 @@ i32.const 3 i32.const 3 i32.const 20 - i32.const 8800 + i32.const 8848 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $15 @@ -16195,10 +16196,10 @@ i32.load offset=12 call $~lib/util/string/joinIntegerArray local.set $16 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $16 - i32.const 8848 + i32.const 8896 call $~lib/string/String.__eq i32.eqz if @@ -16212,7 +16213,7 @@ i32.const 4 i32.const 3 i32.const 21 - i32.const 8912 + i32.const 8960 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $17 @@ -16221,10 +16222,10 @@ i32.load offset=12 call $~lib/util/string/joinIntegerArray local.set $18 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $18 - i32.const 8960 + i32.const 9008 call $~lib/string/String.__eq i32.eqz if @@ -16238,16 +16239,16 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 9072 + i32.const 9120 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $29 - i32.const 6304 + i32.const 6352 call $~lib/array/Array<~lib/string/String | null>#join local.tee $0 local.set $30 local.get $0 - i32.const 9120 + i32.const 9168 call $~lib/string/String.__eq i32.eqz if @@ -16261,16 +16262,16 @@ i32.const 4 i32.const 2 i32.const 15 - i32.const 9232 + i32.const 9280 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $31 - i32.const 6304 + i32.const 6352 call $~lib/array/Array<~lib/string/String | null>#join local.tee $0 local.set $32 local.get $0 - i32.const 9264 + i32.const 9312 call $~lib/string/String.__eq i32.eqz if @@ -16293,7 +16294,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 9296 + i32.const 9344 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -16301,7 +16302,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 9328 + i32.const 9376 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -16311,10 +16312,10 @@ i32.load offset=12 call $~lib/util/string/joinReferenceArray<~lib/array/Array> local.set $12 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $12 - i32.const 9360 + i32.const 9408 call $~lib/string/String.__eq i32.eqz if @@ -16337,7 +16338,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 9392 + i32.const 9440 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -16345,7 +16346,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 9424 + i32.const 9472 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -16355,10 +16356,10 @@ i32.load offset=12 call $~lib/util/string/joinReferenceArray<~lib/array/Array> local.set $21 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $21 - i32.const 9360 + i32.const 9408 call $~lib/string/String.__eq i32.eqz if @@ -16388,7 +16389,7 @@ i32.const 1 i32.const 2 i32.const 7 - i32.const 9456 + i32.const 9504 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -16400,10 +16401,10 @@ i32.load offset=12 call $~lib/util/string/joinReferenceArray<~lib/array/Array<~lib/array/Array>> local.set $19 - i32.const 6304 + i32.const 6352 call $~lib/rt/pure/__release local.get $19 - i32.const 8208 + i32.const 8256 call $~lib/string/String.__eq i32.eqz if @@ -16473,7 +16474,7 @@ i32.const 1 i32.const 2 i32.const 3 - i32.const 9488 + i32.const 9536 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -16481,7 +16482,7 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 9520 + i32.const 9568 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -16489,7 +16490,7 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 9552 + i32.const 9600 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=8 @@ -16497,7 +16498,7 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 9584 + i32.const 9632 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=12 @@ -16552,7 +16553,7 @@ i32.const 1 i32.const 2 i32.const 15 - i32.const 9648 + i32.const 9696 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -16560,7 +16561,7 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 9744 + i32.const 9792 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -16568,7 +16569,7 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 9872 + i32.const 9920 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=8 @@ -16576,7 +16577,7 @@ i32.const 1 i32.const 2 i32.const 15 - i32.const 9936 + i32.const 9984 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=12 @@ -16586,7 +16587,7 @@ i32.const 8 i32.const 2 i32.const 15 - i32.const 9968 + i32.const 10016 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $4 @@ -16651,7 +16652,7 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 10016 + i32.const 10064 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -16659,7 +16660,7 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 10032 + i32.const 10080 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -16841,7 +16842,7 @@ ) (func $~lib/rt/pure/__visit (param $0 i32) local.get $0 - i32.const 10032 + i32.const 10080 i32.lt_u if return diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 78b9155739..39469f021b 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -133,108 +133,109 @@ (data (i32.const 3840) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00") (data (i32.const 3888) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 3904) "^\00\00\00\01\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00") - (data (i32.const 4016) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") - (data (i32.const 4064) "\ac\00\00\00\01\00\00\00\01\00\00\00\ac\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?\00") - (data (i32.const 4256) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") - (data (i32.const 4304) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") - (data (i32.const 4352) "@\00\00\00\01\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") - (data (i32.const 4432) "@\00\00\00\01\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") - (data (i32.const 4512) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00") - (data (i32.const 4560) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 4608) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00") - (data (i32.const 4656) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") - (data (i32.const 4704) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4720) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") - (data (i32.const 4752) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01\00\00\00") - (data (i32.const 4784) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 4816) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 4848) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") - (data (i32.const 4880) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 4912) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") - (data (i32.const 4944) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b\00") - (data (i32.const 4976) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b\00") - (data (i32.const 5008) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a\00") - (data (i32.const 5040) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 5056) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00@\13\00\00`\13\00\00@\13\00\00\80\13\00\00\a0\13\00\00\c0\13\00\00\00\00\00\00") - (data (i32.const 5104) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\c0\13\00\00@\13\00\00@\13\00\00\80\13\00\00`\13\00\00\a0\13\00\00\00\00\00\00") - (data (i32.const 5152) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") - (data (i32.const 5184) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\00") - (data (i32.const 5216) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e\00") - (data (i32.const 5248) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e\00") - (data (i32.const 5280) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,\00") - (data (i32.const 5312) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") - (data (i32.const 5360) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") - (data (i32.const 5392) "d\00\00\00\01\00\00\00\01\00\00\00d\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00(\00)\00 \00r\00a\00d\00i\00x\00 \00a\00r\00g\00u\00m\00e\00n\00t\00 \00m\00u\00s\00t\00 \00b\00e\00 \00b\00e\00t\00w\00e\00e\00n\00 \002\00 \00a\00n\00d\00 \003\006\00") - (data (i32.const 5520) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00n\00u\00m\00b\00e\00r\00.\00t\00s\00") - (data (i32.const 5584) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000\00") - (data (i32.const 5604) "0\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") - (data (i32.const 6016) "\00\04\00\00\01\00\00\00\01\00\00\00\00\04\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\000\00a\000\00b\000\00c\000\00d\000\00e\000\00f\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\001\00a\001\00b\001\00c\001\00d\001\00e\001\00f\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\002\00a\002\00b\002\00c\002\00d\002\00e\002\00f\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\003\00a\003\00b\003\00c\003\00d\003\00e\003\00f\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\004\00a\004\00b\004\00c\004\00d\004\00e\004\00f\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\005\00a\005\00b\005\00c\005\00d\005\00e\005\00f\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\006\00a\006\00b\006\00c\006\00d\006\00e\006\00f\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\007\00a\007\00b\007\00c\007\00d\007\00e\007\00f\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\008\00a\008\00b\008\00c\008\00d\008\00e\008\00f\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\009\00a\009\00b\009\00c\009\00d\009\00e\009\00f\00a\000\00a\001\00a\002\00a\003\00a\004\00a\005\00a\006\00a\007\00a\008\00a\009\00a\00a\00a\00b\00a\00c\00a\00d\00a\00e\00a\00f\00b\000\00b\001\00b\002\00b\003\00b\004\00b\005\00b\006\00b\007\00b\008\00b\009\00b\00a\00b\00b\00b\00c\00b\00d\00b\00e\00b\00f\00c\000\00c\001\00c\002\00c\003\00c\004\00c\005\00c\006\00c\007\00c\008\00c\009\00c\00a\00c\00b\00c\00c\00c\00d\00c\00e\00c\00f\00d\000\00d\001\00d\002\00d\003\00d\004\00d\005\00d\006\00d\007\00d\008\00d\009\00d\00a\00d\00b\00d\00c\00d\00d\00d\00e\00d\00f\00e\000\00e\001\00e\002\00e\003\00e\004\00e\005\00e\006\00e\007\00e\008\00e\009\00e\00a\00e\00b\00e\00c\00e\00d\00e\00e\00e\00f\00f\000\00f\001\00f\002\00f\003\00f\004\00f\005\00f\006\00f\007\00f\008\00f\009\00f\00a\00f\00b\00f\00c\00f\00d\00f\00e\00f\00f\00") - (data (i32.const 7056) "H\00\00\00\01\00\00\00\01\00\00\00H\00\00\000\001\002\003\004\005\006\007\008\009\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\00") - (data (i32.const 7152) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003\00") - (data (i32.const 7184) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 7216) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-\00") - (data (i32.const 7248) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") - (data (i32.const 7280) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_\00") - (data (i32.const 7312) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") - (data (i32.const 7376) "0\00\00\00\01\00\00\00\00\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") - (data (i32.const 7440) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 \00") - (data (i32.const 7472) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000\00") - (data (i32.const 7504) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00") - (data (i32.const 7536) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 7584) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") - (data (i32.const 7616) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00") - (data (i32.const 8896) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 8912) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") - (data (i32.const 8944) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 8976) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 9008) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002\00") - (data (i32.const 9040) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003\00") - (data (i32.const 9072) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff\00") - (data (i32.const 9104) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000\00") - (data (i32.const 9136) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff\00\00") - (data (i32.const 9168) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000\00") - (data (i32.const 9216) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\00\00\00\00") - (data (i32.const 9264) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000\00") - (data (i32.const 9328) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") - (data (i32.const 9376) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007\00") - (data (i32.const 9488) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\c0\13\00\00@\13\00\00@\13\00\00\80\13\00\00`\13\00\00\a0\13\00\00\00\00\00\00") - (data (i32.const 9536) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,\00") - (data (i32.const 9584) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002\00") - (data (i32.const 9616) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004\00") - (data (i32.const 9648) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\c0!\00\00\80%\00\00\00\00\00\00\a0%\00\00") - (data (i32.const 9680) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004\00") - (data (i32.const 9712) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") - (data (i32.const 9744) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04\00\00\00") - (data (i32.const 9776) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004\00") - (data (i32.const 9808) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") - (data (i32.const 9840) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") - (data (i32.const 9872) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") - (data (i32.const 9904) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00") - (data (i32.const 9936) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") - (data (i32.const 9968) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00") - (data (i32.const 10000) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\07\00\00\00\08\00\00\00\t\00\00\00") - (data (i32.const 10032) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00o\00n\00e\00") - (data (i32.const 10064) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00@\'\00\00") - (data (i32.const 10096) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00t\00w\00o\00") - (data (i32.const 10128) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00t\00h\00r\00e\00e\00") - (data (i32.const 10160) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\80\'\00\00\00\00\00\00\a0\'\00\00") - (data (i32.const 10192) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00o\00u\00r\00") - (data (i32.const 10224) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00i\00v\00e\00") - (data (i32.const 10256) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00s\00i\00x\00") - (data (i32.const 10288) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\e0\'\00\00\00(\00\00 (\00\00") - (data (i32.const 10320) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00e\00v\00e\00n\00") - (data (i32.const 10352) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00`(\00\00") - (data (i32.const 10384) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00@\'\00\00\80\'\00\00\00\00\00\00\a0\'\00\00\e0\'\00\00\00(\00\00 (\00\00`(\00\00") - (data (i32.const 10432) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 10448) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 4016) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00") + (data (i32.const 4064) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00") + (data (i32.const 4112) "\ac\00\00\00\01\00\00\00\01\00\00\00\ac\00\00\00A\00B\00C\00D\00E\00F\00G\00H\00I\00J\00K\00L\00M\00N\00O\00P\00Q\00R\00S\00T\00U\00V\00W\00X\00Y\00Z\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\000\001\002\003\004\005\006\007\008\009\00_\00-\00,\00.\00+\00/\00\\\00[\00]\00{\00}\00(\00)\00<\00>\00*\00&\00$\00%\00^\00@\00#\00!\00?\00") + (data (i32.const 4304) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80?\00\00\c0\7f\00\00\80\ff\00\00\80?\00\00\00\00\00\00\80\bf\00\00\00\c0\00\00\80\7f") + (data (i32.const 4352) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\80\ff\00\00\00\c0\00\00\80\bf\00\00\00\00\00\00\80?\00\00\80?\00\00\80\7f\00\00\c0\7f") + (data (i32.const 4400) "@\00\00\00\01\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\05\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\7f") + (data (i32.const 4480) "@\00\00\00\01\00\00\00\00\00\00\00@\00\00\00\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f0\bf\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\05\00\00\00\00\00\f0?\00\00\00\00\00\00\f0\7f\00\00\00\00\00\00\f8\7f") + (data (i32.const 4560) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 4608) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 4656) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\01\00\00\00\ff\ff\ff\ff\fe\ff\ff\ff\00\00\00\00\02\00\00\00") + (data (i32.const 4704) "\14\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\fe\ff\ff\ff\ff\ff\ff\ff") + (data (i32.const 4752) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 4768) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 4800) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\02\00\00\00\01\00\00\00") + (data (i32.const 4832) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\03\00\00\00\02\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 4864) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 4896) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 4928) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 4960) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00a\00") + (data (i32.const 4992) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00b\00") + (data (i32.const 5024) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00a\00b\00") + (data (i32.const 5056) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00b\00a\00") + (data (i32.const 5088) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 5104) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00p\13\00\00\90\13\00\00p\13\00\00\b0\13\00\00\d0\13\00\00\f0\13\00\00\00\00\00\00") + (data (i32.const 5152) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\f0\13\00\00p\13\00\00p\13\00\00\b0\13\00\00\90\13\00\00\d0\13\00\00\00\00\00\00") + (data (i32.const 5200) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 5232) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\00") + (data (i32.const 5264) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00r\00u\00e\00") + (data (i32.const 5296) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e\00") + (data (i32.const 5328) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00,\00") + (data (i32.const 5360) "\14\00\00\00\01\00\00\00\01\00\00\00\14\00\00\00t\00r\00u\00e\00,\00f\00a\00l\00s\00e\00") + (data (i32.const 5408) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\fe\ff\ff\ff\fd\ff\ff\ff") + (data (i32.const 5440) "d\00\00\00\01\00\00\00\01\00\00\00d\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00(\00)\00 \00r\00a\00d\00i\00x\00 \00a\00r\00g\00u\00m\00e\00n\00t\00 \00m\00u\00s\00t\00 \00b\00e\00 \00b\00e\00t\00w\00e\00e\00n\00 \002\00 \00a\00n\00d\00 \003\006\00") + (data (i32.const 5568) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00u\00t\00i\00l\00/\00n\00u\00m\00b\00e\00r\00.\00t\00s\00") + (data (i32.const 5632) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\000\00") + (data (i32.const 5652) "0\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") + (data (i32.const 6064) "\00\04\00\00\01\00\00\00\01\00\00\00\00\04\00\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\000\00a\000\00b\000\00c\000\00d\000\00e\000\00f\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\001\00a\001\00b\001\00c\001\00d\001\00e\001\00f\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\002\00a\002\00b\002\00c\002\00d\002\00e\002\00f\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\003\00a\003\00b\003\00c\003\00d\003\00e\003\00f\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\004\00a\004\00b\004\00c\004\00d\004\00e\004\00f\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\005\00a\005\00b\005\00c\005\00d\005\00e\005\00f\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\006\00a\006\00b\006\00c\006\00d\006\00e\006\00f\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\007\00a\007\00b\007\00c\007\00d\007\00e\007\00f\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\008\00a\008\00b\008\00c\008\00d\008\00e\008\00f\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\009\00a\009\00b\009\00c\009\00d\009\00e\009\00f\00a\000\00a\001\00a\002\00a\003\00a\004\00a\005\00a\006\00a\007\00a\008\00a\009\00a\00a\00a\00b\00a\00c\00a\00d\00a\00e\00a\00f\00b\000\00b\001\00b\002\00b\003\00b\004\00b\005\00b\006\00b\007\00b\008\00b\009\00b\00a\00b\00b\00b\00c\00b\00d\00b\00e\00b\00f\00c\000\00c\001\00c\002\00c\003\00c\004\00c\005\00c\006\00c\007\00c\008\00c\009\00c\00a\00c\00b\00c\00c\00c\00d\00c\00e\00c\00f\00d\000\00d\001\00d\002\00d\003\00d\004\00d\005\00d\006\00d\007\00d\008\00d\009\00d\00a\00d\00b\00d\00c\00d\00d\00d\00e\00d\00f\00e\000\00e\001\00e\002\00e\003\00e\004\00e\005\00e\006\00e\007\00e\008\00e\009\00e\00a\00e\00b\00e\00c\00e\00d\00e\00e\00e\00f\00f\000\00f\001\00f\002\00f\003\00f\004\00f\005\00f\006\00f\007\00f\008\00f\009\00f\00a\00f\00b\00f\00c\00f\00d\00f\00e\00f\00f\00") + (data (i32.const 7104) "H\00\00\00\01\00\00\00\01\00\00\00H\00\00\000\001\002\003\004\005\006\007\008\009\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\00") + (data (i32.const 7200) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\001\00-\002\00-\003\00") + (data (i32.const 7232) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 7264) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00-\00") + (data (i32.const 7296) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\80\00\00\00\80") + (data (i32.const 7328) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00_\00_\00") + (data (i32.const 7360) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\00-\002\001\004\007\004\008\003\006\004\008\00_\00_\00-\002\001\004\007\004\008\003\006\004\008\00") + (data (i32.const 7424) "0\00\00\00\01\00\00\00\00\00\00\000\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\c0\00\00\00\00\00\00\f8\7f\00\00\00\00\00\00\f0\ff\00\00\00\00\00\00\f0\7f") + (data (i32.const 7488) "\04\00\00\00\01\00\00\00\01\00\00\00\04\00\00\00,\00 \00") + (data (i32.const 7520) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\000\00.\000\00") + (data (i32.const 7552) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00") + (data (i32.const 7584) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 7632) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00") + (data (i32.const 7664) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8\00\00\00\01\00\00\00\01\00\00\00>\00\00\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00,\00[\00o\00b\00j\00e\00c\00t\00 \00O\00b\00j\00e\00c\00t\00]\00") + (data (i32.const 8944) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 8960) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 8992) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 9024) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 9056) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\001\00,\002\00") + (data (i32.const 9088) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\000\00,\001\00,\002\00,\003\00") + (data (i32.const 9120) "\03\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\01\ff\00") + (data (i32.const 9152) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\00-\001\00,\000\00") + (data (i32.const 9184) "\06\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\01\00\ff\ff\00\00") + (data (i32.const 9216) "\12\00\00\00\01\00\00\00\01\00\00\00\12\00\00\001\00,\006\005\005\003\005\00,\000\00") + (data (i32.const 9264) "\18\00\00\00\01\00\00\00\00\00\00\00\18\00\00\00\01\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\ff\00\00\00\00\00\00\00\00") + (data (i32.const 9312) "0\00\00\00\01\00\00\00\01\00\00\000\00\00\001\00,\001\008\004\004\006\007\004\004\000\007\003\007\000\009\005\005\001\006\001\005\00,\000\00") + (data (i32.const 9376) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00\ff\ff\ff\ff\ff\ff\ff\ff@Eu\c3*\9d\fb\ff\00\00\00\00\00\00\00\00\ff\ff\ff\ff\ff\ff\ff\7f") + (data (i32.const 9424) "T\00\00\00\01\00\00\00\01\00\00\00T\00\00\00-\001\00,\00-\001\002\003\004\005\006\007\008\009\000\001\002\003\004\005\006\00,\000\00,\009\002\002\003\003\007\002\000\003\006\008\005\004\007\007\005\008\000\007\00") + (data (i32.const 9536) "\1c\00\00\00\01\00\00\00\00\00\00\00\1c\00\00\00\f0\13\00\00p\13\00\00p\13\00\00\b0\13\00\00\90\13\00\00\d0\13\00\00\00\00\00\00") + (data (i32.const 9584) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00,\00a\00,\00a\00,\00a\00b\00,\00b\00,\00b\00a\00,\00") + (data (i32.const 9632) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\002\00") + (data (i32.const 9664) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\004\00") + (data (i32.const 9696) "\10\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\f0!\00\00\b0%\00\00\00\00\00\00\d0%\00\00") + (data (i32.const 9728) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\001\00,\002\00,\00,\004\00") + (data (i32.const 9760) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00") + (data (i32.const 9792) "\08\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\03\00\00\00\04\00\00\00") + (data (i32.const 9824) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\001\00,\002\00,\003\00,\004\00") + (data (i32.const 9856) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\01\02") + (data (i32.const 9888) "\02\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\03\04") + (data (i32.const 9920) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\01\00\00\00") + (data (i32.const 9952) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00") + (data (i32.const 9984) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") + (data (i32.const 10016) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00") + (data (i32.const 10048) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\07\00\00\00\08\00\00\00\t\00\00\00") + (data (i32.const 10080) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00o\00n\00e\00") + (data (i32.const 10112) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00p\'\00\00") + (data (i32.const 10144) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00t\00w\00o\00") + (data (i32.const 10176) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00t\00h\00r\00e\00e\00") + (data (i32.const 10208) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\b0\'\00\00\00\00\00\00\d0\'\00\00") + (data (i32.const 10240) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00o\00u\00r\00") + (data (i32.const 10272) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00f\00i\00v\00e\00") + (data (i32.const 10304) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00s\00i\00x\00") + (data (i32.const 10336) "\0c\00\00\00\01\00\00\00\00\00\00\00\0c\00\00\00\10(\00\000(\00\00P(\00\00") + (data (i32.const 10368) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00e\00v\00e\00n\00") + (data (i32.const 10400) "\04\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\90(\00\00") + (data (i32.const 10432) " \00\00\00\01\00\00\00\00\00\00\00 \00\00\00p\'\00\00\b0\'\00\00\00\00\00\00\d0\'\00\00\10(\00\000(\00\00P(\00\00\90(\00\00") + (data (i32.const 10480) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 10496) "\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") (table $0 57 funcref) (elem (i32.const 1) $start:std/array~anonymous|0 $start:std/array~anonymous|1 $start:std/array~anonymous|2 $start:std/array~anonymous|3 $start:std/array~anonymous|4 $start:std/array~anonymous|5 $start:std/array~anonymous|6 $start:std/array~anonymous|7 $start:std/array~anonymous|8 $start:std/array~anonymous|9 $start:std/array~anonymous|10 $start:std/array~anonymous|11 $start:std/array~anonymous|12 $start:std/array~anonymous|13 $start:std/array~anonymous|14 $start:std/array~anonymous|15 $start:std/array~anonymous|16 $start:std/array~anonymous|17 $start:std/array~anonymous|18 $start:std/array~anonymous|19 $start:std/array~anonymous|20 $start:std/array~anonymous|21 $start:std/array~anonymous|22 $start:std/array~anonymous|23 $start:std/array~anonymous|24 $start:std/array~anonymous|25 $start:std/array~anonymous|26 $start:std/array~anonymous|27 $start:std/array~anonymous|28 $start:std/array~anonymous|29 $start:std/array~anonymous|30 $start:std/array~anonymous|31 $start:std/array~anonymous|32 $start:std/array~anonymous|33 $start:std/array~anonymous|34 $start:std/array~anonymous|35 $start:std/array~anonymous|36 $start:std/array~anonymous|37 $start:std/array~anonymous|38 $start:std/array~anonymous|39 $start:std/array~anonymous|40 $start:std/array~anonymous|41 $start:std/array~anonymous|42 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|0 $~lib/util/sort/COMPARATOR~anonymous|1 $start:std/array~anonymous|43 $start:std/array~anonymous|44 $start:std/array~anonymous|45 $start:std/array~anonymous|46 $start:std/array~anonymous|47 $start:std/array~anonymous|48 $~lib/util/sort/COMPARATOR<~lib/string/String | null>~anonymous|0 $~lib/util/sort/COMPARATOR<~lib/string/String>~anonymous|0) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -251,7 +252,7 @@ (global $~lib/math/random_state1_64 (mut i64) (i64.const 0)) (global $~lib/math/random_state0_32 (mut i32) (i32.const 0)) (global $~lib/math/random_state1_32 (mut i32) (i32.const 0)) - (global $std/array/charset i32 (i32.const 4080)) + (global $std/array/charset i32 (i32.const 4128)) (global $~lib/builtins/i32.MIN_VALUE i32 (i32.const -2147483648)) (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) @@ -262,7 +263,7 @@ (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) (global $~lib/builtins/i64.MAX_VALUE i64 (i64.const 9223372036854775807)) (global $~started (mut i32) (i32.const 0)) - (global $~lib/heap/__heap_base i32 (i32.const 10464)) + (global $~lib/heap/__heap_base i32 (i32.const 10512)) (export "_start" (func $~start)) (export "memory" (memory $0)) (func $~lib/rt/pure/__release (param $0 i32) @@ -7174,7 +7175,7 @@ i32.eqz if i32.const 0 - i32.const 4032 + i32.const 4080 i32.const 1398 i32.const 5 call $~lib/builtins/abort @@ -11618,7 +11619,7 @@ call $~lib/string/String#get:length i32.ge_u if - i32.const 5056 + i32.const 5104 call $~lib/rt/pure/__retain return end @@ -11651,7 +11652,7 @@ i32.const 0 i32.eq if - i32.const 5168 + i32.const 5216 local.tee $2 local.get $1 local.tee $3 @@ -11684,7 +11685,7 @@ i32.const 0 i32.eq if - i32.const 5056 + i32.const 5104 call $~lib/rt/pure/__retain local.set $2 local.get $1 @@ -11722,7 +11723,7 @@ call $~lib/rt/pure/__retain local.set $1 local.get $0 - i32.const 5168 + i32.const 5216 local.get $0 i32.const 0 i32.ne @@ -11745,7 +11746,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) - i32.const 5056 + i32.const 5104 local.set $1 i32.const 0 local.set $2 @@ -12425,7 +12426,7 @@ local.get $10 i32.eqz if - i32.const 5056 + i32.const 5104 call $~lib/rt/pure/__retain return end @@ -12480,7 +12481,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -12490,8 +12491,8 @@ local.get $3 i32.eqz if - i32.const 5232 - i32.const 5264 + i32.const 5280 + i32.const 5312 local.get $0 i32.load8_u select @@ -12548,8 +12549,8 @@ i32.const 1 i32.shl i32.add - i32.const 5232 - i32.const 5264 + i32.const 5280 + i32.const 5312 local.get $10 select local.get $6 @@ -12599,8 +12600,8 @@ i32.const 1 i32.shl i32.add - i32.const 5232 - i32.const 5264 + i32.const 5280 + i32.const 5312 local.get $10 select local.get $6 @@ -12748,14 +12749,14 @@ i32.const 100 i32.rem_u local.set $7 - i32.const 5604 + i32.const 5652 local.get $6 i32.const 2 i32.shl i32.add i64.load32_u local.set $8 - i32.const 5604 + i32.const 5652 local.get $7 i32.const 2 i32.shl @@ -12798,7 +12799,7 @@ i32.const 2 i32.sub local.set $2 - i32.const 5604 + i32.const 5652 local.get $10 i32.const 2 i32.shl @@ -12821,7 +12822,7 @@ i32.const 2 i32.sub local.set $2 - i32.const 5604 + i32.const 5652 local.get $1 i32.const 2 i32.shl @@ -12871,7 +12872,7 @@ i32.const 1 i32.shl i32.add - i32.const 6032 + i32.const 6080 local.get $1 i32.wrap_i64 i32.const 255 @@ -12893,7 +12894,7 @@ i32.and if local.get $0 - i32.const 6032 + i32.const 6080 local.get $1 i32.wrap_i64 i32.const 6 @@ -13017,7 +13018,7 @@ i32.const 1 i32.shl i32.add - i32.const 7072 + i32.const 7120 local.get $1 local.get $6 i64.and @@ -13053,7 +13054,7 @@ i32.const 1 i32.shl i32.add - i32.const 7072 + i32.const 7120 local.get $1 local.get $6 local.get $4 @@ -13094,8 +13095,8 @@ i32.gt_s end if - i32.const 5408 - i32.const 5536 + i32.const 5456 + i32.const 5584 i32.const 367 i32.const 5 call $~lib/builtins/abort @@ -13104,7 +13105,7 @@ local.get $0 i32.eqz if - i32.const 5600 + i32.const 5648 return end local.get $0 @@ -13319,7 +13320,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -13501,8 +13502,8 @@ i32.gt_s end if - i32.const 5408 - i32.const 5536 + i32.const 5456 + i32.const 5584 i32.const 344 i32.const 5 call $~lib/builtins/abort @@ -13511,7 +13512,7 @@ local.get $0 i32.eqz if - i32.const 5600 + i32.const 5648 return end i32.const 0 @@ -13677,7 +13678,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -14108,7 +14109,7 @@ local.set $22 local.get $18 local.set $21 - i32.const 8488 + i32.const 8536 local.get $13 i32.const 2 i32.shl @@ -14249,7 +14250,7 @@ i32.add global.set $~lib/util/number/_K local.get $10 - i32.const 8488 + i32.const 8536 i32.const 0 local.get $13 i32.sub @@ -14830,14 +14831,14 @@ i32.shl i32.sub global.set $~lib/util/number/_K - i32.const 7616 + i32.const 7664 local.get $14 i32.const 3 i32.shl i32.add i64.load global.set $~lib/util/number/_frc_pow - i32.const 8312 + i32.const 8360 local.get $14 i32.const 1 i32.shl @@ -15101,7 +15102,7 @@ f64.const 0 f64.eq if - i32.const 7488 + i32.const 7536 return end local.get $0 @@ -15115,11 +15116,11 @@ local.get $0 f64.ne if - i32.const 7520 + i32.const 7568 return end - i32.const 7552 i32.const 7600 + i32.const 7648 local.get $0 f64.const 0 f64.lt @@ -15246,7 +15247,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -15426,7 +15427,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -15443,7 +15444,7 @@ local.get $4 call $~lib/rt/pure/__retain else - i32.const 5056 + i32.const 5104 end local.set $4 local.get $2 @@ -15669,7 +15670,7 @@ return ) (func $std/array/Ref#toString (param $0 i32) (result i32) - i32.const 8704 + i32.const 8752 ) (func $~lib/util/string/joinReferenceArray (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -15693,7 +15694,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -15727,7 +15728,7 @@ local.get $5 call $std/array/Ref#toString else - i32.const 5056 + i32.const 5104 end local.set $4 local.get $2 @@ -15737,7 +15738,7 @@ local.get $4 return end - i32.const 5056 + i32.const 5104 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -15941,7 +15942,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -15975,7 +15976,7 @@ local.get $5 call $std/array/Ref#toString else - i32.const 5056 + i32.const 5104 end local.set $4 local.get $2 @@ -15985,7 +15986,7 @@ local.get $4 return end - i32.const 5056 + i32.const 5104 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -16169,7 +16170,7 @@ ) (func $~lib/array/Array#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join ) (func $~lib/util/number/itoa_buffered (param $0 i32) (param $1 i32) (result i32) @@ -16292,7 +16293,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -16459,7 +16460,7 @@ ) (func $~lib/array/Array#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join ) (func $~lib/util/number/itoa_buffered (param $0 i32) (param $1 i32) (result i32) @@ -16546,7 +16547,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -16713,7 +16714,7 @@ ) (func $~lib/array/Array#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join ) (func $~lib/util/number/decimalCount64High (param $0 i64) (result i32) @@ -16831,14 +16832,14 @@ i32.const 100 i32.rem_u local.set $11 - i32.const 5604 + i32.const 5652 local.get $10 i32.const 2 i32.shl i32.add i64.load32_u local.set $12 - i32.const 5604 + i32.const 5652 local.get $11 i32.const 2 i32.shl @@ -16860,14 +16861,14 @@ i64.shl i64.or i64.store - i32.const 5604 + i32.const 5652 local.get $8 i32.const 2 i32.shl i32.add i64.load32_u local.set $12 - i32.const 5604 + i32.const 5652 local.get $9 i32.const 2 i32.shl @@ -16917,8 +16918,8 @@ i32.gt_s end if - i32.const 5408 - i32.const 5536 + i32.const 5456 + i32.const 5584 i32.const 395 i32.const 5 call $~lib/builtins/abort @@ -16929,7 +16930,7 @@ i64.ne i32.eqz if - i32.const 5600 + i32.const 5648 return end i32.const 0 @@ -17157,7 +17158,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -17324,7 +17325,7 @@ ) (func $~lib/array/Array#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join ) (func $~lib/util/number/itoa64 (param $0 i64) (param $1 i32) (result i32) @@ -17347,8 +17348,8 @@ i32.gt_s end if - i32.const 5408 - i32.const 5536 + i32.const 5456 + i32.const 5584 i32.const 425 i32.const 5 call $~lib/builtins/abort @@ -17359,7 +17360,7 @@ i64.ne i32.eqz if - i32.const 5600 + i32.const 5648 return end local.get $0 @@ -17637,7 +17638,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -17806,12 +17807,12 @@ ) (func $~lib/array/Array#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join ) (func $~lib/array/Array<~lib/string/String | null>#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array<~lib/string/String | null>#join ) (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -17836,7 +17837,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -17870,7 +17871,7 @@ local.get $5 call $~lib/array/Array#toString else - i32.const 5056 + i32.const 5104 end local.set $4 local.get $2 @@ -17880,7 +17881,7 @@ local.get $4 return end - i32.const 5056 + i32.const 5104 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -18064,7 +18065,7 @@ ) (func $~lib/array/Array<~lib/array/Array>#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array<~lib/array/Array>#join ) (func $~lib/util/number/itoa_buffered (param $0 i32) (param $1 i32) (result i32) @@ -18151,7 +18152,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -18318,7 +18319,7 @@ ) (func $~lib/array/Array#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join ) (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -18343,7 +18344,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -18377,7 +18378,7 @@ local.get $5 call $~lib/array/Array#toString else - i32.const 5056 + i32.const 5104 end local.set $4 local.get $2 @@ -18387,7 +18388,7 @@ local.get $4 return end - i32.const 5056 + i32.const 5104 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -18571,12 +18572,12 @@ ) (func $~lib/array/Array<~lib/array/Array>#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array<~lib/array/Array>#join ) (func $~lib/array/Array#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join ) (func $~lib/util/string/joinReferenceArray<~lib/array/Array> (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -18601,7 +18602,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -18635,7 +18636,7 @@ local.get $5 call $~lib/array/Array#toString else - i32.const 5056 + i32.const 5104 end local.set $4 local.get $2 @@ -18645,7 +18646,7 @@ local.get $4 return end - i32.const 5056 + i32.const 5104 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -18829,7 +18830,7 @@ ) (func $~lib/array/Array<~lib/array/Array>#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array<~lib/array/Array>#join ) (func $~lib/util/string/joinReferenceArray<~lib/array/Array<~lib/array/Array>> (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -18854,7 +18855,7 @@ i32.const 0 i32.lt_s if - i32.const 5056 + i32.const 5104 local.set $4 local.get $2 call $~lib/rt/pure/__release @@ -18888,7 +18889,7 @@ local.get $5 call $~lib/array/Array<~lib/array/Array>#toString else - i32.const 5056 + i32.const 5104 end local.set $4 local.get $2 @@ -18898,7 +18899,7 @@ local.get $4 return end - i32.const 5056 + i32.const 5104 local.set $7 local.get $2 call $~lib/string/String#get:length @@ -19082,7 +19083,7 @@ ) (func $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString (param $0 i32) (result i32) local.get $0 - i32.const 5296 + i32.const 5344 call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#join ) (func $~lib/array/Array<~lib/array/Array>#flat (param $0 i32) (result i32) @@ -22851,7 +22852,7 @@ if (result i32) local.get $50 else - i32.const 0 + i32.const 4032 i32.const 288 i32.const 440 i32.const 10 @@ -22906,7 +22907,7 @@ if (result i32) local.get $55 else - i32.const 0 + i32.const 4032 i32.const 288 i32.const 444 i32.const 10 @@ -24209,7 +24210,7 @@ i32.const 8 i32.const 2 i32.const 9 - i32.const 4272 + i32.const 4320 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $50 @@ -24223,7 +24224,7 @@ i32.const 8 i32.const 2 i32.const 9 - i32.const 4320 + i32.const 4368 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $51 @@ -24241,7 +24242,7 @@ i32.const 8 i32.const 3 i32.const 10 - i32.const 4368 + i32.const 4416 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $49 @@ -24255,7 +24256,7 @@ i32.const 8 i32.const 3 i32.const 10 - i32.const 4448 + i32.const 4496 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $48 @@ -24273,7 +24274,7 @@ i32.const 5 i32.const 2 i32.const 3 - i32.const 4528 + i32.const 4576 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $47 @@ -24287,7 +24288,7 @@ i32.const 5 i32.const 2 i32.const 3 - i32.const 4576 + i32.const 4624 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $44 @@ -24305,7 +24306,7 @@ i32.const 5 i32.const 2 i32.const 7 - i32.const 4624 + i32.const 4672 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $41 @@ -24319,7 +24320,7 @@ i32.const 5 i32.const 2 i32.const 7 - i32.const 4672 + i32.const 4720 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $43 @@ -24337,35 +24338,35 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 4720 + i32.const 4768 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $42 i32.const 1 i32.const 2 i32.const 3 - i32.const 4736 + i32.const 4784 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $38 i32.const 2 i32.const 2 i32.const 3 - i32.const 4768 + i32.const 4816 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $40 i32.const 4 i32.const 2 i32.const 3 - i32.const 4800 + i32.const 4848 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $39 i32.const 4 i32.const 2 i32.const 3 - i32.const 4832 + i32.const 4880 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $35 @@ -24392,7 +24393,7 @@ i32.const 1 i32.const 2 i32.const 3 - i32.const 4864 + i32.const 4912 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $29 @@ -24413,7 +24414,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 4896 + i32.const 4944 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $31 @@ -24586,14 +24587,14 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 5072 + i32.const 5120 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $31 i32.const 7 i32.const 2 i32.const 15 - i32.const 5120 + i32.const 5168 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $34 @@ -24632,14 +24633,14 @@ i32.const 2 i32.const 0 i32.const 17 - i32.const 5200 + i32.const 5248 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $34 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join local.tee $29 - i32.const 5328 + i32.const 5376 call $~lib/string/String.__eq i32.eqz if @@ -24653,14 +24654,14 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 5376 + i32.const 5424 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $32 - i32.const 5056 + i32.const 5104 call $~lib/array/Array#join local.tee $31 - i32.const 7168 + i32.const 7216 call $~lib/string/String.__eq i32.eqz if @@ -24674,14 +24675,14 @@ i32.const 3 i32.const 2 i32.const 7 - i32.const 7200 + i32.const 7248 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $37 - i32.const 7232 + i32.const 7280 call $~lib/array/Array#join local.tee $36 - i32.const 7168 + i32.const 7216 call $~lib/string/String.__eq i32.eqz if @@ -24695,14 +24696,14 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 7264 + i32.const 7312 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $35 - i32.const 7296 + i32.const 7344 call $~lib/array/Array#join local.tee $54 - i32.const 7328 + i32.const 7376 call $~lib/string/String.__eq i32.eqz if @@ -24716,14 +24717,14 @@ i32.const 6 i32.const 3 i32.const 10 - i32.const 7392 + i32.const 7440 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $40 - i32.const 7456 + i32.const 7504 call $~lib/array/Array#join local.tee $39 - i32.const 8544 + i32.const 8592 call $~lib/string/String.__eq i32.eqz if @@ -24737,14 +24738,14 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 8672 + i32.const 8720 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $42 - i32.const 5056 + i32.const 5104 call $~lib/array/Array<~lib/string/String | null>#join local.tee $38 - i32.const 8640 + i32.const 8688 call $~lib/string/String.__eq i32.eqz if @@ -24782,10 +24783,10 @@ local.get $43 local.set $41 local.get $41 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join local.tee $43 - i32.const 8752 + i32.const 8800 call $~lib/string/String.__eq i32.eqz if @@ -24819,10 +24820,10 @@ local.get $44 local.set $47 local.get $47 - i32.const 5296 + i32.const 5344 call $~lib/array/Array#join local.tee $44 - i32.const 8832 + i32.const 8880 call $~lib/string/String.__eq i32.eqz if @@ -24868,35 +24869,35 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 8912 + i32.const 8960 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $47 i32.const 1 i32.const 2 i32.const 3 - i32.const 8928 + i32.const 8976 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $43 i32.const 2 i32.const 2 i32.const 3 - i32.const 8960 + i32.const 9008 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $41 i32.const 4 i32.const 2 i32.const 3 - i32.const 8992 + i32.const 9040 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $38 local.get $47 call $~lib/array/Array#toString local.tee $44 - i32.const 5056 + i32.const 5104 call $~lib/string/String.__eq i32.eqz if @@ -24910,7 +24911,7 @@ local.get $43 call $~lib/array/Array#toString local.tee $42 - i32.const 8640 + i32.const 8688 call $~lib/string/String.__eq i32.eqz if @@ -24924,7 +24925,7 @@ local.get $41 call $~lib/array/Array#toString local.tee $39 - i32.const 9024 + i32.const 9072 call $~lib/string/String.__eq i32.eqz if @@ -24938,7 +24939,7 @@ local.get $38 call $~lib/array/Array#toString local.tee $40 - i32.const 9056 + i32.const 9104 call $~lib/string/String.__eq i32.eqz if @@ -24952,13 +24953,13 @@ i32.const 3 i32.const 0 i32.const 18 - i32.const 9088 + i32.const 9136 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $35 call $~lib/array/Array#toString local.tee $54 - i32.const 9120 + i32.const 9168 call $~lib/string/String.__eq i32.eqz if @@ -24972,13 +24973,13 @@ i32.const 3 i32.const 1 i32.const 19 - i32.const 9152 + i32.const 9200 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $37 call $~lib/array/Array#toString local.tee $36 - i32.const 9184 + i32.const 9232 call $~lib/string/String.__eq i32.eqz if @@ -24992,13 +24993,13 @@ i32.const 3 i32.const 3 i32.const 20 - i32.const 9232 + i32.const 9280 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $32 call $~lib/array/Array#toString local.tee $31 - i32.const 9280 + i32.const 9328 call $~lib/string/String.__eq i32.eqz if @@ -25012,13 +25013,13 @@ i32.const 4 i32.const 3 i32.const 21 - i32.const 9344 + i32.const 9392 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $34 call $~lib/array/Array#toString local.tee $29 - i32.const 9392 + i32.const 9440 call $~lib/string/String.__eq i32.eqz if @@ -25032,14 +25033,14 @@ i32.const 7 i32.const 2 i32.const 15 - i32.const 9504 + i32.const 9552 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $49 local.get $49 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $48 - i32.const 9552 + i32.const 9600 call $~lib/string/String.__eq i32.eqz if @@ -25053,13 +25054,13 @@ i32.const 4 i32.const 2 i32.const 15 - i32.const 9664 + i32.const 9712 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.tee $50 call $~lib/array/Array<~lib/string/String | null>#toString local.tee $51 - i32.const 9696 + i32.const 9744 call $~lib/string/String.__eq i32.eqz if @@ -25084,7 +25085,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 9728 + i32.const 9776 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -25092,7 +25093,7 @@ i32.const 2 i32.const 2 i32.const 3 - i32.const 9760 + i32.const 9808 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -25101,7 +25102,7 @@ local.get $56 call $~lib/array/Array<~lib/array/Array>#toString local.tee $30 - i32.const 9792 + i32.const 9840 call $~lib/string/String.__eq i32.eqz if @@ -25126,7 +25127,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 9824 + i32.const 9872 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -25134,7 +25135,7 @@ i32.const 2 i32.const 0 i32.const 6 - i32.const 9856 + i32.const 9904 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -25143,7 +25144,7 @@ local.get $57 call $~lib/array/Array<~lib/array/Array>#toString local.tee $26 - i32.const 9792 + i32.const 9840 call $~lib/string/String.__eq i32.eqz if @@ -25179,7 +25180,7 @@ i32.const 1 i32.const 2 i32.const 7 - i32.const 9888 + i32.const 9936 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -25190,7 +25191,7 @@ local.get $58 call $~lib/array/Array<~lib/array/Array<~lib/array/Array>>#toString local.tee $28 - i32.const 8640 + i32.const 8688 call $~lib/string/String.__eq i32.eqz if @@ -25263,7 +25264,7 @@ i32.const 1 i32.const 2 i32.const 3 - i32.const 9920 + i32.const 9968 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -25271,7 +25272,7 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 9952 + i32.const 10000 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -25279,7 +25280,7 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 9984 + i32.const 10032 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=8 @@ -25287,7 +25288,7 @@ i32.const 3 i32.const 2 i32.const 3 - i32.const 10016 + i32.const 10064 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=12 @@ -25353,7 +25354,7 @@ i32.const 1 i32.const 2 i32.const 15 - i32.const 10080 + i32.const 10128 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -25361,7 +25362,7 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 10176 + i32.const 10224 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 @@ -25369,7 +25370,7 @@ i32.const 3 i32.const 2 i32.const 15 - i32.const 10304 + i32.const 10352 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=8 @@ -25377,7 +25378,7 @@ i32.const 1 i32.const 2 i32.const 15 - i32.const 10368 + i32.const 10416 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=12 @@ -25389,7 +25390,7 @@ i32.const 8 i32.const 2 i32.const 15 - i32.const 10400 + i32.const 10448 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain local.set $63 @@ -25459,7 +25460,7 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 10448 + i32.const 10496 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store @@ -25467,7 +25468,7 @@ i32.const 0 i32.const 2 i32.const 3 - i32.const 10464 + i32.const 10512 call $~lib/rt/__allocArray call $~lib/rt/pure/__retain i32.store offset=4 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 788292843d..edee9d2672 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -15,25 +15,26 @@ (data (i32.const 1152) "&\00\00\00\01\00\00\00\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 1216) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00K\00e\00y\00 \00d\00o\00e\00s\00 \00n\00o\00t\00 \00e\00x\00i\00s\00t") (data (i32.const 1280) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00~\00l\00i\00b\00/\00m\00a\00p\00.\00t\00s") - (data (i32.const 1332) "\01\00\00\00\01") - (data (i32.const 1344) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e") - (data (i32.const 1392) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e") - (data (i32.const 1456) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00i\00s\00R\00e\00g\00E\00x\00p") - (data (i32.const 1488) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00m\00a\00t\00c\00h") - (data (i32.const 1520) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00r\00e\00p\00l\00a\00c\00e") - (data (i32.const 1552) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00s\00e\00a\00r\00c\00h") - (data (i32.const 1584) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00p\00e\00c\00i\00e\00s") - (data (i32.const 1616) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00p\00l\00i\00t") - (data (i32.const 1648) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e") - (data (i32.const 1696) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g") - (data (i32.const 1744) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s") - (data (i32.const 1792) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00S\00y\00m\00b\00o\00l\00(") - (data (i32.const 1824) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") - (data (i32.const 1856) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00)") - (data (i32.const 1888) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00S\00y\00m\00b\00o\00l\00(\00)") - (data (i32.const 1920) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)") - (data (i32.const 1968) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)") - (data (i32.const 2032) "4\00\00\00\01\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)") + (data (i32.const 1328) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l") + (data (i32.const 1380) "\01\00\00\00\01") + (data (i32.const 1392) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e") + (data (i32.const 1440) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e") + (data (i32.const 1504) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00i\00s\00R\00e\00g\00E\00x\00p") + (data (i32.const 1536) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00m\00a\00t\00c\00h") + (data (i32.const 1568) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00r\00e\00p\00l\00a\00c\00e") + (data (i32.const 1600) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00s\00e\00a\00r\00c\00h") + (data (i32.const 1632) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00p\00e\00c\00i\00e\00s") + (data (i32.const 1664) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00p\00l\00i\00t") + (data (i32.const 1696) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e") + (data (i32.const 1744) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g") + (data (i32.const 1792) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s") + (data (i32.const 1840) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00S\00y\00m\00b\00o\00l\00(") + (data (i32.const 1872) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l") + (data (i32.const 1904) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00)") + (data (i32.const 1936) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00S\00y\00m\00b\00o\00l\00(\00)") + (data (i32.const 1968) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)") + (data (i32.const 2016) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)") + (data (i32.const 2080) "4\00\00\00\01\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)") (global $~lib/symbol/nextId (mut i32) (i32.const 12)) (global $std/symbol/sym1 (mut i32) (i32.const 0)) (global $std/symbol/sym2 (mut i32) (i32.const 0)) @@ -1308,7 +1309,7 @@ (local $4 i32) block $__inlined_func$~lib/string/String#concat local.get $0 - i32.const 1840 + i32.const 1888 local.get $0 select local.tee $3 @@ -1317,7 +1318,7 @@ i32.shl local.tee $2 local.get $1 - i32.const 1840 + i32.const 1888 local.get $1 select local.tee $1 @@ -1329,7 +1330,7 @@ local.tee $0 i32.eqz if - i32.const 1344 + i32.const 1392 local.set $0 br $__inlined_func$~lib/string/String#concat end @@ -1350,7 +1351,7 @@ local.get $0 ) (func $~lib/symbol/_Symbol#toString (param $0 i32) (result i32) - i32.const 1808 + i32.const 1856 block $break|0 (result i32) block $case11|0 block $case10|0 @@ -1372,37 +1373,37 @@ i32.sub br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 $case6|0 $case7|0 $case8|0 $case9|0 $case10|0 $case11|0 end - i32.const 1360 + i32.const 1408 br $break|0 end - i32.const 1408 + i32.const 1456 br $break|0 end - i32.const 1472 + i32.const 1520 br $break|0 end - i32.const 1504 + i32.const 1552 br $break|0 end - i32.const 1536 + i32.const 1584 br $break|0 end - i32.const 1568 + i32.const 1616 br $break|0 end - i32.const 1600 + i32.const 1648 br $break|0 end - i32.const 1632 + i32.const 1680 br $break|0 end - i32.const 1664 + i32.const 1712 br $break|0 end - i32.const 1712 + i32.const 1760 br $break|0 end - i32.const 1760 + i32.const 1808 br $break|0 end global.get $~lib/symbol/idToString @@ -1418,11 +1419,11 @@ local.get $0 call $~lib/map/Map#get else - i32.const 1344 + i32.const 1392 end end call $~lib/string/String.__concat - i32.const 1872 + i32.const 1920 call $~lib/string/String.__concat ) (func $start:std/symbol @@ -1442,7 +1443,7 @@ call $~lib/builtins/abort unreachable end - i32.const 2112 + i32.const 2160 global.set $~lib/rt/stub/offset call $~lib/symbol/_Symbol.for global.set $std/symbol/sym3 @@ -1488,7 +1489,7 @@ local.tee $0 i32.eqz if - i32.const 0 + i32.const 1344 i32.const 1072 i32.const 17 i32.const 12 @@ -1502,7 +1503,7 @@ local.tee $0 i32.eqz if - i32.const 0 + i32.const 1344 i32.const 1072 i32.const 18 i32.const 12 @@ -1537,7 +1538,7 @@ end call $~lib/symbol/Symbol call $~lib/symbol/_Symbol#toString - i32.const 1904 + i32.const 1952 call $~lib/string/String.__eq i32.eqz if @@ -1550,7 +1551,7 @@ end global.get $std/symbol/sym3 call $~lib/symbol/_Symbol#toString - i32.const 1936 + i32.const 1984 call $~lib/string/String.__eq i32.eqz if @@ -1565,7 +1566,7 @@ global.set $std/symbol/isConcatSpreadable i32.const 1 call $~lib/symbol/_Symbol#toString - i32.const 1984 + i32.const 2032 call $~lib/string/String.__eq i32.eqz if @@ -1578,7 +1579,7 @@ end global.get $std/symbol/isConcatSpreadable call $~lib/symbol/_Symbol#toString - i32.const 2048 + i32.const 2096 call $~lib/string/String.__eq i32.eqz if diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 491865bb72..b4b86bb03e 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -16,25 +16,26 @@ (data (i32.const 144) "&\00\00\00\01\00\00\00\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 208) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00K\00e\00y\00 \00d\00o\00e\00s\00 \00n\00o\00t\00 \00e\00x\00i\00s\00t\00") (data (i32.const 272) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00~\00l\00i\00b\00/\00m\00a\00p\00.\00t\00s\00") - (data (i32.const 320) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") - (data (i32.const 336) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00") - (data (i32.const 384) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00") - (data (i32.const 448) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00i\00s\00R\00e\00g\00E\00x\00p\00") - (data (i32.const 480) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00m\00a\00t\00c\00h\00") - (data (i32.const 512) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00r\00e\00p\00l\00a\00c\00e\00") - (data (i32.const 544) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00s\00e\00a\00r\00c\00h\00") - (data (i32.const 576) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00p\00e\00c\00i\00e\00s\00") - (data (i32.const 608) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00p\00l\00i\00t\00") - (data (i32.const 640) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e\00") - (data (i32.const 688) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g\00") - (data (i32.const 736) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s\00") - (data (i32.const 784) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00S\00y\00m\00b\00o\00l\00(\00") - (data (i32.const 816) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") - (data (i32.const 848) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00)\00") - (data (i32.const 880) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00S\00y\00m\00b\00o\00l\00(\00)\00") - (data (i32.const 912) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)\00") - (data (i32.const 960) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)\00") - (data (i32.const 1024) "4\00\00\00\01\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)\00") + (data (i32.const 320) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00") + (data (i32.const 368) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 384) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00") + (data (i32.const 432) "$\00\00\00\01\00\00\00\01\00\00\00$\00\00\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00") + (data (i32.const 496) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00i\00s\00R\00e\00g\00E\00x\00p\00") + (data (i32.const 528) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00m\00a\00t\00c\00h\00") + (data (i32.const 560) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00r\00e\00p\00l\00a\00c\00e\00") + (data (i32.const 592) "\0c\00\00\00\01\00\00\00\01\00\00\00\0c\00\00\00s\00e\00a\00r\00c\00h\00") + (data (i32.const 624) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00s\00p\00e\00c\00i\00e\00s\00") + (data (i32.const 656) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00s\00p\00l\00i\00t\00") + (data (i32.const 688) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00P\00r\00i\00m\00i\00t\00i\00v\00e\00") + (data (i32.const 736) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00t\00o\00S\00t\00r\00i\00n\00g\00T\00a\00g\00") + (data (i32.const 784) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00u\00n\00s\00c\00o\00p\00a\00b\00l\00e\00s\00") + (data (i32.const 832) "\0e\00\00\00\01\00\00\00\01\00\00\00\0e\00\00\00S\00y\00m\00b\00o\00l\00(\00") + (data (i32.const 864) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00n\00u\00l\00l\00") + (data (i32.const 896) "\02\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00)\00") + (data (i32.const 928) "\10\00\00\00\01\00\00\00\01\00\00\00\10\00\00\00S\00y\00m\00b\00o\00l\00(\00)\00") + (data (i32.const 960) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00S\00y\00m\00b\00o\00l\00(\001\002\003\00)\00") + (data (i32.const 1008) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00S\00y\00m\00b\00o\00l\00(\00h\00a\00s\00I\00n\00s\00t\00a\00n\00c\00e\00)\00") + (data (i32.const 1072) "4\00\00\00\01\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)\00") (table $0 1 funcref) (global $~lib/symbol/nextId (mut i32) (i32.const 12)) (global $std/symbol/sym1 (mut i32) (i32.const 0)) @@ -54,7 +55,7 @@ (global $std/symbol/hasInstance (mut i32) (i32.const 0)) (global $~lib/symbol/_Symbol.isConcatSpreadable i32 (i32.const 2)) (global $std/symbol/isConcatSpreadable (mut i32) (i32.const 0)) - (global $~lib/heap/__heap_base i32 (i32.const 1092)) + (global $~lib/heap/__heap_base i32 (i32.const 1140)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/stub/__retain (param $0 i32) (result i32) @@ -3038,7 +3039,7 @@ i32.const 0 i32.eq if - i32.const 832 + i32.const 880 local.tee $2 local.get $1 local.tee $3 @@ -3071,7 +3072,7 @@ i32.const 0 i32.eq if - i32.const 336 + i32.const 384 call $~lib/rt/stub/__retain local.set $2 local.get $1 @@ -3109,7 +3110,7 @@ call $~lib/rt/stub/__retain local.set $1 local.get $0 - i32.const 832 + i32.const 880 local.get $0 i32.const 0 i32.ne @@ -3131,7 +3132,7 @@ (local $5 i32) local.get $0 local.set $1 - i32.const 336 + i32.const 384 local.set $2 block $break|0 block $case11|0 @@ -3194,7 +3195,7 @@ br_if $case10|0 br $case11|0 end - i32.const 352 + i32.const 400 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3202,7 +3203,7 @@ local.set $2 br $break|0 end - i32.const 400 + i32.const 448 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3210,7 +3211,7 @@ local.set $2 br $break|0 end - i32.const 464 + i32.const 512 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3218,7 +3219,7 @@ local.set $2 br $break|0 end - i32.const 496 + i32.const 544 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3226,7 +3227,7 @@ local.set $2 br $break|0 end - i32.const 528 + i32.const 576 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3234,7 +3235,7 @@ local.set $2 br $break|0 end - i32.const 560 + i32.const 608 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3242,7 +3243,7 @@ local.set $2 br $break|0 end - i32.const 592 + i32.const 640 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3250,7 +3251,7 @@ local.set $2 br $break|0 end - i32.const 624 + i32.const 672 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3258,7 +3259,7 @@ local.set $2 br $break|0 end - i32.const 656 + i32.const 704 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3266,7 +3267,7 @@ local.set $2 br $break|0 end - i32.const 704 + i32.const 752 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3274,7 +3275,7 @@ local.set $2 br $break|0 end - i32.const 752 + i32.const 800 local.set $3 local.get $2 call $~lib/rt/stub/__release @@ -3304,11 +3305,11 @@ end br $break|0 end - i32.const 800 + i32.const 848 local.get $2 call $~lib/string/String.__concat local.tee $3 - i32.const 864 + i32.const 912 call $~lib/string/String.__concat local.tee $4 local.set $5 @@ -3405,7 +3406,7 @@ if (result i32) local.get $0 else - i32.const 0 + i32.const 336 i32.const 64 i32.const 17 i32.const 12 @@ -3420,7 +3421,7 @@ if (result i32) local.get $0 else - i32.const 0 + i32.const 336 i32.const 64 i32.const 18 i32.const 12 @@ -3457,7 +3458,7 @@ call $~lib/symbol/Symbol call $~lib/symbol/_Symbol#toString local.tee $0 - i32.const 896 + i32.const 944 call $~lib/string/String.__eq i32.eqz if @@ -3471,7 +3472,7 @@ global.get $std/symbol/sym3 call $~lib/symbol/_Symbol#toString local.tee $1 - i32.const 928 + i32.const 976 call $~lib/string/String.__eq i32.eqz if @@ -3489,7 +3490,7 @@ global.get $std/symbol/hasInstance call $~lib/symbol/_Symbol#toString local.tee $2 - i32.const 976 + i32.const 1024 call $~lib/string/String.__eq i32.eqz if @@ -3503,7 +3504,7 @@ global.get $std/symbol/isConcatSpreadable call $~lib/symbol/_Symbol#toString local.tee $3 - i32.const 1040 + i32.const 1088 call $~lib/string/String.__eq i32.eqz if From e093e12a3f6150d4a7205b9563eac69f97bed1c8 Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Tue, 30 Jun 2020 19:02:35 +0200 Subject: [PATCH 6/8] Update src/compiler.ts Co-authored-by: Max Graey --- src/compiler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index c2695a46d9..bcd8f121b0 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -9420,8 +9420,8 @@ export class Compiler extends DiagnosticEmitter { let numParameters = parameterTypes.length; let operands = new Array(1 + numParameters); operands[0] = module.local_get(0, nativeSizeType); - for (let i = 0; i < numParameters; ++i) { - operands[i + 1] = module.local_get(i + 1, parameterTypes[i].toNativeType()); + for (let i = 1; i < numParameters; ++i) { + operands[i] = module.local_get(i, parameterTypes[i - 1].toNativeType()); } stmts.push( module.local_set(0, From 9484573095cd4c631b1fd24b52d580f5f4fc157a Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Tue, 30 Jun 2020 19:02:50 +0200 Subject: [PATCH 7/8] Update src/flow.ts Co-authored-by: Max Graey --- src/flow.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/flow.ts b/src/flow.ts index 3da6439518..7ca0890a31 100644 --- a/src/flow.ts +++ b/src/flow.ts @@ -927,7 +927,10 @@ export class Flow { for (let _keys = Map_keys(leftFieldFlags), i = 0, k = _keys.length; i < k; ++i) { let key = _keys[i]; let leftFlags = changetype(leftFieldFlags.get(key)); - if ((leftFlags & FieldFlags.INITIALIZED) != 0 && rightFieldFlags.has(key) && (changetype(rightFieldFlags.get(key)) & FieldFlags.INITIALIZED)) { + if ( + (leftFlags & FieldFlags.INITIALIZED) != 0 && rightFieldFlags.has(key) && + (changetype(rightFieldFlags.get(key)) & FieldFlags.INITIALIZED) + ) { newFieldFlags.set(key, FieldFlags.INITIALIZED); } } From 8ce7888a974290cf8f042b6226fd7100f07038fc Mon Sep 17 00:00:00 2001 From: dcode Date: Tue, 30 Jun 2020 22:57:46 +0200 Subject: [PATCH 8/8] fix --- src/compiler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index bcd8f121b0..4108c3aa2d 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -7376,8 +7376,8 @@ export class Compiler extends DiagnosticEmitter { let overloadNumParameters = overloadParameterTypes.length; let paramExprs = new Array(1 + overloadNumParameters); paramExprs[0] = module.local_get(0, nativeSizeType); // this - for (let n = 0; n < numParameters; ++n) { - paramExprs[1 + n] = module.local_get(1 + n, parameterTypes[n].toNativeType()); + for (let n = 1; n <= numParameters; ++n) { + paramExprs[n] = module.local_get(n, parameterTypes[n - 1].toNativeType()); } let needsVarargsStub = false; for (let n = numParameters; n < overloadNumParameters; ++n) { @@ -9420,7 +9420,7 @@ export class Compiler extends DiagnosticEmitter { let numParameters = parameterTypes.length; let operands = new Array(1 + numParameters); operands[0] = module.local_get(0, nativeSizeType); - for (let i = 1; i < numParameters; ++i) { + for (let i = 1; i <= numParameters; ++i) { operands[i] = module.local_get(i, parameterTypes[i - 1].toNativeType()); } stmts.push(