From f7d8fb6e645a29b5f45de87633465424389fa798 Mon Sep 17 00:00:00 2001 From: dcode Date: Tue, 21 Apr 2020 05:35:39 +0200 Subject: [PATCH 1/4] Fix various issues with object literals --- src/compiler.ts | 121 +- src/diagnosticMessages.generated.ts | 10 +- src/diagnosticMessages.json | 5 +- src/program.ts | 12 +- .../compiler/std/object-literal-omitted.json | 5 - .../std/object-literal-omitted.optimized.wat | 1587 ------- tests/compiler/std/object-literal-omitted.ts | 84 - .../std/object-literal-omitted.untouched.wat | 2139 --------- .../std/object-literal-unmanaged.json | 6 - .../object-literal-unmanaged.optimized.wat | 970 ---- .../compiler/std/object-literal-unmanaged.ts | 15 - .../object-literal-unmanaged.untouched.wat | 1504 ------ tests/compiler/std/object-literal.json | 4 +- .../compiler/std/object-literal.optimized.wat | 2424 +++++++++- tests/compiler/std/object-literal.ts | 122 +- .../compiler/std/object-literal.untouched.wat | 4203 +++++++++++++++-- 16 files changed, 6291 insertions(+), 6920 deletions(-) delete mode 100644 tests/compiler/std/object-literal-omitted.json delete mode 100644 tests/compiler/std/object-literal-omitted.optimized.wat delete mode 100644 tests/compiler/std/object-literal-omitted.ts delete mode 100644 tests/compiler/std/object-literal-omitted.untouched.wat delete mode 100644 tests/compiler/std/object-literal-unmanaged.json delete mode 100644 tests/compiler/std/object-literal-unmanaged.optimized.wat delete mode 100644 tests/compiler/std/object-literal-unmanaged.ts delete mode 100644 tests/compiler/std/object-literal-unmanaged.untouched.wat diff --git a/src/compiler.ts b/src/compiler.ts index 4cf331166e..22f3014e6c 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -8632,46 +8632,35 @@ export class Compiler extends DiagnosticEmitter { private compileObjectLiteral(expression: ObjectLiteralExpression, contextualType: Type): ExpressionRef { var module = this.module; - // contextual type must be a class + // Check that contextual type is a class (TODO: hidden class for interfaces?) var classReference = contextualType.classReference; - if (!classReference || classReference.is(CommonFlags.ABSTRACT)) { + if (!contextualType.is(TypeFlags.REFERENCE) || !classReference || classReference.kind != ElementKind.CLASS) { this.error( DiagnosticCode.Type_0_is_not_assignable_to_type_1, expression.range, "", contextualType.toString() ); return module.unreachable(); } + var classType = classReference.type; + this.currentType = classType.nonNullableType; + if (classReference.is(CommonFlags.ABSTRACT)) { + this.error( + DiagnosticCode.Cannot_create_an_instance_of_an_abstract_class, + expression.range + ); + return module.unreachable(); + } - // if present, check that the constructor is compatible with object literals - var ctor = classReference.constructorInstance; - if (ctor) { - // TODO: if the constructor requires parameters, check whether these are given as part of the - // object literal and use them to call the ctor while not generating a store. - if (ctor.signature.requiredParameters) { - this.error( - DiagnosticCode.Constructor_of_class_0_must_not_require_any_arguments, - expression.range, classReference.toString() - ); - return module.unreachable(); - } - if (ctor.is(CommonFlags.PRIVATE)) { - this.error( - DiagnosticCode.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, - expression.range, classReference.toString() - ); - return module.unreachable(); - } - if (ctor.is(CommonFlags.PROTECTED)) { - this.error( - DiagnosticCode.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, - expression.range, classReference.toString() - ); - return module.unreachable(); - } - if (ctor.hasDecorator(DecoratorFlags.UNSAFE)) this.checkUnsafe(expression); + // Check that the class is compatible with object literals + if (classReference.prototype.constructorPrototype) { + this.error( + DiagnosticCode.Class_0_cannot_declare_a_constructor_when_instantiated_from_an_object_literal, + expression.range, classType.toString() + ); + return module.unreachable(); } - var isManaged = classReference.type.isManaged; + var isManaged = classType.isManaged; if (!isManaged) { this.checkUnsafe(expression, findDecorator(DecoratorKind.UNMANAGED, classReference.decoratorNodes)); } @@ -8685,29 +8674,46 @@ export class Compiler extends DiagnosticEmitter { var exprs = new Array(); var flow = this.currentFlow; var tempLocal = isManaged - ? flow.getAutoreleaseLocal(classReference.type) - : flow.getTempLocal(classReference.type); + ? flow.getAutoreleaseLocal(classType) + : flow.getTempLocal(classType); assert(numNames == values.length); // Assume all class fields will be omitted, and add them to our omitted list - let omittedClassFieldMembers = new Set(); + var omittedFields = new Set(); if (members) { for (let _keys = Map_keys(members), i = 0, k = _keys.length; i < k; ++i) { let memberKey = _keys[i]; let member = assert(members.get(memberKey)); if (member !== null && member.kind == ElementKind.FIELD) { - omittedClassFieldMembers.add(member.name); + omittedFields.add(member); // incl. private/protected } } } // Iterate through the members defined in our expression for (let i = 0, k = numNames; i < k; ++i) { - let member = members ? members.get(names[i].text) : null; + let memberName = names[i].text; + let member = members ? members.get(memberName) : null; if (!member || member.kind != ElementKind.FIELD) { this.error( DiagnosticCode.Property_0_does_not_exist_on_type_1, - names[i].range, names[i].text, classReference.toString() + names[i].range, memberName, classType.toString() + ); + hasErrors = true; + continue; + } + if (member.is(CommonFlags.PRIVATE)) { + this.error( + DiagnosticCode.Property_0_is_private_and_only_accessible_within_class_1, + names[i].range, memberName, classType.toString() + ); + hasErrors = true; + continue; + } + if (member.is(CommonFlags.PROTECTED)) { + this.error( + DiagnosticCode.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, + names[i].range, memberName, classType.toString() ); hasErrors = true; continue; @@ -8716,7 +8722,7 @@ export class Compiler extends DiagnosticEmitter { let fieldType = fieldInstance.type; let expr = this.compileExpression(values[i], fieldType, Constraints.CONV_IMPLICIT | Constraints.WILL_RETAIN); - if (isManaged && fieldType.isManaged && !this.skippedAutoreleases.has(expr)) { + if (fieldType.isManaged && !this.skippedAutoreleases.has(expr)) { expr = this.makeRetain(expr); } exprs.push(this.module.store( // TODO: handle setters as well @@ -8728,47 +8734,48 @@ export class Compiler extends DiagnosticEmitter { )); // This member is no longer omitted, so delete from our omitted fields - omittedClassFieldMembers.delete(member.name); + omittedFields.delete(fieldInstance); } - this.currentType = classReference.type.nonNullableType; + this.currentType = classType.nonNullableType; if (hasErrors) return module.unreachable(); // Iterate through the remaining omittedClassFieldMembers. if (members) { - for (let _values = Set_values(omittedClassFieldMembers), j = 0, l = _values.length; j < l; ++j) { - let omittedMemberKey = _values[j]; - let member = assert(members.get(omittedMemberKey)); - - let fieldInstance = member; + for (let _values = Set_values(omittedFields), j = 0, l = _values.length; j < l; ++j) { + let fieldInstance = _values[j]; let fieldType = fieldInstance.type; + if (fieldInstance.initializerNode) { + continue; // set by default 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, - expression.range, "", classReference.toString() + expression.range, fieldInstance.name, "", classType.toString() ); hasErrors = true; continue; } } - switch(fieldType.kind) { + switch (fieldType.kind) { // Number Types (and Number alias types) case TypeKind.I8: case TypeKind.I16: case TypeKind.I32: + case TypeKind.I64: + case TypeKind.ISIZE: case TypeKind.U8: case TypeKind.U16: case TypeKind.U32: - case TypeKind.USIZE: - case TypeKind.ISIZE: - case TypeKind.BOOL: - case TypeKind.I64: - case TypeKind.U64: - case TypeKind.F32: + case TypeKind.U64: + case TypeKind.USIZE: + case TypeKind.BOOL: + case TypeKind.F32: case TypeKind.F64: { exprs.push(this.module.store( // TODO: handle setters as well fieldType.byteSize, @@ -8784,7 +8791,7 @@ export class Compiler extends DiagnosticEmitter { // Otherwise, error this.error( DiagnosticCode.Property_0_is_missing_in_type_1_but_required_in_type_2, - expression.range, "", classReference.toString() + expression.range, fieldInstance.name, "", classType.toString() ); hasErrors = true; } @@ -8794,16 +8801,14 @@ export class Compiler extends DiagnosticEmitter { // allocate a new instance first and assign 'this' to the temp. local exprs.unshift(module.local_set( tempLocal.index, - isManaged - ? this.makeRetain(this.makeAllocation(classReference)) - : this.makeAllocation(classReference) + this.compileInstantiate(classReference, [], Constraints.WILL_RETAIN, expression) )); // once all field values have been set, return 'this' exprs.push(module.local_get(tempLocal.index, this.options.nativeSizeType)); if (!isManaged) flow.freeTempLocal(tempLocal); - this.currentType = classReference.type; + this.currentType = classType.nonNullableType; return module.flatten(exprs, this.options.nativeSizeType); } @@ -8980,7 +8985,7 @@ export class Compiler extends DiagnosticEmitter { this.makeZero(this.options.usizeType), constraints ); - if (getExpressionType(expr) != NativeType.None) { // possibly IMM_DROPPED + if (getExpressionType(expr) != NativeType.None) { // possibly WILL_DROP this.currentType = classInstance.type; // important because a super ctor could be called } return expr; diff --git a/src/diagnosticMessages.generated.ts b/src/diagnosticMessages.generated.ts index 464c749203..257ab800c1 100644 --- a/src/diagnosticMessages.generated.ts +++ b/src/diagnosticMessages.generated.ts @@ -29,7 +29,7 @@ export enum DiagnosticCode { Duplicate_decorator = 213, Type_0_is_illegal_in_this_context = 214, Optional_parameter_must_have_an_initializer = 215, - Constructor_of_class_0_must_not_require_any_arguments = 216, + Class_0_cannot_declare_a_constructor_when_instantiated_from_an_object_literal = 216, Function_0_cannot_be_inlined_into_itself = 217, Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set = 218, Optional_properties_are_not_supported = 219, @@ -115,6 +115,7 @@ export enum DiagnosticCode { _super_can_only_be_referenced_in_a_derived_class = 2335, Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors = 2337, Property_0_does_not_exist_on_type_1 = 2339, + Property_0_is_private_and_only_accessible_within_class_1 = 2341, Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures = 2349, This_expression_is_not_constructable = 2351, A_function_whose_declared_type_is_not_void_must_return_a_value = 2355, @@ -130,12 +131,14 @@ export enum DiagnosticCode { Duplicate_function_implementation = 2393, Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local = 2395, A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged = 2434, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses = 2445, The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly = 2453, Type_0_has_no_property_1 = 2460, The_0_operator_cannot_be_applied_to_type_1 = 2469, In_const_enum_declarations_member_initializer_must_be_constant_expression = 2474, Export_declaration_conflicts_with_exported_declaration_of_0 = 2484, _0_is_referenced_directly_or_indirectly_in_its_own_base_expression = 2506, + Cannot_create_an_instance_of_an_abstract_class = 2511, Object_is_possibly_null = 2531, Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property = 2540, The_target_of_an_assignment_must_be_a_variable_or_a_property_access = 2541, @@ -184,7 +187,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 213: return "Duplicate decorator."; case 214: return "Type '{0}' is illegal in this context."; case 215: return "Optional parameter must have an initializer."; - case 216: return "Constructor of class '{0}' must not require any arguments."; + case 216: return "Class '{0}' cannot declare a constructor when instantiated from an object literal."; case 217: return "Function '{0}' cannot be inlined into itself."; case 218: return "Cannot access method '{0}' without calling it as it requires 'this' to be set."; case 219: return "Optional properties are not supported."; @@ -270,6 +273,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 2335: return "'super' can only be referenced in a derived class."; case 2337: return "Super calls are not permitted outside constructors or in nested functions inside constructors."; case 2339: return "Property '{0}' does not exist on type '{1}'."; + case 2341: return "Property '{0}' is private and only accessible within class '{1}'."; case 2349: return "Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures."; case 2351: return "This expression is not constructable."; case 2355: return "A function whose declared type is not 'void' must return a value."; @@ -285,12 +289,14 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 2393: return "Duplicate function implementation."; case 2395: return "Individual declarations in merged declaration '{0}' must be all exported or all local."; case 2434: return "A namespace declaration cannot be located prior to a class or function with which it is merged."; + case 2445: return "Property '{0}' is protected and only accessible within class '{1}' and its subclasses."; case 2453: return "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly."; case 2460: return "Type '{0}' has no property '{1}'."; case 2469: return "The '{0}' operator cannot be applied to type '{1}'."; case 2474: return "In 'const' enum declarations member initializer must be constant expression."; case 2484: return "Export declaration conflicts with exported declaration of '{0}'."; case 2506: return "'{0}' is referenced directly or indirectly in its own base expression."; + case 2511: return "Cannot create an instance of an abstract class."; case 2531: return "Object is possibly 'null'."; case 2540: return "Cannot assign to '{0}' because it is a constant or a read-only property."; case 2541: return "The target of an assignment must be a variable or a property access."; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index eb7a2771cb..94fd6f1d81 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -22,7 +22,7 @@ "Duplicate decorator.": 213, "Type '{0}' is illegal in this context.": 214, "Optional parameter must have an initializer.": 215, - "Constructor of class '{0}' must not require any arguments.": 216, + "Class '{0}' cannot declare a constructor when instantiated from an object literal.": 216, "Function '{0}' cannot be inlined into itself.": 217, "Cannot access method '{0}' without calling it as it requires 'this' to be set.": 218, "Optional properties are not supported.": 219, @@ -111,6 +111,7 @@ "'super' can only be referenced in a derived class.": 2335, "Super calls are not permitted outside constructors or in nested functions inside constructors.": 2337, "Property '{0}' does not exist on type '{1}'.": 2339, + "Property '{0}' is private and only accessible within class '{1}'.": 2341, "Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.": 2349, "This expression is not constructable.": 2351, "A function whose declared type is not 'void' must return a value.": 2355, @@ -126,12 +127,14 @@ "Duplicate function implementation.": 2393, "Individual declarations in merged declaration '{0}' must be all exported or all local.": 2395, "A namespace declaration cannot be located prior to a class or function with which it is merged.": 2434, + "Property '{0}' is protected and only accessible within class '{1}' and its subclasses.": 2445, "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": 2453, "Type '{0}' has no property '{1}'.": 2460, "The '{0}' operator cannot be applied to type '{1}'.": 2469, "In 'const' enum declarations member initializer must be constant expression.": 2474, "Export declaration conflicts with exported declaration of '{0}'.": 2484, "'{0}' is referenced directly or indirectly in its own base expression.": 2506, + "Cannot create an instance of an abstract class.": 2511, "Object is possibly 'null'.": 2531, "Cannot assign to '{0}' because it is a constant or a read-only property.": 2540, "The target of an assignment must be a variable or a property access.": 2541, diff --git a/src/program.ts b/src/program.ts index 9c07ab7703..148fb720c3 100644 --- a/src/program.ts +++ b/src/program.ts @@ -1444,7 +1444,10 @@ export class Program extends DiagnosticEmitter { if (memberDeclaration.isAny(CommonFlags.GET | CommonFlags.SET)) { this.initializeProperty(methodDeclaration, element); } else { - this.initializeMethod(methodDeclaration, element); + let method = this.initializeMethod(methodDeclaration, element); + if (method !== null && methodDeclaration.name.kind == NodeKind.CONSTRUCTOR) { + element.constructorPrototype = method; + } } break; } @@ -1500,7 +1503,7 @@ export class Program extends DiagnosticEmitter { declaration: MethodDeclaration, /** Parent class. */ parent: ClassPrototype - ): void { + ): FunctionPrototype | null { var name = declaration.name.text; var isStatic = declaration.is(CommonFlags.STATIC); var acceptedFlags = DecoratorFlags.INLINE | DecoratorFlags.UNSAFE; @@ -1520,11 +1523,12 @@ export class Program extends DiagnosticEmitter { ); if (isStatic) { // global function assert(declaration.name.kind != NodeKind.CONSTRUCTOR); - if (!parent.add(name, element)) return; + if (!parent.add(name, element)) return null; } else { // actual instance method - if (!parent.addInstance(name, element)) return; + if (!parent.addInstance(name, element)) return null; } this.checkOperatorOverloads(declaration.decorators, element, parent); + return element; } /** Checks that operator overloads are generally valid, if present. */ diff --git a/tests/compiler/std/object-literal-omitted.json b/tests/compiler/std/object-literal-omitted.json deleted file mode 100644 index a499d3adfc..0000000000 --- a/tests/compiler/std/object-literal-omitted.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "asc_flags": [ - "--runtime full" - ] -} diff --git a/tests/compiler/std/object-literal-omitted.optimized.wat b/tests/compiler/std/object-literal-omitted.optimized.wat deleted file mode 100644 index a70a39a38b..0000000000 --- a/tests/compiler/std/object-literal-omitted.optimized.wat +++ /dev/null @@ -1,1587 +0,0 @@ -(module - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_i32 (func (param 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) "\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) ":\00\00\00\01\00\00\00\01\00\00\00:\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00o\00m\00i\00t\00t\00e\00d\00.\00t\00s") - (data (i32.const 1264) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t") - (data (i32.const 1296) "\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\00\00\00\00 ") - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 1296)) - (export "memory" (memory $0)) - (export "__alloc" (func $~lib/rt/tlsf/__alloc)) - (export "__retain" (func $~lib/rt/pure/__retain)) - (export "__release" (func $~lib/rt/pure/__release)) - (export "__collect" (func $~lib/rt/pure/__collect)) - (export "__rtti_base" (global $~lib/rt/__rtti_base)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.tee $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $4 - i32.const 7 - i32.sub - local.set $4 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $4 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=20 - local.set $3 - local.get $1 - i32.load offset=16 - local.tee $5 - if - local.get $5 - local.get $3 - i32.store offset=20 - end - local.get $3 - if - local.get $3 - local.get $5 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $3 - i32.store offset=96 - local.get $3 - i32.eqz - if - local.get $0 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.tee $3 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.const -1 - i32.xor - i32.and - local.set $1 - local.get $3 - local.get $1 - i32.store offset=4 - local.get $1 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.tee $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.tee $5 - i32.const 1 - i32.and - if - local.get $3 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const -4 - i32.and - i32.add - local.tee $2 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - local.get $3 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.set $5 - end - end - local.get $3 - i32.const 2 - i32.and - if - local.get $1 - i32.const 4 - i32.sub - i32.load - local.tee $2 - i32.load - local.tee $7 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $7 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $3 - i32.const -4 - i32.and - i32.add - local.tee $8 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $2 - call $~lib/rt/tlsf/removeBlock - local.get $2 - local.get $8 - local.get $7 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $2 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $3 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.const 16 - i32.add - i32.add - local.get $4 - i32.ne - if - i32.const 0 - i32.const 1040 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $3 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $3 - i32.const 7 - i32.sub - local.set $6 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $6 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $3 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $3 - i32.store offset=20 - local.get $3 - if - local.get $3 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $1 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $6 - i32.shl - i32.or - i32.store - local.get $0 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.tee $0 - local.get $0 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.or - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - local.get $2 - i32.le_u - select - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=1568 - local.tee $3 - if - local.get $1 - local.get $3 - i32.const 16 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 16 - i32.sub - i32.eq - if - local.get $3 - i32.load - local.set $4 - local.get $1 - i32.const 16 - i32.sub - local.set $1 - end - else - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.tee $2 - i32.const 48 - i32.lt_u - if - return - end - local.get $1 - local.get $4 - i32.const 2 - i32.and - local.get $2 - i32.const 32 - i32.sub - i32.const 1 - i32.or - i32.or - i32.store - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.tee $2 - i32.const 2 - i32.store - local.get $0 - local.get $2 - i32.store offset=1568 - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/rt/tlsf/ROOT - local.tee $0 - i32.eqz - if - i32.const 1 - memory.size - local.tee $0 - i32.gt_s - if (result i32) - i32.const 1 - local.get $0 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - i32.const 1344 - local.tee $0 - i32.const 0 - i32.store - i32.const 2912 - i32.const 0 - i32.store - loop $for-loop|0 - local.get $1 - i32.const 23 - i32.lt_u - if - local.get $1 - i32.const 2 - i32.shl - i32.const 1344 - i32.add - i32.const 0 - i32.store offset=4 - i32.const 0 - local.set $2 - loop $for-loop|1 - local.get $2 - i32.const 16 - i32.lt_u - if - local.get $2 - local.get $1 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.const 1344 - i32.add - i32.const 0 - i32.store offset=96 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|1 - end - end - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|0 - end - end - i32.const 1344 - i32.const 2928 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - i32.const 1344 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - i32.const 256 - i32.lt_u - if - local.get $1 - i32.const 4 - i32.shr_u - local.set $1 - else - local.get $1 - i32.const 536870904 - i32.lt_u - if - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.add - i32.const 1 - i32.sub - local.set $1 - end - local.get $1 - i32.const 31 - local.get $1 - i32.clz - i32.sub - local.tee $2 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $1 - local.get $2 - i32.const 7 - i32.sub - local.set $2 - end - local.get $1 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $2 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 338 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const -1 - local.get $1 - i32.shl - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.get $2 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - local.get $0 - i32.load - i32.const -1 - local.get $2 - i32.const 1 - i32.add - i32.shl - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.tee $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.tee $2 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - i32.ctz - local.get $1 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - i32.const 0 - end - end - ) - (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - i32.load - local.set $3 - local.get $2 - i32.const 15 - i32.and - if - i32.const 0 - i32.const 1040 - i32.const 365 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const -4 - i32.and - local.get $2 - i32.sub - local.tee $4 - i32.const 32 - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - i32.store - local.get $2 - local.get $1 - i32.const 16 - i32.add - i32.add - local.tee $1 - local.get $4 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $3 - i32.const -2 - i32.and - i32.store - local.get $1 - i32.const 16 - i32.add - local.tee $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.get $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - i32.load - i32.const -3 - i32.and - i32.store - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/rt/tlsf/collectLock - if - i32.const 0 - i32.const 1040 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 1073741808 - i32.ge_u - if - i32.const 1088 - i32.const 1040 - i32.const 461 - i32.const 30 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 15 - i32.add - i32.const -16 - i32.and - local.tee $3 - i32.const 16 - local.get $3 - i32.const 16 - i32.gt_u - select - local.tee $4 - call $~lib/rt/tlsf/searchBlock - local.tee $3 - i32.eqz - if - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - local.get $4 - call $~lib/rt/tlsf/searchBlock - local.tee $3 - i32.eqz - if - i32.const 16 - memory.size - local.tee $3 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - i32.load offset=1568 - i32.ne - i32.shl - local.get $4 - i32.const 1 - i32.const 27 - local.get $4 - i32.clz - i32.sub - i32.shl - i32.const 1 - i32.sub - i32.add - local.get $4 - local.get $4 - i32.const 536870904 - i32.lt_u - select - i32.add - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.set $5 - local.get $3 - local.get $5 - local.get $3 - local.get $5 - i32.gt_s - select - memory.grow - i32.const 0 - i32.lt_s - if - local.get $5 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - local.get $0 - local.get $3 - i32.const 16 - i32.shl - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - local.get $0 - local.get $4 - call $~lib/rt/tlsf/searchBlock - local.tee $3 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - end - local.get $3 - i32.load - i32.const -4 - i32.and - local.get $4 - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 0 - i32.store offset=4 - local.get $3 - local.get $2 - i32.store offset=8 - local.get $3 - local.get $1 - i32.store offset=12 - local.get $0 - local.get $3 - call $~lib/rt/tlsf/removeBlock - local.get $0 - local.get $3 - local.get $4 - call $~lib/rt/tlsf/prepareBlock - local.get $3 - ) - (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - local.get $1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - ) - (func $~lib/rt/pure/__retain (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1340 - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - local.tee $1 - i32.load offset=4 - local.tee $2 - i32.const -268435456 - i32.and - local.get $2 - i32.const 1 - i32.add - i32.const -268435456 - i32.and - i32.ne - if - i32.const 0 - i32.const 1152 - i32.const 109 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $2 - i32.const 1 - i32.add - i32.store offset=4 - local.get $1 - i32.load - i32.const 1 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 112 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - end - local.get $0 - ) - (func $~lib/rt/pure/__release (param $0 i32) - local.get $0 - i32.const 1340 - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - end - ) - (func $std/object-literal-omitted/testOmittedTypes (param $0 i32) - local.get $0 - i32.load - if - i32.const 0 - i32.const 1200 - i32.const 19 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - if - i32.const 0 - i32.const 1200 - i32.const 20 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=8 - i64.eqz - i32.eqz - if - i32.const 0 - i32.const 1200 - i32.const 21 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=16 - i64.eqz - i32.eqz - if - i32.const 0 - i32.const 1200 - i32.const 22 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f32.load offset=24 - f32.const 0 - f32.ne - if - i32.const 0 - i32.const 1200 - i32.const 23 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=32 - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 1200 - i32.const 24 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_s offset=40 - if - i32.const 0 - i32.const 1200 - i32.const 25 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=41 - if - i32.const 0 - i32.const 1200 - i32.const 26 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_s offset=42 - if - i32.const 0 - i32.const 1200 - i32.const 27 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_u offset=44 - if - i32.const 0 - i32.const 1200 - i32.const 28 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=48 - if - i32.const 0 - i32.const 1200 - i32.const 29 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=52 - if - i32.const 0 - i32.const 1200 - i32.const 30 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=56 - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 1200 - i32.const 31 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=64 - if - i32.const 0 - i32.const 1200 - i32.const 32 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - ) - (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) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 1280 - local.set $3 - local.get $0 - i32.const 7 - i32.and - i32.eqz - i32.const 0 - local.get $1 - i32.const 4 - i32.ge_u - select - if - loop $do-continue|0 - local.get $0 - i64.load - local.get $3 - i64.load - i64.eq - if - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $3 - i32.const 8 - i32.add - local.set $3 - local.get $1 - i32.const 4 - i32.sub - local.tee $1 - i32.const 4 - i32.ge_u - br_if $do-continue|0 - end - end - end - loop $while-continue|1 - local.get $1 - local.tee $2 - i32.const 1 - i32.sub - local.set $1 - local.get $2 - if - local.get $3 - i32.load16_u - local.tee $2 - local.get $0 - i32.load16_u - local.tee $4 - i32.ne - if - local.get $4 - local.get $2 - i32.sub - return - end - local.get $0 - i32.const 2 - i32.add - local.set $0 - local.get $3 - i32.const 2 - i32.add - local.set $3 - br $while-continue|1 - end - end - i32.const 0 - ) - (func $start:std/object-literal-omitted - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 65 - i32.const 3 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i64.const 0 - i64.store offset=8 - local.get $0 - i64.const 0 - i64.store offset=16 - local.get $0 - f32.const 0 - f32.store offset=24 - local.get $0 - f64.const 0 - f64.store offset=32 - local.get $0 - i32.const 0 - i32.store8 offset=40 - local.get $0 - i32.const 0 - i32.store8 offset=41 - local.get $0 - i32.const 0 - i32.store16 offset=42 - local.get $0 - i32.const 0 - i32.store16 offset=44 - local.get $0 - i32.const 0 - i32.store offset=48 - local.get $0 - i32.const 0 - i32.store offset=52 - local.get $0 - f64.const 0 - f64.store offset=56 - local.get $0 - i32.const 0 - i32.store8 offset=64 - local.get $0 - call $std/object-literal-omitted/testOmittedTypes - i32.const 16 - i32.const 4 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $1 - i32.const 0 - i32.store - local.get $1 - i32.const 1280 - i32.store offset=4 - local.get $1 - f64.const 0 - f64.store offset=8 - local.get $1 - i32.load - if - i32.const 0 - i32.const 1200 - i32.const 44 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - block $__inlined_func$~lib/string/String.__eq (result i32) - i32.const 1 - local.get $1 - i32.load offset=4 - local.tee $2 - i32.const 1280 - i32.eq - br_if $__inlined_func$~lib/string/String.__eq - drop - i32.const 0 - i32.const 0 - i32.const 1 - local.get $2 - select - br_if $__inlined_func$~lib/string/String.__eq - drop - i32.const 0 - local.get $2 - call $~lib/string/String#get:length - local.tee $3 - i32.const 1280 - call $~lib/string/String#get:length - i32.ne - br_if $__inlined_func$~lib/string/String.__eq - drop - local.get $2 - local.get $3 - call $~lib/util/string/compareImpl - i32.eqz - end - i32.eqz - if - i32.const 0 - i32.const 1200 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f64.load offset=8 - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 1200 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $~start - call $start:std/object-literal-omitted - ) - (func $~lib/rt/pure/__collect - nop - ) - (func $~lib/rt/pure/decrement (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.tee $2 - i32.const 268435455 - i32.and - local.set $1 - local.get $0 - i32.load - i32.const 1 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 122 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 1 - i32.eq - if - block $__inlined_func$~lib/rt/__visit_members - block $switch$1$default - block $switch$1$case$6 - block $switch$1$case$4 - local.get $0 - i32.const 16 - i32.add - local.tee $1 - i32.const 8 - i32.sub - i32.load - br_table $__inlined_func$~lib/rt/__visit_members $__inlined_func$~lib/rt/__visit_members $switch$1$case$4 $__inlined_func$~lib/rt/__visit_members $switch$1$case$6 $switch$1$default - end - local.get $1 - i32.load - local.tee $1 - if - local.get $1 - call $~lib/rt/pure/__visit - end - br $__inlined_func$~lib/rt/__visit_members - end - local.get $1 - i32.load offset=4 - local.tee $1 - if - local.get $1 - call $~lib/rt/pure/__visit - end - br $__inlined_func$~lib/rt/__visit_members - end - unreachable - end - local.get $2 - i32.const -2147483648 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 126 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $0 - i32.load - i32.const 1 - i32.or - i32.store - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - i32.const 0 - i32.le_u - if - i32.const 0 - i32.const 1152 - i32.const 136 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 1 - i32.sub - local.get $2 - i32.const -268435456 - i32.and - i32.or - i32.store offset=4 - end - ) - (func $~lib/rt/pure/__visit (param $0 i32) - local.get $0 - i32.const 1340 - i32.lt_u - if - return - end - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - ) -) diff --git a/tests/compiler/std/object-literal-omitted.ts b/tests/compiler/std/object-literal-omitted.ts deleted file mode 100644 index ae4bf3f714..0000000000 --- a/tests/compiler/std/object-literal-omitted.ts +++ /dev/null @@ -1,84 +0,0 @@ -class OmittedTypes { - int32: i32; - uint32: u32; - int64: i64; - uint64: u64; - float32: f32; - float64: f64; - int8: i8; - uint8: u8; - int16: i16; - uint16: u16; - intsize: isize; - uintsize: usize; - alias: number; - isTrue: boolean -} - -function testOmittedTypes(omitted: OmittedTypes): void { - assert(omitted.int32 == 0); - assert(omitted.uint32 == 0); - assert(omitted.int64 == 0); - assert(omitted.uint64 == 0); - assert(omitted.float32 == 0); - assert(omitted.float64 == 0); - assert(omitted.int8 == 0); - assert(omitted.uint8 == 0); - assert(omitted.int16 == 0); - assert(omitted.uint16 == 0); - assert(omitted.intsize == 0); - assert(omitted.uintsize == 0); - assert(omitted.alias == 0); - assert(omitted.isTrue == false); -} - -testOmittedTypes({}); - -class MixedOmitted { - simpleType: i32; - complexType: string; - anotherSimpleType: f64; -} - -function testMixedOmitted(omitted: MixedOmitted): void { - assert(omitted.simpleType == 0); - assert(omitted.complexType == 'test'); - assert(omitted.anotherSimpleType == 0); -} - -testMixedOmitted({ - simpleType: 0, - complexType: 'test' -}); - -// Test omitted fields -class OmittedFoo { - bar: string = 'bar'; - baz: string | null = 'baz'; - quux: string | null; - quuz: string | null; - corge: string | null; - grault: string | null; - garply: string | null; - waldo: string | null; - fred: i32; - qux: i32 = -1; -} - -function testOmittedFoo(foo: OmittedFoo): void { - assert(foo.bar == 'bar'); - assert(foo.baz == 'baz'); - assert(changetype(foo.baz) == 0); - assert(changetype(foo.quux) == 0); - assert(changetype(foo.quuz) == 0); - assert(changetype(foo.corge) == 0); - assert(changetype(foo.grault) == 0); - assert(changetype(foo.garply) == 0); - assert(changetype(foo.waldo) == 0); - assert(foo.fred == 0); - assert(foo.qux == -1); -} - -// TODO: Test this one omitted implementation is complete -// testOmittedFoo({}); - diff --git a/tests/compiler/std/object-literal-omitted.untouched.wat b/tests/compiler/std/object-literal-omitted.untouched.wat deleted file mode 100644 index d1b9c65891..0000000000 --- a/tests/compiler/std/object-literal-omitted.untouched.wat +++ /dev/null @@ -1,2139 +0,0 @@ -(module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result 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) "\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) ":\00\00\00\01\00\00\00\01\00\00\00:\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00o\00m\00i\00t\00t\00e\00d\00.\00t\00s\00") - (data (i32.const 256) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t\00") - (data (i32.const 288) "\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\00\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 $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 288)) - (global $~lib/heap/__heap_base i32 (i32.const 332)) - (export "memory" (memory $0)) - (export "__alloc" (func $~lib/rt/tlsf/__alloc)) - (export "__retain" (func $~lib/rt/pure/__retain)) - (export "__release" (func $~lib/rt/pure/__release)) - (export "__collect" (func $~lib/rt/pure/__collect)) - (export "__rtti_base" (global $~lib/rt/__rtti_base)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $1 - i32.load - local.set $2 - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $3 - local.get $3 - i32.const 16 - i32.ge_u - if (result i32) - local.get $3 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $4 - local.get $3 - i32.const 4 - i32.shr_u - local.set $5 - else - i32.const 31 - local.get $3 - i32.clz - i32.sub - local.set $4 - local.get $3 - local.get $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $5 - local.get $4 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $4 - end - local.get $4 - i32.const 23 - i32.lt_u - if (result i32) - local.get $5 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=16 - local.set $6 - local.get $1 - i32.load offset=20 - local.set $7 - local.get $6 - if - local.get $6 - local.get $7 - i32.store offset=20 - end - local.get $7 - if - local.get $7 - local.get $6 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.set $10 - local.get $4 - local.set $9 - local.get $5 - local.set $8 - local.get $10 - local.get $9 - i32.const 4 - i32.shl - local.get $8 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.set $11 - local.get $4 - local.set $10 - local.get $5 - local.set $9 - local.get $7 - local.set $8 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.store offset=96 - local.get $7 - i32.eqz - if - local.get $0 - local.set $9 - local.get $4 - local.set $8 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $9 - local.get $0 - local.set $8 - local.get $4 - local.set $11 - local.get $9 - i32.const 1 - local.get $5 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $9 - local.set $10 - local.get $8 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.store offset=4 - local.get $9 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.set $2 - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.set $3 - local.get $3 - i32.const 16 - i32.add - local.get $3 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - local.get $5 - i32.const 1 - i32.and - if - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $3 - local.get $3 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - i32.const 3 - i32.and - local.get $3 - i32.or - local.tee $2 - i32.store - local.get $1 - local.set $6 - local.get $6 - i32.const 16 - i32.add - local.get $6 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - end - end - local.get $2 - i32.const 2 - i32.and - if - local.get $1 - local.set $6 - local.get $6 - i32.const 4 - i32.sub - i32.load - local.set $6 - local.get $6 - i32.load - local.set $3 - local.get $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $7 - local.get $7 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $6 - call $~lib/rt/tlsf/removeBlock - local.get $6 - local.get $3 - i32.const 3 - i32.and - local.get $7 - i32.or - local.tee $2 - i32.store - local.get $6 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $8 - local.get $8 - i32.const 16 - i32.ge_u - if (result i32) - local.get $8 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.add - local.get $8 - i32.add - local.get $4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $8 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $9 - local.get $8 - i32.const 4 - i32.shr_u - local.set $10 - else - i32.const 31 - local.get $8 - i32.clz - i32.sub - local.set $9 - local.get $8 - local.get $9 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $10 - local.get $9 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $9 - end - local.get $9 - i32.const 23 - i32.lt_u - if (result i32) - local.get $10 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $7 - local.get $9 - local.set $3 - local.get $10 - local.set $6 - local.get $7 - local.get $3 - i32.const 4 - i32.shl - local.get $6 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $11 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $11 - i32.store offset=20 - local.get $11 - if - local.get $11 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.set $12 - local.get $9 - local.set $7 - local.get $10 - local.set $3 - local.get $1 - local.set $6 - local.get $12 - local.get $7 - i32.const 4 - i32.shl - local.get $3 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $9 - i32.shl - i32.or - i32.store - local.get $0 - local.set $13 - local.get $9 - local.set $12 - local.get $0 - local.set $3 - local.get $9 - local.set $6 - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 1 - local.get $10 - i32.shl - i32.or - local.set $7 - local.get $13 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - local.get $2 - i32.le_u - if (result i32) - local.get $1 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - local.set $4 - i32.const 0 - local.set $5 - local.get $4 - if - local.get $1 - local.get $4 - i32.const 16 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.sub - local.get $4 - i32.eq - if - local.get $1 - i32.const 16 - i32.sub - local.set $1 - local.get $4 - i32.load - local.set $5 - else - nop - end - else - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.set $6 - local.get $6 - i32.const 48 - i32.lt_u - if - i32.const 0 - return - end - local.get $6 - i32.const 16 - i32.const 1 - i32.shl - i32.sub - local.set $7 - local.get $1 - local.set $8 - local.get $8 - local.get $7 - i32.const 1 - i32.or - local.get $5 - i32.const 2 - i32.and - i32.or - i32.store - local.get $8 - i32.const 0 - i32.store offset=16 - local.get $8 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $6 - i32.add - i32.const 16 - i32.sub - local.set $4 - local.get $4 - i32.const 0 - i32.const 2 - i32.or - i32.store - local.get $0 - local.set $9 - local.get $4 - local.set $3 - local.get $9 - local.get $3 - i32.store offset=1568 - local.get $0 - local.get $8 - call $~lib/rt/tlsf/insertBlock - i32.const 1 - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - global.get $~lib/rt/tlsf/ROOT - local.set $0 - local.get $0 - i32.eqz - if - global.get $~lib/heap/__heap_base - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $1 - memory.size - local.set $2 - local.get $1 - i32.const 1572 - i32.add - 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 $3 - local.get $2 - i32.gt_s - if (result i32) - local.get $3 - local.get $2 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - local.get $1 - local.set $0 - local.get $0 - i32.const 0 - i32.store - local.get $0 - local.set $5 - i32.const 0 - local.set $4 - local.get $5 - local.get $4 - i32.store offset=1568 - i32.const 0 - local.set $5 - loop $for-loop|0 - local.get $5 - i32.const 23 - i32.lt_u - local.set $4 - local.get $4 - if - local.get $0 - local.set $8 - local.get $5 - local.set $7 - i32.const 0 - local.set $6 - local.get $8 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=4 - i32.const 0 - local.set $8 - loop $for-loop|1 - local.get $8 - i32.const 16 - i32.lt_u - local.set $7 - local.get $7 - if - local.get $0 - local.set $11 - local.get $5 - local.set $10 - local.get $8 - local.set $9 - i32.const 0 - local.set $6 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $8 - i32.const 1 - i32.add - local.set $8 - br $for-loop|1 - end - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $1 - i32.const 1572 - i32.add - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $5 - local.get $0 - local.get $5 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - local.get $0 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741808 - i32.ge_u - if - i32.const 80 - i32.const 32 - i32.const 461 - i32.const 30 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.tee $1 - i32.const 16 - local.tee $2 - local.get $1 - local.get $2 - i32.gt_u - select - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $2 - local.get $1 - i32.const 4 - i32.shr_u - local.set $3 - else - local.get $1 - i32.const 536870904 - i32.lt_u - if (result i32) - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.add - i32.const 1 - i32.sub - else - local.get $1 - end - local.set $4 - i32.const 31 - local.get $4 - i32.clz - i32.sub - local.set $2 - local.get $4 - local.get $2 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $3 - local.get $2 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $2 - end - local.get $2 - i32.const 23 - i32.lt_u - if (result i32) - local.get $3 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 338 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $5 - local.get $2 - local.set $4 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 0 - i32.const -1 - i32.xor - local.get $3 - i32.shl - i32.and - local.set $6 - i32.const 0 - local.set $7 - local.get $6 - i32.eqz - if - local.get $0 - i32.load - i32.const 0 - i32.const -1 - i32.xor - local.get $2 - i32.const 1 - i32.add - i32.shl - i32.and - local.set $5 - local.get $5 - i32.eqz - if - i32.const 0 - local.set $7 - else - local.get $5 - i32.ctz - local.set $2 - local.get $0 - local.set $8 - local.get $2 - local.set $4 - local.get $8 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $6 - local.get $6 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - else - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - local.get $7 - ) - (func $~lib/rt/tlsf/growMemory (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $1 - i32.const 536870904 - i32.lt_u - if - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.const 1 - i32.sub - i32.add - local.set $1 - end - memory.size - local.set $2 - local.get $1 - i32.const 16 - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - i32.ne - i32.shl - i32.add - local.set $1 - local.get $1 - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $4 - local.get $2 - local.tee $3 - local.get $4 - local.tee $5 - local.get $3 - local.get $5 - i32.gt_s - select - local.set $6 - local.get $6 - memory.grow - i32.const 0 - i32.lt_s - if - local.get $4 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - memory.size - local.set $7 - local.get $0 - local.get $2 - i32.const 16 - i32.shl - local.get $7 - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - ) - (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.set $3 - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 365 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.sub - local.set $4 - local.get $4 - i32.const 32 - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $2 - i32.add - local.set $5 - local.get $5 - local.get $4 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $5 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $3 - i32.const 1 - i32.const -1 - i32.xor - i32.and - i32.store - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - i32.load - i32.const 2 - i32.const -1 - i32.xor - i32.and - i32.store - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - global.get $~lib/rt/tlsf/collectLock - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/rt/tlsf/prepareSize - local.set $3 - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - global.get $~lib/gc/gc.auto - if - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - call $~lib/rt/pure/__collect - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - else - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 518 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - end - end - local.get $4 - i32.load - i32.const -4 - i32.and - local.get $3 - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 0 - i32.store offset=4 - local.get $4 - local.get $2 - i32.store offset=8 - local.get $4 - local.get $1 - i32.store offset=12 - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $0 - local.get $4 - local.get $3 - call $~lib/rt/tlsf/prepareBlock - local.get $4 - ) - (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - local.get $1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - ) - (func $~lib/rt/pure/increment (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const -268435456 - i32.and - local.get $1 - i32.const 1 - i32.add - i32.const -268435456 - i32.and - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 109 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 112 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/rt/pure/__retain (param $0 i32) (result i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/increment - end - local.get $0 - ) - (func $~lib/rt/pure/__release (param $0 i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - end - ) - (func $std/object-literal-omitted/testOmittedTypes (param $0 i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - i32.load - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 19 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 20 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=8 - i64.const 0 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 21 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=16 - i64.const 0 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 22 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f32.load offset=24 - f32.const 0 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 23 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=32 - f64.const 0 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 24 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_s offset=40 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 25 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=41 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 26 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_s offset=42 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 27 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_u offset=44 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 28 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=48 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 29 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=52 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 30 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=56 - f64.const 0 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 31 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=64 - i32.const 0 - i32.ne - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 32 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/pure/__release - ) - (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/pure/__retain - local.set $0 - local.get $2 - call $~lib/rt/pure/__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 - 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/pure/__release - local.get $2 - call $~lib/rt/pure/__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/pure/__release - local.get $2 - call $~lib/rt/pure/__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/pure/__retain - local.set $0 - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - ) - (func $std/object-literal-omitted/testMixedOmitted (param $0 i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - i32.load - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 44 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - i32.const 272 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=8 - f64.const 0 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/pure/__release - ) - (func $start:std/object-literal-omitted - (local $0 i32) - (local $1 i32) - i32.const 65 - i32.const 3 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i64.const 0 - i64.store offset=8 - local.get $0 - i64.const 0 - i64.store offset=16 - local.get $0 - f32.const 0 - f32.store offset=24 - local.get $0 - f64.const 0 - f64.store offset=32 - local.get $0 - i32.const 0 - i32.store8 offset=40 - local.get $0 - i32.const 0 - i32.store8 offset=41 - local.get $0 - i32.const 0 - i32.store16 offset=42 - local.get $0 - i32.const 0 - i32.store16 offset=44 - local.get $0 - i32.const 0 - i32.store offset=48 - local.get $0 - i32.const 0 - i32.store offset=52 - local.get $0 - f64.const 0 - f64.store offset=56 - local.get $0 - i32.const 0 - i32.store8 offset=64 - local.get $0 - call $std/object-literal-omitted/testOmittedTypes - i32.const 16 - i32.const 4 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $1 - local.get $1 - i32.const 0 - i32.store - local.get $1 - i32.const 272 - i32.store offset=4 - local.get $1 - f64.const 0 - f64.store offset=8 - local.get $1 - call $std/object-literal-omitted/testMixedOmitted - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $~start - call $start:std/object-literal-omitted - ) - (func $~lib/rt/pure/__collect - return - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/pure/decrement (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 268435455 - i32.and - local.set $2 - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 122 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 1 - i32.eq - if - local.get $0 - i32.const 16 - i32.add - i32.const 1 - call $~lib/rt/__visit_members - local.get $1 - i32.const -2147483648 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 126 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/freeBlock - else - local.get $2 - i32.const 0 - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 136 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.const 1 - i32.sub - i32.or - i32.store offset=4 - end - ) - (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.lt_u - if - return - end - local.get $1 - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 69 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - ) - (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) - (local $2 i32) - block $switch$1$default - block $switch$1$case$6 - block $switch$1$case$4 - block $switch$1$case$2 - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$case$6 $switch$1$default - end - return - end - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/pure/__visit - end - return - end - local.get $0 - i32.load offset=4 - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/pure/__visit - end - return - end - unreachable - ) -) diff --git a/tests/compiler/std/object-literal-unmanaged.json b/tests/compiler/std/object-literal-unmanaged.json deleted file mode 100644 index 9f7878d475..0000000000 --- a/tests/compiler/std/object-literal-unmanaged.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "asc_flags": [ - "--runtime half", - "--use ASC_RTRACE=1" - ] -} \ No newline at end of file diff --git a/tests/compiler/std/object-literal-unmanaged.optimized.wat b/tests/compiler/std/object-literal-unmanaged.optimized.wat deleted file mode 100644 index eb137632c3..0000000000 --- a/tests/compiler/std/object-literal-unmanaged.optimized.wat +++ /dev/null @@ -1,970 +0,0 @@ -(module - (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) - (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) - (memory $0 1) - (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) ">\00\00\00\01\00\00\00\01\00\00\00>\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00u\00n\00m\00a\00n\00a\00g\00e\00d\00.\00t\00s") - (global $std/object-literal-unmanaged/foo (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.tee $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $4 - i32.const 7 - i32.sub - local.set $4 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $4 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=20 - local.set $3 - local.get $1 - i32.load offset=16 - local.tee $5 - if - local.get $5 - local.get $3 - i32.store offset=20 - end - local.get $3 - if - local.get $3 - local.get $5 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $3 - i32.store offset=96 - local.get $3 - i32.eqz - if - local.get $0 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.tee $3 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.const -1 - i32.xor - i32.and - local.set $1 - local.get $3 - local.get $1 - i32.store offset=4 - local.get $1 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.tee $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.tee $5 - i32.const 1 - i32.and - if - local.get $3 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const -4 - i32.and - i32.add - local.tee $2 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - local.get $3 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.set $5 - end - end - local.get $3 - i32.const 2 - i32.and - if - local.get $1 - i32.const 4 - i32.sub - i32.load - local.tee $2 - i32.load - local.tee $7 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $7 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $3 - i32.const -4 - i32.and - i32.add - local.tee $8 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $2 - call $~lib/rt/tlsf/removeBlock - local.get $2 - local.get $8 - local.get $7 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $2 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $3 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.const 16 - i32.add - i32.add - local.get $4 - i32.ne - if - i32.const 0 - i32.const 1040 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $3 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $3 - i32.const 7 - i32.sub - local.set $6 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $6 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $3 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $3 - i32.store offset=20 - local.get $3 - if - local.get $3 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $1 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $6 - i32.shl - i32.or - i32.store - local.get $0 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.tee $0 - local.get $0 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.or - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - local.get $2 - i32.le_u - select - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=1568 - local.tee $3 - if - local.get $1 - local.get $3 - i32.const 16 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 16 - i32.sub - i32.eq - if - local.get $3 - i32.load - local.set $4 - local.get $1 - i32.const 16 - i32.sub - local.set $1 - end - else - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.tee $2 - i32.const 48 - i32.lt_u - if - return - end - local.get $1 - local.get $4 - i32.const 2 - i32.and - local.get $2 - i32.const 32 - i32.sub - i32.const 1 - i32.or - i32.or - i32.store - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.tee $2 - i32.const 2 - i32.store - local.get $0 - local.get $2 - i32.store offset=1568 - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/rt/tlsf/ROOT - local.tee $0 - i32.eqz - if - i32.const 1 - memory.size - local.tee $0 - i32.gt_s - if (result i32) - i32.const 1 - local.get $0 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - i32.const 1216 - local.tee $0 - i32.const 0 - i32.store - i32.const 2784 - i32.const 0 - i32.store - loop $for-loop|0 - local.get $1 - i32.const 23 - i32.lt_u - if - local.get $1 - i32.const 2 - i32.shl - i32.const 1216 - i32.add - i32.const 0 - i32.store offset=4 - i32.const 0 - local.set $2 - loop $for-loop|1 - local.get $2 - i32.const 16 - i32.lt_u - if - local.get $2 - local.get $1 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.const 1216 - i32.add - i32.const 0 - i32.store offset=96 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|1 - end - end - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|0 - end - end - i32.const 1216 - i32.const 2800 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - i32.const 1216 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - nop - local.get $0 - i32.load offset=4 - i32.const -2 - i32.and - local.tee $2 - if (result i32) - local.get $0 - local.get $2 - i32.ctz - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - local.get $0 - i32.load - i32.const -2 - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.tee $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.tee $2 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - i32.ctz - local.get $1 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - i32.const 0 - end - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/rt/tlsf/collectLock - if - i32.const 0 - i32.const 1040 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/tlsf/searchBlock - local.tee $1 - i32.eqz - if - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - call $~lib/rt/tlsf/searchBlock - local.tee $1 - i32.eqz - if - i32.const 16 - memory.size - local.tee $2 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - i32.load offset=1568 - i32.ne - i32.shl - i32.const 65551 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.set $1 - local.get $2 - local.get $1 - local.get $2 - local.get $1 - i32.gt_s - select - memory.grow - i32.const 0 - i32.lt_s - if - local.get $1 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - local.get $0 - local.get $2 - i32.const 16 - i32.shl - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - local.get $0 - call $~lib/rt/tlsf/searchBlock - local.tee $1 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - end - local.get $1 - i32.load - i32.const -4 - i32.and - i32.const 16 - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 4 - i32.store offset=12 - local.get $0 - local.get $1 - call $~lib/rt/tlsf/removeBlock - local.get $1 - i32.load - local.tee $2 - i32.const -4 - i32.and - i32.const 16 - i32.sub - local.tee $3 - i32.const 32 - i32.ge_u - if - local.get $1 - local.get $2 - i32.const 2 - i32.and - i32.const 16 - i32.or - i32.store - local.get $1 - i32.const 32 - i32.add - local.tee $2 - local.get $3 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $2 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $2 - i32.const -2 - i32.and - i32.store - local.get $1 - i32.const 16 - i32.add - local.tee $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.get $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - i32.load - i32.const -3 - i32.and - i32.store - end - local.get $1 - call $~lib/rt/rtrace/onalloc - local.get $1 - ) - (func $~start - (local $0 i32) - (local $1 i32) - (local $2 i32) - call $~lib/rt/tlsf/maybeInitialize - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - local.tee $0 - i32.const 123 - i32.store - local.get $0 - global.set $std/object-literal-unmanaged/foo - global.get $std/object-literal-unmanaged/foo - i32.load - i32.const 123 - i32.ne - if - i32.const 0 - i32.const 1152 - i32.const 13 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/object-literal-unmanaged/foo - local.set $1 - call $~lib/rt/tlsf/maybeInitialize - local.get $1 - i32.const 16 - i32.sub - local.set $0 - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - select - if (result i32) - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $0 - i32.load offset=4 - i32.const -268435456 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 581 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $0 - i32.load - i32.const 1 - i32.or - i32.store - local.get $0 - call $~lib/rt/tlsf/insertBlock - local.get $0 - call $~lib/rt/rtrace/onfree - ) -) diff --git a/tests/compiler/std/object-literal-unmanaged.ts b/tests/compiler/std/object-literal-unmanaged.ts deleted file mode 100644 index b01dff30c2..0000000000 --- a/tests/compiler/std/object-literal-unmanaged.ts +++ /dev/null @@ -1,15 +0,0 @@ -@unmanaged -class Foo { - a: i32; -} - -var foo: Foo; - -function test(a: i32): i32 { - foo = { a: a }; - return foo.a; -} - -assert(test(123) == 123); - -__free(changetype(foo)); diff --git a/tests/compiler/std/object-literal-unmanaged.untouched.wat b/tests/compiler/std/object-literal-unmanaged.untouched.wat deleted file mode 100644 index 2d65d35766..0000000000 --- a/tests/compiler/std/object-literal-unmanaged.untouched.wat +++ /dev/null @@ -1,1504 +0,0 @@ -(module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) - (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) - (memory $0 1) - (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) ">\00\00\00\01\00\00\00\01\00\00\00>\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00u\00n\00m\00a\00n\00a\00g\00e\00d\00.\00t\00s\00") - (table $0 1 funcref) - (global $std/object-literal-unmanaged/foo (mut i32) (i32.const 0)) - (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 208)) - (export "memory" (memory $0)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $1 - i32.load - local.set $2 - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $3 - local.get $3 - i32.const 16 - i32.ge_u - if (result i32) - local.get $3 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $4 - local.get $3 - i32.const 4 - i32.shr_u - local.set $5 - else - i32.const 31 - local.get $3 - i32.clz - i32.sub - local.set $4 - local.get $3 - local.get $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $5 - local.get $4 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $4 - end - local.get $4 - i32.const 23 - i32.lt_u - if (result i32) - local.get $5 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=16 - local.set $6 - local.get $1 - i32.load offset=20 - local.set $7 - local.get $6 - if - local.get $6 - local.get $7 - i32.store offset=20 - end - local.get $7 - if - local.get $7 - local.get $6 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.set $10 - local.get $4 - local.set $9 - local.get $5 - local.set $8 - local.get $10 - local.get $9 - i32.const 4 - i32.shl - local.get $8 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.set $11 - local.get $4 - local.set $10 - local.get $5 - local.set $9 - local.get $7 - local.set $8 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.store offset=96 - local.get $7 - i32.eqz - if - local.get $0 - local.set $9 - local.get $4 - local.set $8 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $9 - local.get $0 - local.set $8 - local.get $4 - local.set $11 - local.get $9 - i32.const 1 - local.get $5 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $9 - local.set $10 - local.get $8 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.store offset=4 - local.get $9 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.set $2 - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.set $3 - local.get $3 - i32.const 16 - i32.add - local.get $3 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - local.get $5 - i32.const 1 - i32.and - if - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $3 - local.get $3 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - i32.const 3 - i32.and - local.get $3 - i32.or - local.tee $2 - i32.store - local.get $1 - local.set $6 - local.get $6 - i32.const 16 - i32.add - local.get $6 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - end - end - local.get $2 - i32.const 2 - i32.and - if - local.get $1 - local.set $6 - local.get $6 - i32.const 4 - i32.sub - i32.load - local.set $6 - local.get $6 - i32.load - local.set $3 - local.get $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $7 - local.get $7 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $6 - call $~lib/rt/tlsf/removeBlock - local.get $6 - local.get $3 - i32.const 3 - i32.and - local.get $7 - i32.or - local.tee $2 - i32.store - local.get $6 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $8 - local.get $8 - i32.const 16 - i32.ge_u - if (result i32) - local.get $8 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.add - local.get $8 - i32.add - local.get $4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $8 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $9 - local.get $8 - i32.const 4 - i32.shr_u - local.set $10 - else - i32.const 31 - local.get $8 - i32.clz - i32.sub - local.set $9 - local.get $8 - local.get $9 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $10 - local.get $9 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $9 - end - local.get $9 - i32.const 23 - i32.lt_u - if (result i32) - local.get $10 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $7 - local.get $9 - local.set $3 - local.get $10 - local.set $6 - local.get $7 - local.get $3 - i32.const 4 - i32.shl - local.get $6 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $11 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $11 - i32.store offset=20 - local.get $11 - if - local.get $11 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.set $12 - local.get $9 - local.set $7 - local.get $10 - local.set $3 - local.get $1 - local.set $6 - local.get $12 - local.get $7 - i32.const 4 - i32.shl - local.get $3 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $9 - i32.shl - i32.or - i32.store - local.get $0 - local.set $13 - local.get $9 - local.set $12 - local.get $0 - local.set $3 - local.get $9 - local.set $6 - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 1 - local.get $10 - i32.shl - i32.or - local.set $7 - local.get $13 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - local.get $2 - i32.le_u - if (result i32) - local.get $1 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - local.set $4 - i32.const 0 - local.set $5 - local.get $4 - if - local.get $1 - local.get $4 - i32.const 16 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.sub - local.get $4 - i32.eq - if - local.get $1 - i32.const 16 - i32.sub - local.set $1 - local.get $4 - i32.load - local.set $5 - else - nop - end - else - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.set $6 - local.get $6 - i32.const 48 - i32.lt_u - if - i32.const 0 - return - end - local.get $6 - i32.const 16 - i32.const 1 - i32.shl - i32.sub - local.set $7 - local.get $1 - local.set $8 - local.get $8 - local.get $7 - i32.const 1 - i32.or - local.get $5 - i32.const 2 - i32.and - i32.or - i32.store - local.get $8 - i32.const 0 - i32.store offset=16 - local.get $8 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $6 - i32.add - i32.const 16 - i32.sub - local.set $4 - local.get $4 - i32.const 0 - i32.const 2 - i32.or - i32.store - local.get $0 - local.set $9 - local.get $4 - local.set $3 - local.get $9 - local.get $3 - i32.store offset=1568 - local.get $0 - local.get $8 - call $~lib/rt/tlsf/insertBlock - i32.const 1 - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - global.get $~lib/rt/tlsf/ROOT - local.set $0 - local.get $0 - i32.eqz - if - global.get $~lib/heap/__heap_base - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $1 - memory.size - local.set $2 - local.get $1 - i32.const 1572 - i32.add - 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 $3 - local.get $2 - i32.gt_s - if (result i32) - local.get $3 - local.get $2 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - local.get $1 - local.set $0 - local.get $0 - i32.const 0 - i32.store - local.get $0 - local.set $5 - i32.const 0 - local.set $4 - local.get $5 - local.get $4 - i32.store offset=1568 - i32.const 0 - local.set $5 - loop $for-loop|0 - local.get $5 - i32.const 23 - i32.lt_u - local.set $4 - local.get $4 - if - local.get $0 - local.set $8 - local.get $5 - local.set $7 - i32.const 0 - local.set $6 - local.get $8 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=4 - i32.const 0 - local.set $8 - loop $for-loop|1 - local.get $8 - i32.const 16 - i32.lt_u - local.set $7 - local.get $7 - if - local.get $0 - local.set $11 - local.get $5 - local.set $10 - local.get $8 - local.set $9 - i32.const 0 - local.set $6 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $8 - i32.const 1 - i32.add - local.set $8 - br $for-loop|1 - end - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $1 - i32.const 1572 - i32.add - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $5 - local.get $0 - local.get $5 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - local.get $0 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741808 - i32.ge_u - if - i32.const 80 - i32.const 32 - i32.const 461 - i32.const 30 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.tee $1 - i32.const 16 - local.tee $2 - local.get $1 - local.get $2 - i32.gt_u - select - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $2 - local.get $1 - i32.const 4 - i32.shr_u - local.set $3 - else - local.get $1 - i32.const 536870904 - i32.lt_u - if (result i32) - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.add - i32.const 1 - i32.sub - else - local.get $1 - end - local.set $4 - i32.const 31 - local.get $4 - i32.clz - i32.sub - local.set $2 - local.get $4 - local.get $2 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $3 - local.get $2 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $2 - end - local.get $2 - i32.const 23 - i32.lt_u - if (result i32) - local.get $3 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 338 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $5 - local.get $2 - local.set $4 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 0 - i32.const -1 - i32.xor - local.get $3 - i32.shl - i32.and - local.set $6 - i32.const 0 - local.set $7 - local.get $6 - i32.eqz - if - local.get $0 - i32.load - i32.const 0 - i32.const -1 - i32.xor - local.get $2 - i32.const 1 - i32.add - i32.shl - i32.and - local.set $5 - local.get $5 - i32.eqz - if - i32.const 0 - local.set $7 - else - local.get $5 - i32.ctz - local.set $2 - local.get $0 - local.set $8 - local.get $2 - local.set $4 - local.get $8 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $6 - local.get $6 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - else - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - local.get $7 - ) - (func $~lib/rt/tlsf/growMemory (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - local.get $1 - i32.const 536870904 - i32.lt_u - if - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.const 1 - i32.sub - i32.add - local.set $1 - end - memory.size - local.set $2 - local.get $1 - i32.const 16 - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - i32.ne - i32.shl - i32.add - local.set $1 - local.get $1 - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $4 - local.get $2 - local.tee $3 - local.get $4 - local.tee $5 - local.get $3 - local.get $5 - i32.gt_s - select - local.set $6 - local.get $6 - memory.grow - i32.const 0 - i32.lt_s - if - local.get $4 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - memory.size - local.set $7 - local.get $0 - local.get $2 - i32.const 16 - i32.shl - local.get $7 - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - ) - (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.set $3 - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 365 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.sub - local.set $4 - local.get $4 - i32.const 32 - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $2 - i32.add - local.set $5 - local.get $5 - local.get $4 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $5 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $3 - i32.const 1 - i32.const -1 - i32.xor - i32.and - i32.store - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - i32.load - i32.const 2 - i32.const -1 - i32.xor - i32.and - i32.store - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - global.get $~lib/rt/tlsf/collectLock - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/rt/tlsf/prepareSize - local.set $3 - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - global.get $~lib/gc/gc.auto - if - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - call $~lib/rt/pure/__collect - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - else - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 518 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - end - end - local.get $4 - i32.load - i32.const -4 - i32.and - local.get $3 - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 0 - i32.store offset=4 - local.get $4 - local.get $2 - i32.store offset=8 - local.get $4 - local.get $1 - i32.store offset=12 - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $0 - local.get $4 - local.get $3 - call $~lib/rt/tlsf/prepareBlock - local.get $4 - call $~lib/rt/rtrace/onalloc - local.get $4 - ) - (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - local.get $1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - ) - (func $std/object-literal-unmanaged/test (param $0 i32) (result i32) - (local $1 i32) - i32.const 4 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.set $1 - local.get $1 - local.get $0 - i32.store - local.get $1 - global.set $std/object-literal-unmanaged/foo - global.get $std/object-literal-unmanaged/foo - i32.load - ) - (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 16 - i32.sub - local.set $1 - local.get $0 - i32.const 0 - i32.ne - if (result i32) - local.get $0 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $1 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $1 - i32.load offset=4 - i32.const -268435456 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 581 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - local.get $1 - call $~lib/rt/rtrace/onfree - ) - (func $~lib/rt/tlsf/__free (param $0 i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - call $~lib/rt/tlsf/checkUsedBlock - call $~lib/rt/tlsf/freeBlock - ) - (func $start:std/object-literal-unmanaged - i32.const 123 - call $std/object-literal-unmanaged/test - i32.const 123 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 13 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/object-literal-unmanaged/foo - call $~lib/rt/tlsf/__free - ) - (func $~start - call $start:std/object-literal-unmanaged - ) - (func $~lib/rt/pure/__collect - return - ) -) diff --git a/tests/compiler/std/object-literal.json b/tests/compiler/std/object-literal.json index b1da366ff4..59c251c705 100644 --- a/tests/compiler/std/object-literal.json +++ b/tests/compiler/std/object-literal.json @@ -1,5 +1,7 @@ { "asc_flags": [ - "--runtime none" + "--runtime half", + "--explicitStart", + "--use ASC_RTRACE=1" ] } \ No newline at end of file diff --git a/tests/compiler/std/object-literal.optimized.wat b/tests/compiler/std/object-literal.optimized.wat index 685d9d3e24..bf611d84c9 100644 --- a/tests/compiler/std/object-literal.optimized.wat +++ b/tests/compiler/std/object-literal.optimized.wat @@ -1,285 +1,2281 @@ (module - (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) (memory $0 1) (data (i32.const 1024) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d") - (data (i32.const 1072) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") - (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) + (data (i32.const 1072) "\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 1120) "(\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 1184) "\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 1232) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") + (data (i32.const 1300) "\01\00\00\00\01") + (data (i32.const 1312) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00h\00e\00l\00l\00o") + (data (i32.const 1344) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t") + (data (i32.const 1376) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00b\00a\00r") + (data (i32.const 1408) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00b\00a\00z") + (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)) + (export "_start" (func $~start)) (export "memory" (memory $0)) - (start $~start) - (func $~lib/rt/stub/__alloc (param $0 i32) (param $1 i32) (result i32) + (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - local.get $0 - i32.const 1073741808 - i32.gt_u + local.get $1 + i32.load + local.tee $2 + i32.const 1 + i32.and + i32.eqz if + i32.const 0 + i32.const 1088 + i32.const 277 + i32.const 14 + call $~lib/builtins/abort 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 + local.get $2 + i32.const -4 i32.and local.tee $2 i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 279 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 256 + i32.lt_u + if + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $4 + i32.const 7 + i32.sub + local.set $4 + end local.get $2 i32.const 16 - i32.gt_u + i32.lt_u + i32.const 0 + local.get $4 + i32.const 23 + i32.lt_u select - local.tee $6 - i32.add - local.tee $2 - memory.size + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 292 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=20 + local.set $3 + local.get $1 + i32.load offset=16 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 + i32.store offset=20 + end + local.get $3 + if 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 + local.get $5 + i32.store offset=16 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 $2 local.get $4 - ) - (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) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 1040 - local.set $3 - local.get $0 - i32.const 7 - i32.and - i32.eqz - i32.const 0 - local.get $1 i32.const 4 - i32.ge_u - select + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + i32.eq if - loop $do-continue|0 - local.get $0 - i64.load - local.get $3 - i64.load - i64.eq - if - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $3 - i32.const 8 - i32.add - local.set $3 - local.get $1 - i32.const 4 - i32.sub - local.tee $1 - i32.const 4 - i32.ge_u - br_if $do-continue|0 - end - end - end - loop $while-continue|1 - local.get $1 - local.tee $2 - i32.const 1 - i32.sub - local.set $1 + local.get $0 local.get $2 + local.get $4 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + local.get $3 + i32.store offset=96 + local.get $3 + i32.eqz if local.get $0 - i32.load16_u - local.tee $2 - local.get $3 - i32.load16_u - local.tee $4 - i32.ne - if - local.get $2 - local.get $4 - i32.sub - return - end - local.get $0 - i32.const 2 - i32.add - local.set $0 - local.get $3 + local.get $4 i32.const 2 + i32.shl i32.add - local.set $3 - br $while-continue|1 - end - end - i32.const 0 - ) - (func $start:std/object-literal - (local $0 i32) - (local $1 i32) - i32.const 1136 - global.set $~lib/rt/stub/offset - i32.const 8 - i32.const 3 - call $~lib/rt/stub/__alloc - local.tee $0 - i32.const 1 - i32.store - local.get $0 - i32.const 1040 - i32.store offset=4 - local.get $0 - i32.load - i32.const 1 - i32.ne - if - i32.const 0 - i32.const 1088 - i32.const 7 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - block $__inlined_func$~lib/string/String.__eq (result i32) - i32.const 1 - local.get $0 - i32.load offset=4 - local.tee $1 - i32.const 1040 - i32.eq - br_if $__inlined_func$~lib/string/String.__eq - drop - block $folding-inner0 - i32.const 0 + local.tee $3 + i32.load offset=4 i32.const 1 + local.get $2 + i32.shl + i32.const -1 + i32.xor + i32.and + local.set $1 + local.get $3 local.get $1 - select - br_if $folding-inner0 - local.get $1 - call $~lib/string/String#get:length - local.tee $0 - i32.const 1040 - call $~lib/string/String#get:length - i32.ne - br_if $folding-inner0 + i32.store offset=4 local.get $1 - local.get $0 - call $~lib/util/string/compareImpl i32.eqz - br $__inlined_func$~lib/string/String.__eq + if + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store + end end - i32.const 0 end + ) + (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + local.get $1 i32.eqz if i32.const 0 i32.const 1088 - i32.const 8 - i32.const 3 + i32.const 205 + i32.const 14 call $~lib/builtins/abort unreachable end - i32.const 4 - i32.const 4 - call $~lib/rt/stub/__alloc - local.tee $0 - i32.const 2 - i32.store - local.get $0 + local.get $1 i32.load - i32.const 2 - i32.ne + local.tee $3 + i32.const 1 + i32.and + i32.eqz if i32.const 0 i32.const 1088 - i32.const 24 - i32.const 3 + i32.const 207 + i32.const 14 call $~lib/builtins/abort unreachable end + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $5 + i32.const 1 + i32.and + if + local.get $3 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const -4 + i32.and + i32.add + local.tee $2 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + local.get $3 + i32.const 3 + i32.and + i32.or + local.tee $3 + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $5 + end + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $2 + i32.load + local.tee $7 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 228 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $7 + i32.const -4 + i32.and + i32.const 16 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $8 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/removeBlock + local.get $2 + local.get $8 + local.get $7 + i32.const 3 + i32.and + i32.or + local.tee $3 + i32.store + local.get $2 + local.set $1 + end + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $2 + i32.const 16 + i32.ge_u + if (result i32) + local.get $2 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 243 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $1 + i32.const 16 + i32.add + i32.add + local.get $4 + i32.ne + if + i32.const 0 + i32.const 1088 + i32.const 244 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $2 + i32.const 256 + i32.lt_u + if + local.get $2 + i32.const 4 + i32.shr_u + local.set $2 + else + local.get $2 + i32.const 31 + local.get $2 + i32.clz + i32.sub + local.tee $3 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $2 + local.get $3 + i32.const 7 + i32.sub + local.set $6 + end + local.get $2 + i32.const 16 + i32.lt_u + i32.const 0 + local.get $6 + i32.const 23 + i32.lt_u + select + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 260 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + local.get $6 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $3 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $3 + i32.store offset=20 + local.get $3 + if + local.get $3 + local.get $1 + i32.store offset=16 + end + local.get $0 + local.get $2 + local.get $6 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + local.get $1 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $6 + i32.shl + i32.or + i32.store + local.get $0 + local.get $6 + i32.const 2 + i32.shl + i32.add + local.tee $0 + local.get $0 + i32.load offset=4 + i32.const 1 + local.get $2 + i32.shl + i32.or + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $1 + local.get $2 + i32.le_u + select + select + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 386 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=1568 + local.tee $3 + if + local.get $1 + local.get $3 + i32.const 16 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 1088 + i32.const 396 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $1 + i32.const 16 + i32.sub + i32.eq + if + local.get $3 + i32.load + local.set $4 + local.get $1 + i32.const 16 + i32.sub + local.set $1 + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 1088 + i32.const 408 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.tee $2 + i32.const 48 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 32 + i32.sub + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $2 + i32.add + i32.const 16 + i32.sub + local.tee $2 + i32.const 2 + i32.store + local.get $0 + local.get $2 + i32.store offset=1568 + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/maybeInitialize (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + global.get $~lib/rt/tlsf/ROOT + local.tee $0 + i32.eqz + if + i32.const 1 + memory.size + local.tee $0 + i32.gt_s + if (result i32) + i32.const 1 + local.get $0 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + i32.const 1440 + local.tee $0 + i32.const 0 + i32.store + i32.const 3008 + i32.const 0 + i32.store + loop $for-loop|0 + local.get $1 + i32.const 23 + i32.lt_u + if + local.get $1 + i32.const 2 + i32.shl + i32.const 1440 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $2 + loop $for-loop|1 + local.get $2 + i32.const 16 + i32.lt_u + if + local.get $2 + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.const 1440 + i32.add + i32.const 0 + i32.store offset=96 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $for-loop|1 + end + end + local.get $1 + i32.const 1 + i32.add + local.set $1 + br $for-loop|0 + end + end + i32.const 1440 + i32.const 3024 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 1440 + global.set $~lib/rt/tlsf/ROOT + end + local.get $0 + ) + (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + local.get $1 + i32.const 4 + i32.shr_u + local.set $1 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + local.set $1 + end + local.get $1 + i32.const 31 + local.get $1 + i32.clz + i32.sub + local.tee $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + local.set $1 + local.get $2 + i32.const 7 + i32.sub + local.set $2 + end + local.get $1 + i32.const 16 + i32.lt_u + i32.const 0 + local.get $2 + i32.const 23 + i32.lt_u + select + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 338 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const -1 + local.get $1 + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.get $2 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + else + local.get $0 + i32.load + i32.const -1 + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.tee $1 + if (result i32) + local.get $0 + local.get $1 + i32.ctz + local.tee $1 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.tee $2 + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 351 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $2 + i32.ctz + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + else + i32.const 0 + end + end + ) + (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + if + i32.const 0 + i32.const 1088 + i32.const 365 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const -4 + i32.and + local.get $2 + i32.sub + local.tee $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $2 + local.get $1 + i32.const 16 + i32.add + i32.add + local.tee $1 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const -2 + i32.and + i32.store + local.get $1 + i32.const 16 + i32.add + local.tee $0 + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.get $0 + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + global.get $~lib/rt/tlsf/collectLock + if + i32.const 0 + i32.const 1088 + i32.const 501 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1073741808 + i32.ge_u + if + i32.const 1136 + i32.const 1088 + i32.const 461 + i32.const 30 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 15 + i32.add + i32.const -16 + i32.and + local.tee $3 + i32.const 16 + local.get $3 + i32.const 16 + i32.gt_u + select + local.tee $4 + call $~lib/rt/tlsf/searchBlock + local.tee $3 + i32.eqz + if + i32.const 1 + global.set $~lib/rt/tlsf/collectLock + i32.const 0 + global.set $~lib/rt/tlsf/collectLock + local.get $0 + local.get $4 + call $~lib/rt/tlsf/searchBlock + local.tee $3 + i32.eqz + if + i32.const 16 + memory.size + local.tee $3 + i32.const 16 + i32.shl + i32.const 16 + i32.sub + local.get $0 + i32.load offset=1568 + i32.ne + i32.shl + local.get $4 + i32.const 1 + i32.const 27 + local.get $4 + i32.clz + i32.sub + i32.shl + i32.const 1 + i32.sub + i32.add + local.get $4 + local.get $4 + i32.const 536870904 + i32.lt_u + select + i32.add + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.set $5 + local.get $3 + local.get $5 + local.get $3 + local.get $5 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $5 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $0 + local.get $3 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + local.get $0 + local.get $4 + call $~lib/rt/tlsf/searchBlock + local.tee $3 + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 513 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + end + end + local.get $3 + i32.load + i32.const -4 + i32.and + local.get $4 + i32.lt_u + if + i32.const 0 + i32.const 1088 + i32.const 521 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + local.get $2 + i32.store offset=8 + local.get $3 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $4 + call $~lib/rt/tlsf/prepareBlock + local.get $3 + call $~lib/rt/rtrace/onalloc + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) + call $~lib/rt/tlsf/maybeInitialize + local.get $0 + local.get $1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/__retain (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1432 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + local.tee $1 + i32.load offset=4 + local.tee $2 + i32.const -268435456 + i32.and + local.get $2 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.ne + if + i32.const 0 + i32.const 1200 + i32.const 109 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + i32.const 1 + i32.add + i32.store offset=4 + local.get $1 + call $~lib/rt/rtrace/onincrement + local.get $1 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 1200 + i32.const 112 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + end + local.get $0 + ) + (func $~lib/rt/pure/__release (param $0 i32) + local.get $0 + i32.const 1432 + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (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 + local.get $1 + i32.eqz + i32.const 1 + local.get $0 + select + if + i32.const 0 + return + end + local.get $0 + call $~lib/string/String#get:length + local.tee $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + if + i32.const 0 + return + end + local.get $0 + local.get $1 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz + ) + (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $2 + local.set $4 + local.get $0 + local.get $1 + i32.eq + br_if $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.get $1 + i32.lt_u + if + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|0 + local.get $0 + i32.const 7 + i32.and + if + local.get $4 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $3 + i32.load8_u + i32.store8 + br $while-continue|0 + end + end + loop $while-continue|1 + local.get $4 + i32.const 8 + i32.ge_u + if + local.get $0 + local.get $1 + i64.load + i64.store + local.get $4 + i32.const 8 + i32.sub + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + br $while-continue|1 + end + end + end + loop $while-continue|2 + local.get $4 + if + local.get $0 + local.tee $2 + i32.const 1 + i32.add + local.set $0 + local.get $1 + local.tee $3 + i32.const 1 + i32.add + local.set $1 + local.get $2 + local.get $3 + i32.load8_u + i32.store8 + local.get $4 + i32.const 1 + i32.sub + local.set $4 + br $while-continue|2 + end + end + else + local.get $1 + i32.const 7 + i32.and + local.get $0 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|3 + local.get $0 + local.get $4 + i32.add + i32.const 7 + i32.and + if + local.get $4 + i32.eqz + br_if $~lib/util/memory/memmove|inlined.0 + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i32.load8_u + i32.store8 + br $while-continue|3 + end + end + loop $while-continue|4 + local.get $4 + i32.const 8 + i32.ge_u + if + local.get $4 + i32.const 8 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i64.load + i64.store + br $while-continue|4 + end + end + end + loop $while-continue|5 + local.get $4 + if + local.get $4 + i32.const 1 + i32.sub + local.tee $4 + local.get $0 + i32.add + local.get $1 + local.get $4 + i32.add + i32.load8_u + i32.store8 + br $while-continue|5 + end + end + end + end + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $std/object-literal/testOmittedTypes (param $0 i32) + local.get $0 + i32.load + if + i32.const 0 + i32.const 1248 + i32.const 58 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + if + i32.const 0 + i32.const 1248 + i32.const 59 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i64.load offset=8 + i64.eqz + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 60 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i64.load offset=16 + i64.eqz + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 61 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + f32.load offset=24 + f32.const 0 + f32.ne + if + i32.const 0 + i32.const 1248 + i32.const 62 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + f64.load offset=32 + f64.const 0 + f64.ne + if + i32.const 0 + i32.const 1248 + i32.const 63 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load8_s offset=40 + if + i32.const 0 + i32.const 1248 + i32.const 64 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load8_u offset=41 + if + i32.const 0 + i32.const 1248 + i32.const 65 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load16_s offset=42 + if + i32.const 0 + i32.const 1248 + i32.const 66 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load16_u offset=44 + if + i32.const 0 + i32.const 1248 + i32.const 67 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=48 + if + i32.const 0 + i32.const 1248 + i32.const 68 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=52 + if + i32.const 0 + i32.const 1248 + i32.const 69 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + f64.load offset=56 + f64.const 0 + f64.ne + if + i32.const 0 + i32.const 1248 + i32.const 70 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load8_u offset=64 + if + i32.const 0 + i32.const 1248 + i32.const 71 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + ) + (func $std/object-literal/testOmittedFoo (param $0 i32) + local.get $0 + i32.load + i32.const 1392 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 108 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 1424 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 109 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 110 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=12 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 111 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=16 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 112 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=20 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 113 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=24 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 114 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=28 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 115 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=32 + if + i32.const 0 + i32.const 1248 + i32.const 116 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=36 + i32.const -1 + i32.ne + if + i32.const 0 + i32.const 1248 + i32.const 117 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + ) + (func $start:std/object-literal + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 8 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $3 + i32.const 0 + i32.store + local.get $3 + i32.const 0 + i32.store offset=4 + local.get $3 + i32.const 123 + i32.store + local.get $3 + i32.const 1040 + i32.store offset=4 + local.get $3 + i32.load + i32.const 123 + i32.ne + if + i32.const 0 + i32.const 1248 + i32.const 9 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.load offset=4 + i32.const 1040 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 10 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 8 + i32.const 0 + call $~lib/rt/tlsf/__alloc + local.tee $2 + i32.const 0 + i32.store + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + i32.const 123 + i32.store + local.get $2 + block $__inlined_func$~lib/string/String#substring (result i32) + i32.const 1312 + i32.const 0 + i32.const 1040 + call $~lib/string/String#get:length + local.tee $5 + i32.const 0 + local.get $5 + i32.lt_s + select + local.tee $4 + i32.const 5 + local.get $5 + i32.const 5 + local.get $5 + i32.lt_s + select + local.tee $0 + local.get $4 + local.get $0 + i32.gt_s + select + i32.const 1 + i32.shl + local.tee $1 + local.get $4 + local.get $0 + local.get $4 + local.get $0 + i32.lt_s + select + i32.const 1 + i32.shl + local.tee $4 + i32.sub + local.tee $0 + i32.eqz + br_if $__inlined_func$~lib/string/String#substring + drop + i32.const 1040 + i32.const 0 + local.get $1 + local.get $5 + i32.const 1 + i32.shl + i32.eq + local.get $4 + select + br_if $__inlined_func$~lib/string/String#substring + drop + local.get $0 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.tee $1 + local.get $4 + i32.const 1040 + i32.add + local.get $0 + call $~lib/memory/memory.copy + local.get $1 + call $~lib/rt/pure/__retain + end + i32.store offset=4 + local.get $2 + i32.load + i32.const 123 + i32.ne + if + i32.const 0 + i32.const 1248 + i32.const 27 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.load offset=4 + i32.const 1328 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 28 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.load offset=4 + call $~lib/rt/pure/__release + call $~lib/rt/tlsf/maybeInitialize + local.get $2 + i32.const 16 + i32.sub + local.set $0 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $2 + select + if (result i32) + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $0 + i32.load offset=4 + i32.const -268435456 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 581 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/tlsf/freeBlock + i32.const 65 i32.const 4 - i32.const 4 - call $~lib/rt/stub/__alloc + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain local.tee $0 - i32.const 3 + i32.const 0 i32.store local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i64.const 0 + i64.store offset=8 + local.get $0 + i64.const 0 + i64.store offset=16 + local.get $0 + f32.const 0 + f32.store offset=24 + local.get $0 + f64.const 0 + f64.store offset=32 + local.get $0 + i32.const 0 + i32.store8 offset=40 + local.get $0 + i32.const 0 + i32.store8 offset=41 + local.get $0 + i32.const 0 + i32.store16 offset=42 + local.get $0 + i32.const 0 + i32.store16 offset=44 + local.get $0 + i32.const 0 + i32.store offset=48 + local.get $0 + i32.const 0 + i32.store offset=52 + local.get $0 + f64.const 0 + f64.store offset=56 + local.get $0 + i32.const 0 + i32.store8 offset=64 + local.get $0 + i32.const 0 + i32.store + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i64.const 0 + i64.store offset=8 + local.get $0 + i64.const 0 + i64.store offset=16 + local.get $0 + f32.const 0 + f32.store offset=24 + local.get $0 + f64.const 0 + f64.store offset=32 + local.get $0 + i32.const 0 + i32.store8 offset=40 + local.get $0 + i32.const 0 + i32.store8 offset=41 + local.get $0 + i32.const 0 + i32.store16 offset=42 + local.get $0 + i32.const 0 + i32.store16 offset=44 + local.get $0 + i32.const 0 + i32.store offset=48 + local.get $0 + i32.const 0 + i32.store offset=52 + local.get $0 + f64.const 0 + f64.store offset=56 + local.get $0 + i32.const 0 + i32.store8 offset=64 + local.get $0 + call $std/object-literal/testOmittedTypes + i32.const 16 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $2 + i32.const 0 + i32.store + local.get $2 + i32.const 0 + i32.store offset=4 + local.get $2 + f64.const 0 + f64.store offset=8 + local.get $2 + i32.const 0 + i32.store + local.get $2 + i32.const 1360 + i32.store offset=4 + local.get $2 + f64.const 0 + f64.store offset=8 + local.get $2 i32.load - i32.const 3 - i32.ne if i32.const 0 - i32.const 1088 - i32.const 19 - i32.const 5 + i32.const 1248 + i32.const 83 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.load offset=4 + i32.const 1360 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1248 + i32.const 84 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $2 + f64.load offset=8 + f64.const 0 + f64.ne + if + i32.const 0 + i32.const 1248 + i32.const 85 + i32.const 3 call $~lib/builtins/abort unreachable end + i32.const 40 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.tee $1 + i32.const 1392 + i32.store + local.get $1 + i32.const 1424 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $1 + i32.const 0 + i32.store offset=28 + local.get $1 + i32.const 0 + i32.store offset=32 + local.get $1 + i32.const -1 + i32.store offset=36 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $1 + i32.const 0 + i32.store offset=12 + local.get $1 + i32.const 0 + i32.store offset=16 + local.get $1 + i32.const 0 + i32.store offset=20 + local.get $1 + i32.const 0 + i32.store offset=24 + local.get $1 + i32.const 0 + i32.store offset=28 + local.get $1 + i32.const 0 + i32.store offset=32 + local.get $1 + call $std/object-literal/testOmittedFoo + local.get $3 + call $~lib/rt/pure/__release + local.get $0 + 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 + if + return + else + i32.const 1 + global.set $~started + end call $start:std/object-literal ) + (func $~lib/rt/pure/decrement (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.tee $2 + i32.const 268435455 + i32.and + local.set $1 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + if + i32.const 0 + i32.const 1200 + i32.const 122 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + call $~lib/rt/__visit_members + local.get $2 + i32.const -2147483648 + i32.and + if + i32.const 0 + i32.const 1200 + i32.const 126 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $1 + i32.const 0 + i32.le_u + if + i32.const 0 + i32.const 1200 + i32.const 136 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.sub + local.get $2 + i32.const -268435456 + i32.and + i32.or + i32.store offset=4 + end + ) + (func $~lib/rt/pure/__visit (param $0 i32) + local.get $0 + i32.const 1432 + i32.lt_u + if + return + end + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + ) + (func $~lib/rt/__visit_members (param $0 i32) + (local $1 i32) + block $switch$1$default + block $switch$1$case$8 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$2 $switch$1$case$5 $switch$1$case$8 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__visit + end + return + end + local.get $0 + i32.load offset=4 + local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__visit + end + return + end + local.get $0 + i32.load + local.tee $1 + if + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=4 + local.tee $1 + if + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=8 + local.tee $1 + if + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=12 + local.tee $1 + if + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=16 + local.tee $1 + if + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=20 + local.tee $1 + if + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=24 + local.tee $1 + if + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=28 + local.tee $0 + if + local.get $0 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) ) diff --git a/tests/compiler/std/object-literal.ts b/tests/compiler/std/object-literal.ts index 72593ef552..a4c42aeb72 100644 --- a/tests/compiler/std/object-literal.ts +++ b/tests/compiler/std/object-literal.ts @@ -1,30 +1,120 @@ -class Foo { +// Should work with managed classes + +class Managed { bar: i32; baz: string; } -function bar(foo: Foo): void { - assert(foo.bar == 1); - assert(foo.baz == "hello world"); +function testManaged(managed: Managed): void { + assert(managed.bar == 123); + assert(managed.baz == "hello world"); } -bar({ bar: 1, baz: "hello world" }); +testManaged({ + bar: 123, + baz: "hello world" +}); + +// Should work with unmanaged classes -class Foo2 { +@unmanaged +class Unmanaged { bar: i32; - constructor() { - this.bar = 1; - } - test(): void { - assert(this.bar == 3); - } + baz: string; +} + +function testUnmanaged(unmanaged: Unmanaged): void { + assert(unmanaged.bar == 123); + assert(unmanaged.baz == "hello"); + __release(changetype(unmanaged.baz)); + __free(changetype(unmanaged)); +} + +testUnmanaged({ + bar: 123, + baz: "hello world".substring(0, 5) +}); + +// Should work with omitted fields + +class OmittedTypes { + int32: i32; + uint32: u32; + int64: i64; + uint64: u64; + float32: f32; + float64: f64; + int8: i8; + uint8: u8; + int16: i16; + uint16: u16; + intsize: isize; + uintsize: usize; + alias: number; + isTrue: boolean; } -function bar2(foo: Foo2): void { - assert(foo.bar == 2); +function testOmittedTypes(omitted: OmittedTypes): void { + assert(omitted.int32 == 0); + assert(omitted.uint32 == 0); + assert(omitted.int64 == 0); + assert(omitted.uint64 == 0); + assert(omitted.float32 == 0); + assert(omitted.float64 == 0); + assert(omitted.int8 == 0); + assert(omitted.uint8 == 0); + assert(omitted.int16 == 0); + assert(omitted.uint16 == 0); + assert(omitted.intsize == 0); + assert(omitted.uintsize == 0); + assert(omitted.alias == 0); + assert(omitted.isTrue == false); } -bar2({ bar: 2 }); +testOmittedTypes({}); -({ bar: 3 }).test(); +class MixedOmitted { + simpleType: i32; + complexType: string; + anotherSimpleType: f64; +} + +function testMixedOmitted(omitted: MixedOmitted): void { + assert(omitted.simpleType == 0); + assert(omitted.complexType == "test"); + assert(omitted.anotherSimpleType == 0); +} + +testMixedOmitted({ + simpleType: 0, + complexType: "test" +}); + +// Test omitted fields +class OmittedFoo { + bar: string = "bar"; + baz: string | null = "baz"; + quux: string | null; + quuz: string | null; + corge: string | null; + grault: string | null; + garply: string | null; + waldo: string | null; + fred: i32; + qux: i32 = -1; +} + +function testOmittedFoo(foo: OmittedFoo): void { + assert(foo.bar == "bar"); + assert(foo.baz == "baz"); + assert(foo.quux == null); + assert(foo.quuz == null); + assert(foo.corge == null); + assert(foo.grault == null); + assert(foo.garply == null); + assert(foo.waldo == null); + assert(foo.fred == 0); + assert(foo.qux == -1); +} +testOmittedFoo({}); diff --git a/tests/compiler/std/object-literal.untouched.wat b/tests/compiler/std/object-literal.untouched.wat index e216e917fb..5a89ceaaf1 100644 --- a/tests/compiler/std/object-literal.untouched.wat +++ b/tests/compiler/std/object-literal.untouched.wat @@ -1,460 +1,4035 @@ (module (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 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_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) + (import "rtrace" "onincrement" (func $~lib/rt/rtrace/onincrement (param i32))) + (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) + (import "rtrace" "ondecrement" (func $~lib/rt/rtrace/ondecrement (param i32))) (memory $0 1) (data (i32.const 16) "\16\00\00\00\01\00\00\00\01\00\00\00\16\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d\00") - (data (i32.const 64) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") + (data (i32.const 64) "\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 112) "(\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 176) "\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 224) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") + (data (i32.const 288) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") + (data (i32.const 304) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00h\00e\00l\00l\00o\00") + (data (i32.const 336) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t\00") + (data (i32.const 368) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00b\00a\00r\00") + (data (i32.const 400) "\06\00\00\00\01\00\00\00\01\00\00\00\06\00\00\00b\00a\00z\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/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/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/heap/__heap_base i32 (i32.const 124)) + (global $~started (mut i32) (i32.const 0)) + (global $~lib/heap/__heap_base i32 (i32.const 424)) + (export "_start" (func $~start)) (export "memory" (memory $0)) - (start $~start) - (func $~lib/rt/stub/maybeGrowMemory (param $0 i32) - (local $1 i32) + (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - memory.size - local.set $1 + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $1 - i32.const 16 - i32.shl + i32.load local.set $2 - local.get $0 local.get $2 - i32.gt_u + i32.const 1 + i32.and + i32.eqz 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.const 0 + i32.const 80 + i32.const 277 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $3 + local.get $3 + i32.const 16 + i32.ge_u + if (result i32) + local.get $3 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 279 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $4 + local.get $3 + i32.const 4 i32.shr_u - local.set $3 - local.get $1 - local.tee $4 + local.set $5 + else + i32.const 31 local.get $3 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_s - select + i32.clz + i32.sub local.set $4 + local.get $3 local.get $4 - memory.grow + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $5 + local.get $4 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $4 + end + local.get $4 + i32.const 23 + i32.lt_u + if (result i32) + local.get $5 + i32.const 16 + i32.lt_u + else i32.const 0 - i32.lt_s + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 292 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=16 + local.set $6 + local.get $1 + i32.load offset=20 + local.set $7 + local.get $6 + if + local.get $6 + local.get $7 + i32.store offset=20 + end + local.get $7 + if + local.get $7 + local.get $6 + i32.store offset=16 + end + local.get $1 + local.get $0 + local.set $10 + local.get $4 + local.set $9 + local.get $5 + local.set $8 + local.get $10 + local.get $9 + i32.const 4 + i32.shl + local.get $8 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + i32.eq + if + local.get $0 + local.set $11 + local.get $4 + local.set $10 + local.get $5 + local.set $9 + local.get $7 + local.set $8 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $8 + i32.store offset=96 + local.get $7 + i32.eqz if - local.get $3 - memory.grow - i32.const 0 - i32.lt_s + local.get $0 + local.set $9 + local.get $4 + local.set $8 + local.get $9 + local.get $8 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.set $9 + local.get $0 + local.set $8 + local.get $4 + local.set $11 + local.get $9 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $9 + local.set $10 + local.get $8 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + local.get $9 + i32.eqz if - unreachable + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $4 + i32.shl + i32.const -1 + i32.xor + i32.and + i32.store 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) + (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - local.get $0 - i32.const 1073741808 - i32.gt_u + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + (local $13 i32) + local.get $1 + i32.eqz if + i32.const 0 + i32.const 80 + i32.const 205 + i32.const 14 + call $~lib/builtins/abort unreachable end - global.get $~lib/rt/stub/offset - i32.const 16 - i32.add + local.get $1 + i32.load local.set $2 - local.get $0 - i32.const 15 + local.get $2 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 207 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.set $3 + local.get $3 + i32.const 16 i32.add - i32.const 15 + local.get $3 + i32.load + i32.const 3 i32.const -1 i32.xor i32.and - local.tee $3 - i32.const 16 - local.tee $4 - local.get $3 + i32.add + local.set $4 local.get $4 - i32.gt_u - select + i32.load 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 - 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 + i32.and + if + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $3 + local.get $3 + i32.const 1073741808 + i32.lt_u + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 3 + i32.and + local.get $3 + i32.or + local.tee $2 + i32.store + local.get $1 + local.set $6 + local.get $6 + i32.const 16 + i32.add + local.get $6 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.set $4 + local.get $4 + i32.load + local.set $5 + end + end local.get $2 - ) - (func $~lib/rt/stub/__retain (param $0 i32) (result i32) - local.get $0 - ) - (func $~lib/rt/stub/__release (param $0 i32) - nop - ) - (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 - local.get $4 - i32.const 4 - i32.ge_u - if (result i32) - local.get $5 - i32.const 7 - i32.and + i32.const 2 + i32.and + if + local.get $1 + local.set $6 local.get $6 - i32.const 7 + i32.const 4 + i32.sub + i32.load + local.set $6 + local.get $6 + i32.load + local.set $3 + local.get $3 + i32.const 1 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 + if + i32.const 0 + i32.const 80 + i32.const 228 + i32.const 16 + call $~lib/builtins/abort + unreachable end - end - loop $while-continue|1 - local.get $4 - local.tee $7 - i32.const 1 - i32.sub - local.set $4 - local.get $7 + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add local.set $7 local.get $7 + i32.const 1073741808 + i32.lt_u if - local.get $5 - i32.load16_u - local.set $8 + local.get $0 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 + call $~lib/rt/tlsf/removeBlock local.get $6 - i32.const 2 - i32.add - local.set $6 - br $while-continue|1 + local.get $3 + i32.const 3 + i32.and + local.get $7 + i32.or + local.tee $2 + i32.store + local.get $6 + local.set $1 end end - i32.const 0 - local.set $7 - local.get $0 - call $~lib/rt/stub/__release + local.get $4 + local.get $5 + i32.const 2 + i32.or + i32.store 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 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $8 + local.get $8 + i32.const 16 + i32.ge_u + if (result i32) + local.get $8 + i32.const 1073741808 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 243 + i32.const 14 + call $~lib/builtins/abort + unreachable + end local.get $1 + i32.const 16 + i32.add + local.get $8 + i32.add + local.get $4 i32.eq + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 244 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $8 + i32.const 256 + i32.lt_u if + i32.const 0 + local.set $9 + local.get $8 + i32.const 4 + i32.shr_u + local.set $10 + else + i32.const 31 + local.get $8 + i32.clz + i32.sub + local.set $9 + local.get $8 + local.get $9 + i32.const 4 + i32.sub + i32.shr_u 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 + i32.const 4 + i32.shl + i32.xor + local.set $10 + local.get $9 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $9 end - local.get $0 - i32.const 0 - i32.eq + local.get $9 + i32.const 23 + i32.lt_u if (result i32) - i32.const 1 + local.get $10 + i32.const 16 + i32.lt_u else - local.get $1 i32.const 0 - i32.eq end + i32.eqz 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 + i32.const 80 + i32.const 260 + i32.const 14 + call $~lib/builtins/abort + unreachable end local.get $0 - call $~lib/string/String#get:length + local.set $7 + local.get $9 local.set $3 + local.get $10 + local.set $6 + local.get $7 local.get $3 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $11 local.get $1 - call $~lib/string/String#get:length - i32.ne + i32.const 0 + i32.store offset=16 + local.get $1 + local.get $11 + i32.store offset=20 + local.get $11 + if + local.get $11 + local.get $1 + i32.store offset=16 + end + local.get $0 + local.set $12 + local.get $9 + local.set $7 + local.get $10 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $7 + i32.const 4 + i32.shl + local.get $3 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + local.get $0 + local.get $0 + i32.load + i32.const 1 + local.get $9 + i32.shl + i32.or + i32.store + local.get $0 + local.set $13 + local.get $9 + local.set $12 + local.get $0 + local.set $3 + local.get $9 + local.set $6 + local.get $3 + local.get $6 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const 1 + local.get $10 + i32.shl + i32.or + local.set $7 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=4 + ) + (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + local.get $2 + i32.le_u + if (result i32) + local.get $1 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $2 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 386 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + local.set $4 + i32.const 0 + local.set $5 + local.get $4 + if + local.get $1 + local.get $4 + i32.const 16 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 396 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 16 + i32.sub + local.get $4 + i32.eq + if + local.get $1 + i32.const 16 + i32.sub + local.set $1 + local.get $4 + i32.load + local.set $5 + else + nop + end + else + local.get $1 + local.get $0 + i32.const 1572 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 408 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + end + local.get $2 + local.get $1 + i32.sub + local.set $6 + local.get $6 + i32.const 48 + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 16 + i32.const 1 + i32.shl + i32.sub + local.set $7 + local.get $1 + local.set $8 + local.get $8 + local.get $7 + i32.const 1 + i32.or + local.get $5 + i32.const 2 + i32.and + i32.or + i32.store + local.get $8 + i32.const 0 + i32.store offset=16 + local.get $8 + i32.const 0 + i32.store offset=20 + local.get $1 + local.get $6 + i32.add + i32.const 16 + i32.sub + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + i32.store + local.get $0 + local.set $9 + local.get $4 + local.set $3 + local.get $9 + local.get $3 + i32.store offset=1568 + local.get $0 + local.get $8 + call $~lib/rt/tlsf/insertBlock + i32.const 1 + ) + (func $~lib/rt/tlsf/maybeInitialize (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + global.get $~lib/rt/tlsf/ROOT + local.set $0 + local.get $0 + i32.eqz + if + global.get $~lib/heap/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $1 + memory.size + local.set $2 + local.get $1 + i32.const 1572 + i32.add + 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 $3 + local.get $2 + i32.gt_s + if (result i32) + local.get $3 + local.get $2 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $1 + local.set $0 + local.get $0 + i32.const 0 + i32.store + local.get $0 + local.set $5 + i32.const 0 + local.set $4 + local.get $5 + local.get $4 + i32.store offset=1568 + i32.const 0 + local.set $5 + loop $for-loop|0 + local.get $5 + i32.const 23 + i32.lt_u + local.set $4 + local.get $4 + if + local.get $0 + local.set $8 + local.get $5 + local.set $7 + i32.const 0 + local.set $6 + local.get $8 + local.get $7 + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=4 + i32.const 0 + local.set $8 + loop $for-loop|1 + local.get $8 + i32.const 16 + i32.lt_u + local.set $7 + local.get $7 + if + local.get $0 + local.set $11 + local.get $5 + local.set $10 + local.get $8 + local.set $9 + i32.const 0 + local.set $6 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $9 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $6 + i32.store offset=96 + local.get $8 + i32.const 1 + i32.add + local.set $8 + br $for-loop|1 + end + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $for-loop|0 + end + end + local.get $1 + i32.const 1572 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $5 + local.get $0 + local.get $5 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $0 + global.set $~lib/rt/tlsf/ROOT + end + local.get $0 + ) + (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.const 1073741808 + i32.ge_u + if + i32.const 128 + i32.const 80 + i32.const 461 + i32.const 30 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.tee $1 + i32.const 16 + local.tee $2 + local.get $1 + local.get $2 + i32.gt_u + select + ) + (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + local.get $1 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $2 + local.get $1 + i32.const 4 + i32.shr_u + local.set $3 + else + local.get $1 + i32.const 536870904 + i32.lt_u + if (result i32) + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.add + i32.const 1 + i32.sub + else + local.get $1 + end + local.set $4 + i32.const 31 + local.get $4 + i32.clz + i32.sub + local.set $2 + local.get $4 + local.get $2 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $3 + local.get $2 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $2 + end + local.get $2 + i32.const 23 + i32.lt_u + if (result i32) + local.get $3 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 338 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $5 + local.get $2 + local.set $4 + local.get $5 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + i32.const 0 + i32.const -1 + i32.xor + local.get $3 + i32.shl + i32.and + local.set $6 + i32.const 0 + local.set $7 + local.get $6 + i32.eqz + if + local.get $0 + i32.load + i32.const 0 + i32.const -1 + i32.xor + local.get $2 + i32.const 1 + i32.add + i32.shl + i32.and + local.set $5 + local.get $5 + i32.eqz + if + i32.const 0 + local.set $7 + else + local.get $5 + i32.ctz + local.set $2 + local.get $0 + local.set $8 + local.get $2 + local.set $4 + local.get $8 + local.get $4 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.set $6 + local.get $6 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 351 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $7 + end + else + local.get $0 + local.set $9 + local.get $2 + local.set $8 + local.get $6 + i32.ctz + local.set $4 + local.get $9 + local.get $8 + i32.const 4 + i32.shl + local.get $4 + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $7 + end + local.get $7 + ) + (func $~lib/rt/tlsf/growMemory (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + local.get $1 + i32.const 536870904 + i32.lt_u + if + local.get $1 + i32.const 1 + i32.const 27 + local.get $1 + i32.clz + i32.sub + i32.shl + i32.const 1 + i32.sub + i32.add + local.set $1 + end + memory.size + local.set $2 + local.get $1 + i32.const 16 + local.get $2 + i32.const 16 + i32.shl + i32.const 16 + i32.sub + local.get $0 + local.set $3 + local.get $3 + i32.load offset=1568 + i32.ne + i32.shl + i32.add + local.set $1 + local.get $1 + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + local.set $4 + local.get $2 + local.tee $3 + local.get $4 + local.tee $5 + local.get $3 + local.get $5 + i32.gt_s + select + local.set $6 + local.get $6 + memory.grow + i32.const 0 + i32.lt_s + if + local.get $4 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + memory.size + local.set $7 + local.get $0 + local.get $2 + i32.const 16 + i32.shl + local.get $7 + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + ) + (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $1 + i32.load + local.set $3 + local.get $2 + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 365 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.sub + local.set $4 + local.get $4 + i32.const 32 + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 16 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $5 + call $~lib/rt/tlsf/insertBlock + else + local.get $1 + local.get $3 + i32.const 1 + i32.const -1 + i32.xor + i32.and + i32.store + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.get $1 + local.set $5 + local.get $5 + i32.const 16 + i32.add + local.get $5 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + i32.load + i32.const 2 + i32.const -1 + i32.xor + i32.and + i32.store + end + ) + (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + global.get $~lib/rt/tlsf/collectLock + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 501 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $3 + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + local.get $4 + i32.eqz + if + global.get $~lib/gc/gc.auto + if + i32.const 1 + global.set $~lib/rt/tlsf/collectLock + call $~lib/rt/pure/__collect + i32.const 0 + global.set $~lib/rt/tlsf/collectLock + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + local.get $4 + i32.eqz + if + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 513 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + end + else + local.get $0 + local.get $3 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $3 + call $~lib/rt/tlsf/searchBlock + local.set $4 + local.get $4 + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 518 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + end + end + local.get $4 + i32.load + i32.const -4 + i32.and + local.get $3 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 521 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 0 + i32.store offset=4 + local.get $4 + local.get $2 + i32.store offset=8 + local.get $4 + local.get $1 + i32.store offset=12 + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $4 + local.get $3 + call $~lib/rt/tlsf/prepareBlock + local.get $4 + call $~lib/rt/rtrace/onalloc + local.get $4 + ) + (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) + call $~lib/rt/tlsf/maybeInitialize + local.get $0 + local.get $1 + call $~lib/rt/tlsf/allocateBlock + i32.const 16 + i32.add + ) + (func $~lib/rt/pure/increment (param $0 i32) + (local $1 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const -268435456 + i32.and + local.get $1 + i32.const 1 + i32.add + i32.const -268435456 + i32.and + i32.eq + i32.eqz + if + i32.const 0 + i32.const 192 + i32.const 109 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.store offset=4 + local.get $0 + call $~lib/rt/rtrace/onincrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 192 + i32.const 112 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/rt/pure/__retain (param $0 i32) (result i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/increment + end + local.get $0 + ) + (func $std/object-literal/Managed#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 8 + i32.const 3 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__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/rt/pure/__release (param $0 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.gt_u + if + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + end + ) + (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/pure/__retain + local.set $0 + local.get $2 + call $~lib/rt/pure/__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 + 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/pure/__release + local.get $2 + call $~lib/rt/pure/__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/pure/__release + local.get $2 + call $~lib/rt/pure/__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/pure/__retain + local.set $0 + local.get $1 + call $~lib/rt/pure/__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/pure/__release + local.get $1 + call $~lib/rt/pure/__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/pure/__release + local.get $1 + call $~lib/rt/pure/__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/pure/__release + local.get $1 + call $~lib/rt/pure/__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/pure/__release + local.get $1 + call $~lib/rt/pure/__release + local.get $2 + ) + (func $std/object-literal/testManaged (param $0 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + i32.load + i32.const 123 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 9 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 32 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 10 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + ) + (func $~lib/util/memory/memcpy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + loop $while-continue|0 + local.get $2 + if (result i32) + local.get $1 + i32.const 3 + i32.and + else + i32.const 0 + end + local.set $5 + local.get $5 + if + local.get $0 + local.tee $6 + i32.const 1 + i32.add + local.set $0 + local.get $6 + local.get $1 + local.tee $6 + i32.const 1 + i32.add + local.set $1 + local.get $6 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + br $while-continue|0 + end + end + local.get $0 + i32.const 3 + i32.and + i32.const 0 + i32.eq + if + loop $while-continue|1 + local.get $2 + i32.const 16 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.get $1 + i32.const 8 + i32.add + i32.load + i32.store + local.get $0 + i32.const 12 + i32.add + local.get $1 + i32.const 12 + i32.add + i32.load + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|1 + end + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.get $1 + i32.const 4 + i32.add + i32.load + i32.store + local.get $0 + i32.const 8 + i32.add + local.set $0 + local.get $1 + i32.const 8 + i32.add + local.set $1 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.get $1 + i32.load + i32.store + local.get $0 + i32.const 4 + i32.add + local.set $0 + local.get $1 + i32.const 4 + i32.add + local.set $1 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.get $1 + i32.load16_u + i32.store16 + local.get $0 + i32.const 2 + i32.add + local.set $0 + local.get $1 + i32.const 2 + i32.add + local.set $1 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + return + end + local.get $2 + i32.const 32 + i32.ge_u + if + block $break|2 + block $case2|2 + block $case1|2 + block $case0|2 + local.get $0 + i32.const 3 + i32.and + local.set $5 + local.get $5 + i32.const 1 + i32.eq + br_if $case0|2 + local.get $5 + i32.const 2 + i32.eq + br_if $case1|2 + local.get $5 + i32.const 3 + i32.eq + br_if $case2|2 + br $break|2 + end + local.get $1 + i32.load + local.set $3 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $2 + i32.const 3 + i32.sub + local.set $2 + loop $while-continue|3 + local.get $2 + i32.const 17 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $1 + i32.const 1 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 5 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 9 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 24 + i32.shr_u + local.get $4 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 13 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 24 + i32.shr_u + local.get $3 + i32.const 8 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|3 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $3 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $2 + i32.const 2 + i32.sub + local.set $2 + loop $while-continue|4 + local.get $2 + i32.const 18 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $1 + i32.const 2 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 6 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 10 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 16 + i32.shr_u + local.get $4 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 14 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 16 + i32.shr_u + local.get $3 + i32.const 16 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|4 + end + end + br $break|2 + end + local.get $1 + i32.load + local.set $3 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $2 + i32.const 1 + i32.sub + local.set $2 + loop $while-continue|5 + local.get $2 + i32.const 19 + i32.ge_u + local.set $5 + local.get $5 + if + local.get $1 + i32.const 3 + i32.add + i32.load + local.set $4 + local.get $0 + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 7 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 4 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 11 + i32.add + i32.load + local.set $4 + local.get $0 + i32.const 8 + i32.add + local.get $3 + i32.const 8 + i32.shr_u + local.get $4 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 15 + i32.add + i32.load + local.set $3 + local.get $0 + i32.const 12 + i32.add + local.get $4 + i32.const 8 + i32.shr_u + local.get $3 + i32.const 24 + i32.shl + i32.or + i32.store + local.get $1 + i32.const 16 + i32.add + local.set $1 + local.get $0 + i32.const 16 + i32.add + local.set $0 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + br $while-continue|5 + end + end + br $break|2 + end + end + local.get $2 + i32.const 16 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 8 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 4 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + local.get $2 + i32.const 1 + i32.and + if + local.get $0 + local.tee $5 + i32.const 1 + i32.add + local.set $0 + local.get $5 + local.get $1 + local.tee $5 + i32.const 1 + i32.add + local.set $1 + local.get $5 + i32.load8_u + i32.store8 + end + ) + (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + block $~lib/util/memory/memmove|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + local.get $5 + local.get $4 + i32.eq + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $4 + local.get $3 + i32.add + local.get $5 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $5 + local.get $3 + i32.add + local.get $4 + i32.le_u + end + if + local.get $5 + local.get $4 + local.get $3 + call $~lib/util/memory/memcpy + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $4 + i32.lt_u + if + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|0 + local.get $5 + i32.const 7 + i32.and + local.set $6 + local.get $6 + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $3 + i32.const 1 + i32.sub + local.set $3 + local.get $5 + local.tee $7 + i32.const 1 + i32.add + local.set $5 + local.get $7 + local.get $4 + local.tee $7 + i32.const 1 + i32.add + local.set $4 + local.get $7 + i32.load8_u + i32.store8 + br $while-continue|0 + end + end + loop $while-continue|1 + local.get $3 + i32.const 8 + i32.ge_u + local.set $6 + local.get $6 + if + local.get $5 + local.get $4 + i64.load + i64.store + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + i32.const 8 + i32.add + local.set $5 + local.get $4 + i32.const 8 + i32.add + local.set $4 + br $while-continue|1 + end + end + end + loop $while-continue|2 + local.get $3 + local.set $6 + local.get $6 + if + local.get $5 + local.tee $7 + i32.const 1 + i32.add + local.set $5 + local.get $7 + local.get $4 + local.tee $7 + i32.const 1 + i32.add + local.set $4 + local.get $7 + i32.load8_u + i32.store8 + local.get $3 + i32.const 1 + i32.sub + local.set $3 + br $while-continue|2 + end + end + else + local.get $4 + i32.const 7 + i32.and + local.get $5 + i32.const 7 + i32.and + i32.eq + if + loop $while-continue|3 + local.get $5 + local.get $3 + i32.add + i32.const 7 + i32.and + local.set $6 + local.get $6 + if + local.get $3 + i32.eqz + if + br $~lib/util/memory/memmove|inlined.0 + end + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $while-continue|3 + end + end + loop $while-continue|4 + local.get $3 + i32.const 8 + i32.ge_u + local.set $6 + local.get $6 + if + local.get $3 + i32.const 8 + i32.sub + local.set $3 + local.get $5 + local.get $3 + i32.add + local.get $4 + local.get $3 + i32.add + i64.load + i64.store + br $while-continue|4 + end + end + end + loop $while-continue|5 + local.get $3 + local.set $6 + local.get $6 + if + local.get $5 + local.get $3 + i32.const 1 + i32.sub + local.tee $3 + i32.add + local.get $4 + local.get $3 + i32.add + i32.load8_u + i32.store8 + br $while-continue|5 + end + end + end + end + ) + (func $~lib/string/String#substring (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + call $~lib/string/String#get:length + local.set $3 + local.get $1 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $6 + local.get $2 + local.tee $4 + i32.const 0 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + local.tee $4 + local.get $3 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + local.set $7 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.lt_s + select + i32.const 1 + i32.shl + local.set $8 + local.get $6 + local.tee $4 + local.get $7 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_s + select + i32.const 1 + i32.shl + local.set $9 + local.get $9 + local.get $8 + i32.sub + local.set $10 + local.get $10 + i32.eqz + if + i32.const 304 + call $~lib/rt/pure/__retain + return + end + local.get $8 + i32.eqz + if (result i32) + local.get $9 + local.get $3 + i32.const 1 + i32.shl + i32.eq + else + i32.const 0 + end + if + local.get $0 + call $~lib/rt/pure/__retain + return + end + local.get $10 + i32.const 1 + call $~lib/rt/tlsf/__alloc + local.set $11 + local.get $11 + local.get $0 + local.get $8 + i32.add + local.get $10 + call $~lib/memory/memory.copy + local.get $11 + call $~lib/rt/pure/__retain + ) + (func $std/object-literal/Unmanaged#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 8 + i32.const 0 + call $~lib/rt/tlsf/__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/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 16 + i32.sub + local.set $1 + local.get $0 + i32.const 0 + i32.ne + if (result i32) + local.get $0 + i32.const 15 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $1 + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + if (result i32) + local.get $1 + i32.load offset=4 + i32.const -268435456 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 80 + i32.const 581 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $1 + i32.load + local.set $2 + local.get $1 + local.get $2 + i32.const 1 + i32.or + i32.store + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + local.get $1 + call $~lib/rt/rtrace/onfree + ) + (func $~lib/rt/tlsf/__free (param $0 i32) + call $~lib/rt/tlsf/maybeInitialize + local.get $0 + call $~lib/rt/tlsf/checkUsedBlock + call $~lib/rt/tlsf/freeBlock + ) + (func $std/object-literal/testUnmanaged (param $0 i32) + local.get $0 + i32.load + i32.const 123 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 27 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 320 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 28 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + call $~lib/rt/pure/__release + local.get $0 + call $~lib/rt/tlsf/__free + ) + (func $std/object-literal/OmittedTypes#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 65 + i32.const 4 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__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 + i64.const 0 + i64.store offset=8 + local.get $0 + i64.const 0 + i64.store offset=16 + local.get $0 + f32.const 0 + f32.store offset=24 + local.get $0 + f64.const 0 + f64.store offset=32 + local.get $0 + i32.const 0 + i32.store8 offset=40 + local.get $0 + i32.const 0 + i32.store8 offset=41 + local.get $0 + i32.const 0 + i32.store16 offset=42 + local.get $0 + i32.const 0 + i32.store16 offset=44 + local.get $0 + i32.const 0 + i32.store offset=48 + local.get $0 + i32.const 0 + i32.store offset=52 + local.get $0 + f64.const 0 + f64.store offset=56 + local.get $0 + i32.const 0 + i32.store8 offset=64 + local.get $0 + ) + (func $std/object-literal/testOmittedTypes (param $0 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 58 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 59 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i64.load offset=8 + i64.const 0 + i64.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 60 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i64.load offset=16 + i64.const 0 + i64.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 61 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + f32.load offset=24 + f32.const 0 + f32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 62 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + f64.load offset=32 + f64.const 0 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 63 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load8_s offset=40 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 64 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load8_u offset=41 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 65 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load16_s offset=42 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 66 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load16_u offset=44 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 67 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=48 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 68 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=52 + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 69 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + f64.load offset=56 + f64.const 0 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 70 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load8_u offset=64 + i32.const 0 + i32.ne + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 71 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + ) + (func $std/object-literal/MixedOmitted#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 16 + i32.const 5 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__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 + f64.const 0 + f64.store offset=8 + local.get $0 + ) + (func $std/object-literal/testMixedOmitted (param $0 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + i32.load + i32.const 0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 83 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 352 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 84 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + f64.load offset=8 + f64.const 0 + f64.eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 85 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/pure/__release + ) + (func $std/object-literal/OmittedFoo#constructor (param $0 i32) (result i32) + local.get $0 + i32.eqz + if + i32.const 40 + i32.const 6 + call $~lib/rt/tlsf/__alloc + call $~lib/rt/pure/__retain + local.set $0 + end + local.get $0 + i32.const 384 + i32.store + local.get $0 + i32.const 416 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 0 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + local.get $0 + i32.const 0 + i32.store offset=20 + local.get $0 + i32.const 0 + i32.store offset=24 + local.get $0 + i32.const 0 + i32.store offset=28 + local.get $0 + i32.const 0 + i32.store offset=32 + local.get $0 + i32.const -1 + i32.store offset=36 + local.get $0 + ) + (func $std/object-literal/testOmittedFoo (param $0 i32) + local.get $0 + call $~lib/rt/pure/__retain + local.set $0 + local.get $0 + i32.load + i32.const 384 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 108 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + i32.const 416 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 109 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=8 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 110 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=12 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz 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 + i32.const 240 + i32.const 111 + i32.const 3 + call $~lib/builtins/abort + unreachable end local.get $0 + i32.load offset=16 i32.const 0 - local.get $1 - i32.const 0 - local.get $3 - call $~lib/util/string/compareImpl + call $~lib/string/String.__eq 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 $std/object-literal/bar (param $0 i32) - local.get $0 - call $~lib/rt/stub/__retain - local.set $0 + if + i32.const 0 + i32.const 240 + i32.const 112 + i32.const 3 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.load - i32.const 1 - i32.eq + i32.load offset=20 + i32.const 0 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 80 - i32.const 7 + i32.const 240 + i32.const 113 i32.const 3 call $~lib/builtins/abort unreachable end local.get $0 - i32.load offset=4 - i32.const 32 + i32.load offset=24 + i32.const 0 call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 80 - i32.const 8 + i32.const 240 + i32.const 114 i32.const 3 call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/rt/stub/__release - ) - (func $std/object-literal/bar2 (param $0 i32) - local.get $0 - call $~lib/rt/stub/__retain - local.set $0 + i32.load offset=28 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 240 + i32.const 115 + i32.const 3 + call $~lib/builtins/abort + unreachable + end local.get $0 - i32.load - i32.const 2 + i32.load offset=32 + i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 80 - i32.const 24 + i32.const 240 + i32.const 116 i32.const 3 call $~lib/builtins/abort unreachable end local.get $0 - call $~lib/rt/stub/__release - ) - (func $std/object-literal/Foo2#test (param $0 i32) - local.get $0 - i32.load - i32.const 3 + i32.load offset=36 + i32.const -1 i32.eq i32.eqz if i32.const 0 - i32.const 80 - i32.const 19 - i32.const 5 + i32.const 240 + i32.const 117 + i32.const 3 call $~lib/builtins/abort unreachable end + local.get $0 + call $~lib/rt/pure/__release ) (func $start:std/object-literal (local $0 i32) (local $1 i32) (local $2 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 8 - i32.const 3 - call $~lib/rt/stub/__alloc - call $~lib/rt/stub/__retain + (local $3 i32) + i32.const 0 + call $std/object-literal/Managed#constructor local.set $0 local.get $0 - i32.const 1 + i32.const 123 i32.store local.get $0 i32.const 32 i32.store offset=4 local.get $0 - call $std/object-literal/bar - i32.const 4 - i32.const 4 - call $~lib/rt/stub/__alloc - call $~lib/rt/stub/__retain + call $std/object-literal/testManaged + i32.const 0 + call $std/object-literal/Unmanaged#constructor local.set $1 local.get $1 - i32.const 2 + i32.const 123 i32.store local.get $1 - call $std/object-literal/bar2 - i32.const 4 - i32.const 4 - call $~lib/rt/stub/__alloc - call $~lib/rt/stub/__retain + i32.const 32 + i32.const 0 + i32.const 5 + call $~lib/string/String#substring + i32.store offset=4 + local.get $1 + call $std/object-literal/testUnmanaged + i32.const 0 + call $std/object-literal/OmittedTypes#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 + i64.const 0 + i64.store offset=8 + local.get $1 + i64.const 0 + i64.store offset=16 + local.get $1 + f32.const 0 + f32.store offset=24 + local.get $1 + f64.const 0 + f64.store offset=32 + local.get $1 + i32.const 0 + i32.store8 offset=40 + local.get $1 + i32.const 0 + i32.store8 offset=41 + local.get $1 + i32.const 0 + i32.store16 offset=42 + local.get $1 + i32.const 0 + i32.store16 offset=44 + local.get $1 + i32.const 0 + i32.store offset=48 + local.get $1 + i32.const 0 + i32.store offset=52 + local.get $1 + f64.const 0 + f64.store offset=56 + local.get $1 + i32.const 0 + i32.store8 offset=64 + local.get $1 + call $std/object-literal/testOmittedTypes + i32.const 0 + call $std/object-literal/MixedOmitted#constructor local.set $2 local.get $2 - i32.const 3 + i32.const 0 i32.store local.get $2 - call $std/object-literal/Foo2#test + i32.const 352 + i32.store offset=4 + local.get $2 + f64.const 0 + f64.store offset=8 + local.get $2 + call $std/object-literal/testMixedOmitted + i32.const 0 + call $std/object-literal/OmittedFoo#constructor + local.set $3 + local.get $3 + i32.const 0 + i32.store offset=8 + local.get $3 + i32.const 0 + i32.store offset=12 + local.get $3 + i32.const 0 + i32.store offset=16 + local.get $3 + i32.const 0 + i32.store offset=20 + local.get $3 + i32.const 0 + i32.store offset=24 + local.get $3 + i32.const 0 + i32.store offset=28 + local.get $3 + i32.const 0 + i32.store offset=32 + local.get $3 + call $std/object-literal/testOmittedFoo local.get $0 - call $~lib/rt/stub/__release + call $~lib/rt/pure/__release local.get $1 - call $~lib/rt/stub/__release + call $~lib/rt/pure/__release local.get $2 - call $~lib/rt/stub/__release + call $~lib/rt/pure/__release + local.get $3 + call $~lib/rt/pure/__release ) (func $~start + global.get $~started + if + return + else + i32.const 1 + global.set $~started + end call $start:std/object-literal ) + (func $~lib/rt/pure/__collect + return + ) + (func $~lib/rt/pure/decrement (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + i32.load offset=4 + local.set $1 + local.get $1 + i32.const 268435455 + i32.and + local.set $2 + local.get $0 + call $~lib/rt/rtrace/ondecrement + local.get $0 + i32.load + i32.const 1 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 192 + i32.const 122 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 1 + i32.eq + if + local.get $0 + i32.const 16 + i32.add + i32.const 1 + call $~lib/rt/__visit_members + local.get $1 + i32.const -2147483648 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 192 + i32.const 126 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/freeBlock + else + local.get $2 + i32.const 0 + i32.gt_u + i32.eqz + if + i32.const 0 + i32.const 192 + i32.const 136 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 268435455 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.const 1 + i32.sub + i32.or + i32.store offset=4 + end + ) + (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) + local.get $0 + global.get $~lib/heap/__heap_base + i32.lt_u + if + return + end + local.get $1 + i32.const 1 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 192 + i32.const 69 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 16 + i32.sub + call $~lib/rt/pure/decrement + ) + (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + (local $2 i32) + block $switch$1$default + block $switch$1$case$8 + block $switch$1$case$5 + block $switch$1$case$4 + block $switch$1$case$2 + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$5 $switch$1$case$2 $switch$1$case$5 $switch$1$case$8 $switch$1$default + end + return + end + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + local.get $0 + i32.load offset=4 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=4 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=8 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=12 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=16 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=20 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=24 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + local.get $0 + i32.load offset=28 + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/pure/__visit + end + return + end + unreachable + ) ) From dca29f01e7931fab62cf44012f7ae4e063bb1b6e Mon Sep 17 00:00:00 2001 From: dcode Date: Tue, 21 Apr 2020 06:03:55 +0200 Subject: [PATCH 2/4] fix --- package.json | 2 +- tests/compiler.js | 2 +- tests/compiler/unsafe.json | 1 - tests/compiler/unsafe.ts | 4 ---- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c4d41e8239..d882cf100e 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "check": "npm run check:config && npm run check:compiler && tsc --noEmit --target ESNEXT --module commonjs --experimentalDecorators tests/require/index", "check:config": "tsc --noEmit -p src --diagnostics --listFiles", "check:compiler": "tslint -c tslint.json --project src --formatters-dir lib/lint/formatters --format as", - "test": "npm run test:parser && npm run test:compiler && npm run test:packages", + "test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:packages", "test:parser": "node tests/parser", "test:compiler": "node tests/compiler", "test:packages": "cd tests/packages && npm run test", diff --git a/tests/compiler.js b/tests/compiler.js index cc78226c2a..d8ba9b4ae9 100644 --- a/tests/compiler.js +++ b/tests/compiler.js @@ -184,7 +184,7 @@ function runTest(basename) { } else { console.log("- " + colorsUtil.green("stderr MATCH") + "\n"); } - return; + return 1; } if (err) diff --git a/tests/compiler/unsafe.json b/tests/compiler/unsafe.json index 044af5cc1e..810a0486df 100644 --- a/tests/compiler/unsafe.json +++ b/tests/compiler/unsafe.json @@ -9,7 +9,6 @@ "AS101: Operation is unsafe.", "f2();", "AS101: Operation is unsafe.", "= new Foo();", "AS101: Operation is unsafe.", "super();", - "AS101: Operation is unsafe.", ": Foo = {};", "AS101: Operation is unsafe.", "= instantiate()", "AS101: Operation is unsafe.", "Foo.bar();", "AS101: Operation is unsafe.", "foo.bar();", diff --git a/tests/compiler/unsafe.ts b/tests/compiler/unsafe.ts index 80f0735908..29d1bc7353 100644 --- a/tests/compiler/unsafe.ts +++ b/tests/compiler/unsafe.ts @@ -38,10 +38,6 @@ class Bar extends Foo { var bar = new Bar(); -// Constructor via object literal - -var foo2: Foo = {}; - // Constructor via instantiate var foo3 = instantiate(); From 08e4216149137f8acf6adb4e953f10775ffbe238 Mon Sep 17 00:00:00 2001 From: dcode Date: Tue, 21 Apr 2020 06:08:30 +0200 Subject: [PATCH 3/4] no parallel, 1 worker is 1 too few --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d882cf100e..c4d41e8239 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "check": "npm run check:config && npm run check:compiler && tsc --noEmit --target ESNEXT --module commonjs --experimentalDecorators tests/require/index", "check:config": "tsc --noEmit -p src --diagnostics --listFiles", "check:compiler": "tslint -c tslint.json --project src --formatters-dir lib/lint/formatters --format as", - "test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:packages", + "test": "npm run test:parser && npm run test:compiler && npm run test:packages", "test:parser": "node tests/parser", "test:compiler": "node tests/compiler", "test:packages": "cd tests/packages && npm run test", From eda43a4c7fd8f64226f4ba70bcfc754e2631a0a9 Mon Sep 17 00:00:00 2001 From: dcode Date: Sun, 26 Apr 2020 08:04:43 +0200 Subject: [PATCH 4/4] clean up --- src/compiler.ts | 139 +- tests/compiler/{std => }/object-literal.json | 0 .../{std => }/object-literal.optimized.wat | 18 +- tests/compiler/{std => }/object-literal.ts | 0 .../{std => }/object-literal.untouched.wat | 46 +- .../std/object-literal-omitted.optimized.wat | 1584 ------------ .../std/object-literal-omitted.untouched.wat | 2227 ----------------- .../object-literal-unmanaged.optimized.wat | 969 ------- .../object-literal-unmanaged.untouched.wat | 1566 ------------ 9 files changed, 105 insertions(+), 6444 deletions(-) rename tests/compiler/{std => }/object-literal.json (100%) rename tests/compiler/{std => }/object-literal.optimized.wat (98%) rename tests/compiler/{std => }/object-literal.ts (100%) rename tests/compiler/{std => }/object-literal.untouched.wat (97%) delete mode 100644 tests/compiler/std/object-literal-omitted.optimized.wat delete mode 100644 tests/compiler/std/object-literal-omitted.untouched.wat delete mode 100644 tests/compiler/std/object-literal-unmanaged.optimized.wat delete mode 100644 tests/compiler/std/object-literal-unmanaged.untouched.wat diff --git a/src/compiler.ts b/src/compiler.ts index 05249687e8..ebffd92242 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -86,7 +86,8 @@ import { PropertyPrototype, IndexSignature, File, - mangleInternalName + mangleInternalName, + DeclaredElement } from "./program"; import { @@ -8621,10 +8622,11 @@ export class Compiler extends DiagnosticEmitter { } // Check that the class is compatible with object literals - if (classReference.prototype.constructorPrototype) { - this.error( + var ctorPrototype = classReference.prototype.constructorPrototype; + if (ctorPrototype) { + this.errorRelated( DiagnosticCode.Class_0_cannot_declare_a_constructor_when_instantiated_from_an_object_literal, - expression.range, classType.toString() + expression.range, ctorPrototype.identifierNode.range, classType.toString() ); return module.unreachable(); } @@ -8645,6 +8647,7 @@ export class Compiler extends DiagnosticEmitter { var tempLocal = isManaged ? flow.getAutoreleaseLocal(classType) : flow.getTempLocal(classType); + var nativeClassType = classType.toNativeType(); assert(numNames == values.length); // Assume all class fields will be omitted, and add them to our omitted list @@ -8660,10 +8663,10 @@ export class Compiler extends DiagnosticEmitter { } // Iterate through the members defined in our expression - for (let i = 0, k = numNames; i < k; ++i) { + for (let i = 0; i < numNames; ++i) { let memberName = names[i].text; - let member = members ? members.get(memberName) : null; - if (!member || member.kind != ElementKind.FIELD) { + let member: DeclaredElement; + if (!members || !members.has(memberName) || (member = assert(members.get(memberName))).kind != ElementKind.FIELD) { this.error( DiagnosticCode.Property_0_does_not_exist_on_type_1, names[i].range, memberName, classType.toString() @@ -8694,13 +8697,15 @@ export class Compiler extends DiagnosticEmitter { if (fieldType.isManaged && !this.skippedAutoreleases.has(expr)) { expr = this.makeRetain(expr); } - exprs.push(this.module.store( // TODO: handle setters as well - fieldType.byteSize, - this.module.local_get(tempLocal.index, this.options.nativeSizeType), - expr, - fieldType.toNativeType(), - fieldInstance.memoryOffset - )); + exprs.push( + module.store( // TODO: handle setters as well + fieldType.byteSize, + module.local_get(tempLocal.index, nativeClassType), + expr, + fieldType.toNativeType(), + fieldInstance.memoryOffset + ) + ); // This member is no longer omitted, so delete from our omitted fields omittedFields.delete(fieldInstance); @@ -8708,77 +8713,79 @@ export class Compiler extends DiagnosticEmitter { this.currentType = classType.nonNullableType; if (hasErrors) return module.unreachable(); - // Iterate through the remaining omittedClassFieldMembers. - if (members) { - - for (let _values = Set_values(omittedFields), j = 0, l = _values.length; j < l; ++j) { - let fieldInstance = _values[j]; - let fieldType = fieldInstance.type; + // Check remaining omitted fields + for (let _values = Set_values(omittedFields), j = 0, l = _values.length; j < l; ++j) { + let fieldInstance = _values[j]; + let fieldType = fieldInstance.type; - if (fieldInstance.initializerNode) { - continue; // set by default ctor - } + if (fieldInstance.initializerNode) { + continue; // set by default 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, - expression.range, fieldInstance.name, "", classType.toString() - ); - hasErrors = true; - continue; - } + 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, + expression.range, fieldInstance.name, "", classType.toString() + ); + hasErrors = true; + continue; } + } - switch (fieldType.kind) { - // Number Types (and Number alias types) - case TypeKind.I8: - case TypeKind.I16: - case TypeKind.I32: - case TypeKind.I64: - case TypeKind.ISIZE: - case TypeKind.U8: - case TypeKind.U16: - case TypeKind.U32: - case TypeKind.U64: - case TypeKind.USIZE: - case TypeKind.BOOL: - case TypeKind.F32: - case TypeKind.F64: { - exprs.push(this.module.store( // TODO: handle setters as well + switch (fieldType.kind) { + // Number Types (and Number alias types) + case TypeKind.I8: + case TypeKind.I16: + case TypeKind.I32: + case TypeKind.I64: + case TypeKind.ISIZE: + case TypeKind.U8: + case TypeKind.U16: + case TypeKind.U32: + case TypeKind.U64: + case TypeKind.USIZE: + case TypeKind.BOOL: + case TypeKind.F32: + case TypeKind.F64: { + exprs.push( + module.store( // TODO: handle setters as well fieldType.byteSize, - this.module.local_get(tempLocal.index, this.options.nativeSizeType), + module.local_get(tempLocal.index, nativeClassType), this.makeZero(fieldType), fieldType.toNativeType(), fieldInstance.memoryOffset - )); - continue; - } + ) + ); + continue; } - - // Otherwise, error - this.error( - DiagnosticCode.Property_0_is_missing_in_type_1_but_required_in_type_2, - expression.range, fieldInstance.name, "", classType.toString() - ); - hasErrors = true; } + + // Otherwise error + this.error( + DiagnosticCode.Property_0_is_missing_in_type_1_but_required_in_type_2, + expression.range, fieldInstance.name, "", classType.toString() + ); + hasErrors = true; } if (hasErrors) return module.unreachable(); // 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) - )); + exprs.unshift( + module.local_set(tempLocal.index, + this.compileInstantiate(classReference, [], Constraints.WILL_RETAIN, expression) + ) + ); // once all field values have been set, return 'this' - exprs.push(module.local_get(tempLocal.index, this.options.nativeSizeType)); + exprs.push( + module.local_get(tempLocal.index, nativeClassType) + ); if (!isManaged) flow.freeTempLocal(tempLocal); this.currentType = classType.nonNullableType; - return module.flatten(exprs, this.options.nativeSizeType); + return module.flatten(exprs, nativeClassType); } private compileNewExpression( diff --git a/tests/compiler/std/object-literal.json b/tests/compiler/object-literal.json similarity index 100% rename from tests/compiler/std/object-literal.json rename to tests/compiler/object-literal.json diff --git a/tests/compiler/std/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat similarity index 98% rename from tests/compiler/std/object-literal.optimized.wat rename to tests/compiler/object-literal.optimized.wat index 189501eaae..e7c00c0c50 100644 --- a/tests/compiler/std/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -18,7 +18,7 @@ (data (i32.const 1072) "\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 1120) "(\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 1184) "\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 1232) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") + (data (i32.const 1232) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s") (data (i32.const 1300) "\01\00\00\00\01") (data (i32.const 1312) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00h\00e\00l\00l\00o") (data (i32.const 1344) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t") @@ -1407,7 +1407,7 @@ local.get $1 call $~lib/rt/rtrace/onfree ) - (func $std/object-literal/testUnmanaged (param $0 i32) + (func $object-literal/testUnmanaged (param $0 i32) (local $1 i32) (local $2 i32) local.get $0 @@ -1480,7 +1480,7 @@ local.get $1 call $~lib/rt/tlsf/freeBlock ) - (func $std/object-literal/testOmittedTypes (param $0 i32) + (func $object-literal/testOmittedTypes (param $0 i32) local.get $0 i32.load if @@ -1632,7 +1632,7 @@ unreachable end ) - (func $std/object-literal/testOmittedFoo (param $0 i32) + (func $object-literal/testOmittedFoo (param $0 i32) local.get $0 i32.load i32.const 1392 @@ -1760,7 +1760,7 @@ unreachable end ) - (func $start:std/object-literal + (func $start:object-literal (local $0 i32) (local $1 i32) (local $2 i32) @@ -1885,7 +1885,7 @@ end i32.store offset=4 local.get $2 - call $std/object-literal/testUnmanaged + call $object-literal/testUnmanaged i32.const 65 i32.const 4 call $~lib/rt/tlsf/__alloc @@ -1975,7 +1975,7 @@ i32.const 0 i32.store8 offset=64 local.get $0 - call $std/object-literal/testOmittedTypes + call $object-literal/testOmittedTypes i32.const 16 i32.const 5 call $~lib/rt/tlsf/__alloc @@ -2089,7 +2089,7 @@ i32.const 0 i32.store offset=32 local.get $1 - call $std/object-literal/testOmittedFoo + call $object-literal/testOmittedFoo local.get $3 call $~lib/rt/pure/__release local.get $0 @@ -2107,7 +2107,7 @@ i32.const 1 global.set $~started end - call $start:std/object-literal + call $start:object-literal ) (func $~lib/rt/pure/decrement (param $0 i32) (local $1 i32) diff --git a/tests/compiler/std/object-literal.ts b/tests/compiler/object-literal.ts similarity index 100% rename from tests/compiler/std/object-literal.ts rename to tests/compiler/object-literal.ts diff --git a/tests/compiler/std/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat similarity index 97% rename from tests/compiler/std/object-literal.untouched.wat rename to tests/compiler/object-literal.untouched.wat index 707aacaf9b..98f6656a59 100644 --- a/tests/compiler/std/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -19,7 +19,7 @@ (data (i32.const 64) "\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 112) "(\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 176) "\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 224) "*\00\00\00\01\00\00\00\01\00\00\00*\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") + (data (i32.const 224) "\"\00\00\00\01\00\00\00\01\00\00\00\"\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00") (data (i32.const 288) "\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00") (data (i32.const 304) "\n\00\00\00\01\00\00\00\01\00\00\00\n\00\00\00h\00e\00l\00l\00o\00") (data (i32.const 336) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t\00") @@ -1528,7 +1528,7 @@ end local.get $0 ) - (func $std/object-literal/Managed#constructor (param $0 i32) (result i32) + (func $object-literal/Managed#constructor (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -1764,7 +1764,7 @@ call $~lib/rt/pure/__release local.get $2 ) - (func $std/object-literal/testManaged (param $0 i32) + (func $object-literal/testManaged (param $0 i32) local.get $0 call $~lib/rt/pure/__retain local.set $0 @@ -3160,7 +3160,7 @@ local.get $11 call $~lib/rt/pure/__retain ) - (func $std/object-literal/Unmanaged#constructor (param $0 i32) (result i32) + (func $object-literal/Unmanaged#constructor (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -3249,7 +3249,7 @@ call $~lib/rt/tlsf/checkUsedBlock call $~lib/rt/tlsf/freeBlock ) - (func $std/object-literal/testUnmanaged (param $0 i32) + (func $object-literal/testUnmanaged (param $0 i32) local.get $0 i32.load i32.const 123 @@ -3282,7 +3282,7 @@ local.get $0 call $~lib/rt/tlsf/__free ) - (func $std/object-literal/OmittedTypes#constructor (param $0 i32) (result i32) + (func $object-literal/OmittedTypes#constructor (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -3336,7 +3336,7 @@ i32.store8 offset=64 local.get $0 ) - (func $std/object-literal/testOmittedTypes (param $0 i32) + (func $object-literal/testOmittedTypes (param $0 i32) local.get $0 call $~lib/rt/pure/__retain local.set $0 @@ -3527,7 +3527,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/object-literal/MixedOmitted#constructor (param $0 i32) (result i32) + (func $object-literal/MixedOmitted#constructor (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -3548,7 +3548,7 @@ f64.store offset=8 local.get $0 ) - (func $std/object-literal/testMixedOmitted (param $0 i32) + (func $object-literal/testMixedOmitted (param $0 i32) local.get $0 call $~lib/rt/pure/__retain local.set $0 @@ -3594,7 +3594,7 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $std/object-literal/OmittedFoo#constructor (param $0 i32) (result i32) + (func $object-literal/OmittedFoo#constructor (param $0 i32) (result i32) local.get $0 i32.eqz if @@ -3636,7 +3636,7 @@ i32.store offset=36 local.get $0 ) - (func $std/object-literal/testOmittedFoo (param $0 i32) + (func $object-literal/testOmittedFoo (param $0 i32) local.get $0 call $~lib/rt/pure/__retain local.set $0 @@ -3773,13 +3773,13 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $start:std/object-literal + (func $start:object-literal (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) i32.const 0 - call $std/object-literal/Managed#constructor + call $object-literal/Managed#constructor local.set $0 local.get $0 i32.const 123 @@ -3788,9 +3788,9 @@ i32.const 32 i32.store offset=4 local.get $0 - call $std/object-literal/testManaged + call $object-literal/testManaged i32.const 0 - call $std/object-literal/Unmanaged#constructor + call $object-literal/Unmanaged#constructor local.set $1 local.get $1 i32.const 123 @@ -3802,9 +3802,9 @@ call $~lib/string/String#substring i32.store offset=4 local.get $1 - call $std/object-literal/testUnmanaged + call $object-literal/testUnmanaged i32.const 0 - call $std/object-literal/OmittedTypes#constructor + call $object-literal/OmittedTypes#constructor local.set $1 local.get $1 i32.const 0 @@ -3849,9 +3849,9 @@ i32.const 0 i32.store8 offset=64 local.get $1 - call $std/object-literal/testOmittedTypes + call $object-literal/testOmittedTypes i32.const 0 - call $std/object-literal/MixedOmitted#constructor + call $object-literal/MixedOmitted#constructor local.set $2 local.get $2 i32.const 0 @@ -3863,9 +3863,9 @@ f64.const 0 f64.store offset=8 local.get $2 - call $std/object-literal/testMixedOmitted + call $object-literal/testMixedOmitted i32.const 0 - call $std/object-literal/OmittedFoo#constructor + call $object-literal/OmittedFoo#constructor local.set $3 local.get $3 i32.const 0 @@ -3889,7 +3889,7 @@ i32.const 0 i32.store offset=32 local.get $3 - call $std/object-literal/testOmittedFoo + call $object-literal/testOmittedFoo local.get $0 call $~lib/rt/pure/__release local.get $1 @@ -3907,7 +3907,7 @@ i32.const 1 global.set $~started end - call $start:std/object-literal + call $start:object-literal ) (func $~lib/rt/pure/__collect i32.const 1 diff --git a/tests/compiler/std/object-literal-omitted.optimized.wat b/tests/compiler/std/object-literal-omitted.optimized.wat deleted file mode 100644 index 7399ef8711..0000000000 --- a/tests/compiler/std/object-literal-omitted.optimized.wat +++ /dev/null @@ -1,1584 +0,0 @@ -(module - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_i32 (func (param 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) "\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) ":\00\00\00\01\00\00\00\01\00\00\00:\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00o\00m\00i\00t\00t\00e\00d\00.\00t\00s") - (data (i32.const 1264) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t") - (data (i32.const 1296) "\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\00\00\00\00 ") - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 1296)) - (export "memory" (memory $0)) - (export "__alloc" (func $~lib/rt/tlsf/__alloc)) - (export "__retain" (func $~lib/rt/pure/__retain)) - (export "__release" (func $~lib/rt/pure/__release)) - (export "__collect" (func $~lib/rt/pure/__collect)) - (export "__rtti_base" (global $~lib/rt/__rtti_base)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.tee $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $4 - i32.const 7 - i32.sub - local.set $4 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $4 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=20 - local.set $3 - local.get $1 - i32.load offset=16 - local.tee $5 - if - local.get $5 - local.get $3 - i32.store offset=20 - end - local.get $3 - if - local.get $3 - local.get $5 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $3 - i32.store offset=96 - local.get $3 - i32.eqz - if - local.get $0 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.tee $3 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.const -1 - i32.xor - i32.and - local.set $1 - local.get $3 - local.get $1 - i32.store offset=4 - local.get $1 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.tee $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.tee $5 - i32.const 1 - i32.and - if - local.get $3 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const -4 - i32.and - i32.add - local.tee $2 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - local.get $3 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.set $5 - end - end - local.get $3 - i32.const 2 - i32.and - if - local.get $1 - i32.const 4 - i32.sub - i32.load - local.tee $2 - i32.load - local.tee $7 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $7 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $3 - i32.const -4 - i32.and - i32.add - local.tee $8 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $2 - call $~lib/rt/tlsf/removeBlock - local.get $2 - local.get $8 - local.get $7 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $2 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $3 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.const 16 - i32.add - i32.add - local.get $4 - i32.ne - if - i32.const 0 - i32.const 1040 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $3 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $3 - i32.const 7 - i32.sub - local.set $6 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $6 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $3 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $3 - i32.store offset=20 - local.get $3 - if - local.get $3 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $1 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $6 - i32.shl - i32.or - i32.store - local.get $0 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.tee $0 - local.get $0 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.or - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - local.get $2 - i32.le_u - select - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=1568 - local.tee $3 - if - local.get $1 - local.get $3 - i32.const 16 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 16 - i32.sub - i32.eq - if - local.get $3 - i32.load - local.set $4 - local.get $1 - i32.const 16 - i32.sub - local.set $1 - end - else - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.tee $2 - i32.const 48 - i32.lt_u - if - return - end - local.get $1 - local.get $4 - i32.const 2 - i32.and - local.get $2 - i32.const 32 - i32.sub - i32.const 1 - i32.or - i32.or - i32.store - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.tee $2 - i32.const 2 - i32.store - local.get $0 - local.get $2 - i32.store offset=1568 - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/rt/tlsf/ROOT - local.tee $0 - i32.eqz - if - i32.const 1 - memory.size - local.tee $0 - i32.gt_s - if (result i32) - i32.const 1 - local.get $0 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - i32.const 1344 - local.tee $0 - i32.const 0 - i32.store - i32.const 2912 - i32.const 0 - i32.store - loop $for-loop|0 - local.get $1 - i32.const 23 - i32.lt_u - if - local.get $1 - i32.const 2 - i32.shl - i32.const 1344 - i32.add - i32.const 0 - i32.store offset=4 - i32.const 0 - local.set $2 - loop $for-loop|1 - local.get $2 - i32.const 16 - i32.lt_u - if - local.get $1 - i32.const 4 - i32.shl - local.get $2 - i32.add - i32.const 2 - i32.shl - i32.const 1344 - i32.add - i32.const 0 - i32.store offset=96 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|1 - end - end - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|0 - end - end - i32.const 1344 - i32.const 2928 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - i32.const 1344 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - i32.const 256 - i32.lt_u - if - local.get $1 - i32.const 4 - i32.shr_u - local.set $1 - else - local.get $1 - i32.const 536870904 - i32.lt_u - if - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.add - i32.const 1 - i32.sub - local.set $1 - end - local.get $1 - i32.const 31 - local.get $1 - i32.clz - i32.sub - local.tee $2 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $1 - local.get $2 - i32.const 7 - i32.sub - local.set $2 - end - local.get $1 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $2 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 338 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const -1 - local.get $1 - i32.shl - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.get $2 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - local.get $0 - i32.load - i32.const -1 - local.get $2 - i32.const 1 - i32.add - i32.shl - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.tee $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.tee $2 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - i32.ctz - local.get $1 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - i32.const 0 - end - end - ) - (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - i32.load - local.set $3 - local.get $2 - i32.const 15 - i32.and - if - i32.const 0 - i32.const 1040 - i32.const 365 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const -4 - i32.and - local.get $2 - i32.sub - local.tee $4 - i32.const 32 - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - i32.store - local.get $2 - local.get $1 - i32.const 16 - i32.add - i32.add - local.tee $1 - local.get $4 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $3 - i32.const -2 - i32.and - i32.store - local.get $1 - i32.const 16 - i32.add - local.tee $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.get $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - i32.load - i32.const -3 - i32.and - i32.store - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/rt/tlsf/collectLock - if - i32.const 0 - i32.const 1040 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 1073741808 - i32.ge_u - if - i32.const 1088 - i32.const 1040 - i32.const 461 - i32.const 30 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 15 - i32.add - i32.const -16 - i32.and - local.tee $3 - i32.const 16 - local.get $3 - i32.const 16 - i32.gt_u - select - local.tee $4 - call $~lib/rt/tlsf/searchBlock - local.tee $3 - i32.eqz - if - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - local.get $4 - call $~lib/rt/tlsf/searchBlock - local.tee $3 - i32.eqz - if - i32.const 16 - memory.size - local.tee $3 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - i32.load offset=1568 - i32.ne - i32.shl - local.get $4 - i32.const 1 - i32.const 27 - local.get $4 - i32.clz - i32.sub - i32.shl - i32.const 1 - i32.sub - i32.add - local.get $4 - local.get $4 - i32.const 536870904 - i32.lt_u - select - i32.add - i32.const 65535 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.set $5 - local.get $3 - local.get $5 - local.get $3 - local.get $5 - i32.gt_s - select - memory.grow - i32.const 0 - i32.lt_s - if - local.get $5 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - local.get $0 - local.get $3 - i32.const 16 - i32.shl - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - local.get $0 - local.get $4 - call $~lib/rt/tlsf/searchBlock - local.tee $3 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - end - local.get $3 - i32.load - i32.const -4 - i32.and - local.get $4 - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 0 - i32.store offset=4 - local.get $3 - local.get $2 - i32.store offset=8 - local.get $3 - local.get $1 - i32.store offset=12 - local.get $0 - local.get $3 - call $~lib/rt/tlsf/removeBlock - local.get $0 - local.get $3 - local.get $4 - call $~lib/rt/tlsf/prepareBlock - local.get $3 - ) - (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - local.get $1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - ) - (func $~lib/rt/pure/__retain (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1340 - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - local.tee $1 - i32.load offset=4 - local.tee $2 - i32.const -268435456 - i32.and - local.get $2 - i32.const 1 - i32.add - i32.const -268435456 - i32.and - i32.ne - if - i32.const 0 - i32.const 1152 - i32.const 109 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $2 - i32.const 1 - i32.add - i32.store offset=4 - local.get $1 - i32.load - i32.const 1 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 112 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - end - local.get $0 - ) - (func $~lib/rt/pure/__release (param $0 i32) - local.get $0 - i32.const 1340 - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - end - ) - (func $std/object-literal-omitted/testOmittedTypes (param $0 i32) - local.get $0 - i32.load - if - i32.const 0 - i32.const 1200 - i32.const 19 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - if - i32.const 0 - i32.const 1200 - i32.const 20 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=8 - i64.eqz - i32.eqz - if - i32.const 0 - i32.const 1200 - i32.const 21 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=16 - i64.eqz - i32.eqz - if - i32.const 0 - i32.const 1200 - i32.const 22 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f32.load offset=24 - f32.const 0 - f32.ne - if - i32.const 0 - i32.const 1200 - i32.const 23 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=32 - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 1200 - i32.const 24 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_s offset=40 - if - i32.const 0 - i32.const 1200 - i32.const 25 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=41 - if - i32.const 0 - i32.const 1200 - i32.const 26 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_s offset=42 - if - i32.const 0 - i32.const 1200 - i32.const 27 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_u offset=44 - if - i32.const 0 - i32.const 1200 - i32.const 28 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=48 - if - i32.const 0 - i32.const 1200 - i32.const 29 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=52 - if - i32.const 0 - i32.const 1200 - i32.const 30 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=56 - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 1200 - i32.const 31 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=64 - if - i32.const 0 - i32.const 1200 - i32.const 32 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - ) - (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) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - i32.const 1280 - local.set $3 - local.get $0 - i32.const 7 - i32.and - i32.eqz - i32.const 0 - local.get $1 - i32.const 4 - i32.ge_u - select - if - loop $do-continue|0 - local.get $0 - i64.load - local.get $3 - i64.load - i64.eq - if - local.get $0 - i32.const 8 - i32.add - local.set $0 - local.get $3 - i32.const 8 - i32.add - local.set $3 - local.get $1 - i32.const 4 - i32.sub - local.tee $1 - i32.const 4 - i32.ge_u - br_if $do-continue|0 - end - end - end - loop $while-continue|1 - local.get $1 - local.tee $2 - i32.const 1 - i32.sub - local.set $1 - local.get $2 - if - local.get $3 - i32.load16_u - local.tee $2 - local.get $0 - i32.load16_u - local.tee $4 - i32.ne - if - local.get $4 - local.get $2 - i32.sub - return - end - local.get $0 - i32.const 2 - i32.add - local.set $0 - local.get $3 - i32.const 2 - i32.add - local.set $3 - br $while-continue|1 - end - end - i32.const 0 - ) - (func $start:std/object-literal-omitted - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 65 - i32.const 3 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i64.const 0 - i64.store offset=8 - local.get $0 - i64.const 0 - i64.store offset=16 - local.get $0 - f32.const 0 - f32.store offset=24 - local.get $0 - f64.const 0 - f64.store offset=32 - local.get $0 - i32.const 0 - i32.store8 offset=40 - local.get $0 - i32.const 0 - i32.store8 offset=41 - local.get $0 - i32.const 0 - i32.store16 offset=42 - local.get $0 - i32.const 0 - i32.store16 offset=44 - local.get $0 - i32.const 0 - i32.store offset=48 - local.get $0 - i32.const 0 - i32.store offset=52 - local.get $0 - f64.const 0 - f64.store offset=56 - local.get $0 - i32.const 0 - i32.store8 offset=64 - local.get $0 - call $std/object-literal-omitted/testOmittedTypes - i32.const 16 - i32.const 4 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.tee $1 - i32.const 0 - i32.store - local.get $1 - i32.const 1280 - i32.store offset=4 - local.get $1 - f64.const 0 - f64.store offset=8 - local.get $1 - i32.load - if - i32.const 0 - i32.const 1200 - i32.const 44 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - block $__inlined_func$~lib/string/String.__eq (result i32) - i32.const 1 - local.get $1 - i32.load offset=4 - local.tee $2 - i32.const 1280 - i32.eq - br_if $__inlined_func$~lib/string/String.__eq - drop - block $folding-inner0 - i32.const 0 - i32.const 1 - local.get $2 - select - br_if $folding-inner0 - local.get $2 - call $~lib/string/String#get:length - local.tee $3 - i32.const 1280 - call $~lib/string/String#get:length - i32.ne - br_if $folding-inner0 - local.get $2 - local.get $3 - call $~lib/util/string/compareImpl - i32.eqz - br $__inlined_func$~lib/string/String.__eq - end - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1200 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f64.load offset=8 - f64.const 0 - f64.ne - if - i32.const 0 - i32.const 1200 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $~start - call $start:std/object-literal-omitted - ) - (func $~lib/rt/pure/__collect - nop - ) - (func $~lib/rt/pure/decrement (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.tee $2 - i32.const 268435455 - i32.and - local.set $1 - local.get $0 - i32.load - i32.const 1 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 122 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 1 - i32.eq - if - block $__inlined_func$~lib/rt/__visit_members - block $switch$1$default - block $switch$1$case$6 - block $switch$1$case$4 - local.get $0 - i32.const 8 - i32.add - i32.load - br_table $__inlined_func$~lib/rt/__visit_members $__inlined_func$~lib/rt/__visit_members $switch$1$case$4 $__inlined_func$~lib/rt/__visit_members $switch$1$case$6 $switch$1$default - end - local.get $0 - i32.load offset=16 - local.tee $1 - if - local.get $1 - call $~lib/rt/pure/__visit - end - br $__inlined_func$~lib/rt/__visit_members - end - local.get $0 - i32.load offset=20 - local.tee $1 - if - local.get $1 - call $~lib/rt/pure/__visit - end - br $__inlined_func$~lib/rt/__visit_members - end - unreachable - end - local.get $2 - i32.const -2147483648 - i32.and - if - i32.const 0 - i32.const 1152 - i32.const 126 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $0 - i32.load - i32.const 1 - i32.or - i32.store - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - i32.const 0 - i32.le_u - if - i32.const 0 - i32.const 1152 - i32.const 136 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 1 - i32.sub - local.get $2 - i32.const -268435456 - i32.and - i32.or - i32.store offset=4 - end - ) - (func $~lib/rt/pure/__visit (param $0 i32) - local.get $0 - i32.const 1340 - i32.lt_u - if - return - end - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - ) -) diff --git a/tests/compiler/std/object-literal-omitted.untouched.wat b/tests/compiler/std/object-literal-omitted.untouched.wat deleted file mode 100644 index 3a4e8e5641..0000000000 --- a/tests/compiler/std/object-literal-omitted.untouched.wat +++ /dev/null @@ -1,2227 +0,0 @@ -(module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result 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) "\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) ":\00\00\00\01\00\00\00\01\00\00\00:\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00o\00m\00i\00t\00t\00e\00d\00.\00t\00s\00") - (data (i32.const 256) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00s\00t\00") - (data (i32.const 288) "\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\00\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 $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 288)) - (global $~lib/heap/__heap_base i32 (i32.const 332)) - (export "memory" (memory $0)) - (export "__alloc" (func $~lib/rt/tlsf/__alloc)) - (export "__retain" (func $~lib/rt/pure/__retain)) - (export "__release" (func $~lib/rt/pure/__release)) - (export "__collect" (func $~lib/rt/pure/__collect)) - (export "__rtti_base" (global $~lib/rt/__rtti_base)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $1 - i32.load - local.set $2 - i32.const 1 - drop - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $3 - i32.const 1 - drop - local.get $3 - i32.const 16 - i32.ge_u - if (result i32) - local.get $3 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $4 - local.get $3 - i32.const 4 - i32.shr_u - local.set $5 - else - i32.const 31 - local.get $3 - i32.clz - i32.sub - local.set $4 - local.get $3 - local.get $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $5 - local.get $4 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $4 - end - i32.const 1 - drop - local.get $4 - i32.const 23 - i32.lt_u - if (result i32) - local.get $5 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=16 - local.set $6 - local.get $1 - i32.load offset=20 - local.set $7 - local.get $6 - if - local.get $6 - local.get $7 - i32.store offset=20 - end - local.get $7 - if - local.get $7 - local.get $6 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.set $10 - local.get $4 - local.set $9 - local.get $5 - local.set $8 - local.get $10 - local.get $9 - i32.const 4 - i32.shl - local.get $8 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.set $11 - local.get $4 - local.set $10 - local.get $5 - local.set $9 - local.get $7 - local.set $8 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.store offset=96 - local.get $7 - i32.eqz - if - local.get $0 - local.set $9 - local.get $4 - local.set $8 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $9 - local.get $0 - local.set $8 - local.get $4 - local.set $11 - local.get $9 - i32.const 1 - local.get $5 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $9 - local.set $10 - local.get $8 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.store offset=4 - local.get $9 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - i32.const 1 - drop - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.set $2 - i32.const 1 - drop - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.set $3 - local.get $3 - i32.const 16 - i32.add - local.get $3 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - local.get $5 - i32.const 1 - i32.and - if - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $3 - local.get $3 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - i32.const 3 - i32.and - local.get $3 - i32.or - local.tee $2 - i32.store - local.get $1 - local.set $6 - local.get $6 - i32.const 16 - i32.add - local.get $6 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - end - end - local.get $2 - i32.const 2 - i32.and - if - local.get $1 - local.set $6 - local.get $6 - i32.const 4 - i32.sub - i32.load - local.set $6 - local.get $6 - i32.load - local.set $3 - i32.const 1 - drop - local.get $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $7 - local.get $7 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $6 - call $~lib/rt/tlsf/removeBlock - local.get $6 - local.get $3 - i32.const 3 - i32.and - local.get $7 - i32.or - local.tee $2 - i32.store - local.get $6 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $8 - i32.const 1 - drop - local.get $8 - i32.const 16 - i32.ge_u - if (result i32) - local.get $8 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - drop - local.get $1 - i32.const 16 - i32.add - local.get $8 - i32.add - local.get $4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $8 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $9 - local.get $8 - i32.const 4 - i32.shr_u - local.set $10 - else - i32.const 31 - local.get $8 - i32.clz - i32.sub - local.set $9 - local.get $8 - local.get $9 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $10 - local.get $9 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $9 - end - i32.const 1 - drop - local.get $9 - i32.const 23 - i32.lt_u - if (result i32) - local.get $10 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $7 - local.get $9 - local.set $3 - local.get $10 - local.set $6 - local.get $7 - local.get $3 - i32.const 4 - i32.shl - local.get $6 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $11 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $11 - i32.store offset=20 - local.get $11 - if - local.get $11 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.set $12 - local.get $9 - local.set $7 - local.get $10 - local.set $3 - local.get $1 - local.set $6 - local.get $12 - local.get $7 - i32.const 4 - i32.shl - local.get $3 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $9 - i32.shl - i32.or - i32.store - local.get $0 - local.set $13 - local.get $9 - local.set $12 - local.get $0 - local.set $3 - local.get $9 - local.set $6 - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 1 - local.get $10 - i32.shl - i32.or - local.set $7 - local.get $13 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - i32.const 1 - drop - local.get $1 - local.get $2 - i32.le_u - if (result i32) - local.get $1 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - local.set $4 - i32.const 0 - local.set $5 - local.get $4 - if - i32.const 1 - drop - local.get $1 - local.get $4 - i32.const 16 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.sub - local.get $4 - i32.eq - if - local.get $1 - i32.const 16 - i32.sub - local.set $1 - local.get $4 - i32.load - local.set $5 - else - nop - end - else - i32.const 1 - drop - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.set $6 - local.get $6 - i32.const 16 - i32.const 16 - i32.add - i32.const 16 - i32.add - i32.lt_u - if - i32.const 0 - return - end - local.get $6 - i32.const 16 - i32.const 1 - i32.shl - i32.sub - local.set $7 - local.get $1 - local.set $8 - local.get $8 - local.get $7 - i32.const 1 - i32.or - local.get $5 - i32.const 2 - i32.and - i32.or - i32.store - local.get $8 - i32.const 0 - i32.store offset=16 - local.get $8 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $6 - i32.add - i32.const 16 - i32.sub - local.set $4 - local.get $4 - i32.const 0 - i32.const 2 - i32.or - i32.store - local.get $0 - local.set $9 - local.get $4 - local.set $3 - local.get $9 - local.get $3 - i32.store offset=1568 - local.get $0 - local.get $8 - call $~lib/rt/tlsf/insertBlock - i32.const 1 - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - global.get $~lib/rt/tlsf/ROOT - local.set $0 - local.get $0 - i32.eqz - if - global.get $~lib/heap/__heap_base - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $1 - memory.size - local.set $2 - local.get $1 - i32.const 1572 - i32.add - 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 $3 - local.get $2 - i32.gt_s - if (result i32) - local.get $3 - local.get $2 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - local.get $1 - local.set $0 - local.get $0 - i32.const 0 - i32.store - local.get $0 - local.set $5 - i32.const 0 - local.set $4 - local.get $5 - local.get $4 - i32.store offset=1568 - i32.const 0 - local.set $5 - loop $for-loop|0 - local.get $5 - i32.const 23 - i32.lt_u - local.set $4 - local.get $4 - if - local.get $0 - local.set $8 - local.get $5 - local.set $7 - i32.const 0 - local.set $6 - local.get $8 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=4 - i32.const 0 - local.set $8 - loop $for-loop|1 - local.get $8 - i32.const 16 - i32.lt_u - local.set $7 - local.get $7 - if - local.get $0 - local.set $11 - local.get $5 - local.set $10 - local.get $8 - local.set $9 - i32.const 0 - local.set $6 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $8 - i32.const 1 - i32.add - local.set $8 - br $for-loop|1 - end - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $1 - i32.const 1572 - i32.add - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $5 - i32.const 0 - drop - local.get $0 - local.get $5 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - local.get $0 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741808 - i32.ge_u - if - i32.const 80 - i32.const 32 - i32.const 461 - i32.const 30 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.tee $1 - i32.const 16 - local.tee $2 - local.get $1 - local.get $2 - i32.gt_u - select - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $2 - local.get $1 - i32.const 4 - i32.shr_u - local.set $3 - else - local.get $1 - i32.const 536870904 - i32.lt_u - if (result i32) - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.add - i32.const 1 - i32.sub - else - local.get $1 - end - local.set $4 - i32.const 31 - local.get $4 - i32.clz - i32.sub - local.set $2 - local.get $4 - local.get $2 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $3 - local.get $2 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $2 - end - i32.const 1 - drop - local.get $2 - i32.const 23 - i32.lt_u - if (result i32) - local.get $3 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 338 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $5 - local.get $2 - local.set $4 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 0 - i32.const -1 - i32.xor - local.get $3 - i32.shl - i32.and - local.set $6 - i32.const 0 - local.set $7 - local.get $6 - i32.eqz - if - local.get $0 - i32.load - i32.const 0 - i32.const -1 - i32.xor - local.get $2 - i32.const 1 - i32.add - i32.shl - i32.and - local.set $5 - local.get $5 - i32.eqz - if - i32.const 0 - local.set $7 - else - local.get $5 - i32.ctz - local.set $2 - local.get $0 - local.set $8 - local.get $2 - local.set $4 - local.get $8 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $6 - i32.const 1 - drop - local.get $6 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - else - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - local.get $7 - ) - (func $~lib/rt/tlsf/growMemory (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 0 - drop - local.get $1 - i32.const 536870904 - i32.lt_u - if - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.const 1 - i32.sub - i32.add - local.set $1 - end - memory.size - local.set $2 - local.get $1 - i32.const 16 - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - i32.ne - i32.shl - i32.add - local.set $1 - local.get $1 - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $4 - local.get $2 - local.tee $3 - local.get $4 - local.tee $5 - local.get $3 - local.get $5 - i32.gt_s - select - local.set $6 - local.get $6 - memory.grow - i32.const 0 - i32.lt_s - if - local.get $4 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - memory.size - local.set $7 - local.get $0 - local.get $2 - i32.const 16 - i32.shl - local.get $7 - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - ) - (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.set $3 - i32.const 1 - drop - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 365 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.sub - local.set $4 - local.get $4 - i32.const 16 - i32.const 16 - i32.add - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $2 - i32.add - local.set $5 - local.get $5 - local.get $4 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $5 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $3 - i32.const 1 - i32.const -1 - i32.xor - i32.and - i32.store - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - i32.load - i32.const 2 - i32.const -1 - i32.xor - i32.and - i32.store - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - i32.const 1 - drop - global.get $~lib/rt/tlsf/collectLock - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/rt/tlsf/prepareSize - local.set $3 - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - global.get $~lib/gc/gc.auto - if - i32.const 1 - drop - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - call $~lib/rt/pure/__collect - i32.const 1 - drop - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - i32.const 1 - drop - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - else - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - i32.const 1 - drop - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 518 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - end - end - i32.const 1 - drop - local.get $4 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $3 - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 0 - i32.store offset=4 - local.get $4 - local.get $2 - i32.store offset=8 - local.get $4 - local.get $1 - i32.store offset=12 - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $0 - local.get $4 - local.get $3 - call $~lib/rt/tlsf/prepareBlock - i32.const 0 - drop - local.get $4 - ) - (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - local.get $1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - ) - (func $~lib/rt/pure/increment (param $0 i32) - (local $1 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - local.get $1 - i32.const 1 - i32.add - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 109 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=4 - i32.const 0 - drop - i32.const 1 - drop - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 112 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/rt/pure/__retain (param $0 i32) (result i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/increment - end - local.get $0 - ) - (func $~lib/rt/pure/__release (param $0 i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.gt_u - if - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - end - ) - (func $std/object-literal-omitted/testOmittedTypes (param $0 i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - i32.load - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 19 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 20 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=8 - i64.const 0 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 21 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.load offset=16 - i64.const 0 - i64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 22 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f32.load offset=24 - f32.const 0 - f32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 23 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=32 - f64.const 0 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 24 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_s offset=40 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 25 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=41 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 26 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_s offset=42 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 27 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load16_u offset=44 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 28 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=48 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 29 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=52 - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 30 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=56 - f64.const 0 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 31 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load8_u offset=64 - i32.const 0 - i32.ne - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 32 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/pure/__release - ) - (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/pure/__retain - local.set $0 - local.get $2 - call $~lib/rt/pure/__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/pure/__release - local.get $2 - call $~lib/rt/pure/__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/pure/__release - local.get $2 - call $~lib/rt/pure/__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/pure/__retain - local.set $0 - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__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/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - ) - (func $std/object-literal-omitted/testMixedOmitted (param $0 i32) - local.get $0 - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - i32.load - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 44 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - i32.const 272 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - f64.load offset=8 - f64.const 0 - f64.eq - i32.eqz - if - i32.const 0 - i32.const 192 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/pure/__release - ) - (func $start:std/object-literal-omitted - (local $0 i32) - (local $1 i32) - i32.const 65 - i32.const 3 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $0 - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i64.const 0 - i64.store offset=8 - local.get $0 - i64.const 0 - i64.store offset=16 - local.get $0 - f32.const 0 - f32.store offset=24 - local.get $0 - f64.const 0 - f64.store offset=32 - local.get $0 - i32.const 0 - i32.store8 offset=40 - local.get $0 - i32.const 0 - i32.store8 offset=41 - local.get $0 - i32.const 0 - i32.store16 offset=42 - local.get $0 - i32.const 0 - i32.store16 offset=44 - local.get $0 - i32.const 0 - i32.store offset=48 - local.get $0 - i32.const 0 - i32.store offset=52 - local.get $0 - f64.const 0 - f64.store offset=56 - local.get $0 - i32.const 0 - i32.store8 offset=64 - local.get $0 - call $std/object-literal-omitted/testOmittedTypes - i32.const 16 - i32.const 4 - call $~lib/rt/tlsf/__alloc - call $~lib/rt/pure/__retain - local.set $1 - local.get $1 - i32.const 0 - i32.store - local.get $1 - i32.const 272 - i32.store offset=4 - local.get $1 - f64.const 0 - f64.store offset=8 - local.get $1 - call $std/object-literal-omitted/testMixedOmitted - local.get $0 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $~start - call $start:std/object-literal-omitted - ) - (func $~lib/rt/pure/__collect - i32.const 1 - drop - return - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - i32.const 0 - drop - ) - (func $~lib/rt/pure/decrement (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - local.set $1 - local.get $1 - i32.const 268435455 - i32.and - local.set $2 - i32.const 0 - drop - i32.const 1 - drop - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 122 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 1 - i32.eq - if - local.get $0 - i32.const 16 - i32.add - i32.const 1 - call $~lib/rt/__visit_members - i32.const 1 - drop - i32.const 1 - drop - local.get $1 - i32.const -2147483648 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 126 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/freeBlock - else - i32.const 1 - drop - local.get $2 - i32.const 0 - i32.gt_u - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 136 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - drop - local.get $0 - local.get $1 - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.const 1 - i32.sub - i32.or - i32.store offset=4 - end - ) - (func $~lib/rt/pure/__visit (param $0 i32) (param $1 i32) - local.get $0 - global.get $~lib/heap/__heap_base - i32.lt_u - if - return - end - i32.const 1 - drop - i32.const 1 - drop - local.get $1 - i32.const 1 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 69 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 16 - i32.sub - call $~lib/rt/pure/decrement - ) - (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) - (local $2 i32) - block $switch$1$default - block $switch$1$case$6 - block $switch$1$case$4 - block $switch$1$case$2 - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $switch$1$case$2 $switch$1$case$2 $switch$1$case$4 $switch$1$case$2 $switch$1$case$6 $switch$1$default - end - return - end - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/pure/__visit - end - return - end - local.get $0 - i32.load offset=4 - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/pure/__visit - end - return - end - unreachable - ) -) diff --git a/tests/compiler/std/object-literal-unmanaged.optimized.wat b/tests/compiler/std/object-literal-unmanaged.optimized.wat deleted file mode 100644 index 95982af30e..0000000000 --- a/tests/compiler/std/object-literal-unmanaged.optimized.wat +++ /dev/null @@ -1,969 +0,0 @@ -(module - (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) - (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) - (memory $0 1) - (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) ">\00\00\00\01\00\00\00\01\00\00\00>\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00u\00n\00m\00a\00n\00a\00g\00e\00d\00.\00t\00s") - (global $std/object-literal-unmanaged/foo (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/collectLock (mut i32) (i32.const 0)) - (export "memory" (memory $0)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.tee $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $4 - i32.const 7 - i32.sub - local.set $4 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $4 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=20 - local.set $3 - local.get $1 - i32.load offset=16 - local.tee $5 - if - local.get $5 - local.get $3 - i32.store offset=20 - end - local.get $3 - if - local.get $3 - local.get $5 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.get $2 - local.get $4 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $3 - i32.store offset=96 - local.get $3 - i32.eqz - if - local.get $0 - local.get $4 - i32.const 2 - i32.shl - i32.add - local.tee $3 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.const -1 - i32.xor - i32.and - local.set $1 - local.get $3 - local.get $1 - i32.store offset=4 - local.get $1 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.tee $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.tee $5 - i32.const 1 - i32.and - if - local.get $3 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const -4 - i32.and - i32.add - local.tee $2 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - local.get $3 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.set $5 - end - end - local.get $3 - i32.const 2 - i32.and - if - local.get $1 - i32.const 4 - i32.sub - i32.load - local.tee $2 - i32.load - local.tee $7 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $7 - i32.const -4 - i32.and - i32.const 16 - i32.add - local.get $3 - i32.const -4 - i32.and - i32.add - local.tee $8 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $2 - call $~lib/rt/tlsf/removeBlock - local.get $2 - local.get $8 - local.get $7 - i32.const 3 - i32.and - i32.or - local.tee $3 - i32.store - local.get $2 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $3 - i32.const -4 - i32.and - local.tee $2 - i32.const 16 - i32.ge_u - if (result i32) - local.get $2 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.const 16 - i32.add - i32.add - local.get $4 - i32.ne - if - i32.const 0 - i32.const 1040 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $2 - i32.const 256 - i32.lt_u - if - local.get $2 - i32.const 4 - i32.shr_u - local.set $2 - else - local.get $2 - i32.const 31 - local.get $2 - i32.clz - i32.sub - local.tee $3 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - local.set $2 - local.get $3 - i32.const 7 - i32.sub - local.set $6 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $6 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $3 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $3 - i32.store offset=20 - local.get $3 - if - local.get $3 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.get $2 - local.get $6 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $1 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $6 - i32.shl - i32.or - i32.store - local.get $0 - local.get $6 - i32.const 2 - i32.shl - i32.add - local.tee $0 - local.get $0 - i32.load offset=4 - i32.const 1 - local.get $2 - i32.shl - i32.or - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - local.get $2 - i32.le_u - select - select - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=1568 - local.tee $3 - if - local.get $1 - local.get $3 - i32.const 16 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 16 - i32.sub - i32.eq - if - local.get $3 - i32.load - local.set $4 - local.get $1 - i32.const 16 - i32.sub - local.set $1 - end - else - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.tee $2 - i32.const 48 - i32.lt_u - if - return - end - local.get $1 - local.get $4 - i32.const 2 - i32.and - local.get $2 - i32.const 32 - i32.sub - i32.const 1 - i32.or - i32.or - i32.store - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $2 - i32.add - i32.const 16 - i32.sub - local.tee $2 - i32.const 2 - i32.store - local.get $0 - local.get $2 - i32.store offset=1568 - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - global.get $~lib/rt/tlsf/ROOT - local.tee $0 - i32.eqz - if - i32.const 1 - memory.size - local.tee $0 - i32.gt_s - if (result i32) - i32.const 1 - local.get $0 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - i32.const 1216 - local.tee $0 - i32.const 0 - i32.store - i32.const 2784 - i32.const 0 - i32.store - loop $for-loop|0 - local.get $1 - i32.const 23 - i32.lt_u - if - local.get $1 - i32.const 2 - i32.shl - i32.const 1216 - i32.add - i32.const 0 - i32.store offset=4 - i32.const 0 - local.set $2 - loop $for-loop|1 - local.get $2 - i32.const 16 - i32.lt_u - if - local.get $1 - i32.const 4 - i32.shl - local.get $2 - i32.add - i32.const 2 - i32.shl - i32.const 1216 - i32.add - i32.const 0 - i32.store offset=96 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|1 - end - end - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|0 - end - end - i32.const 1216 - i32.const 2800 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - i32.const 1216 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.load offset=4 - i32.const -2 - i32.and - local.tee $2 - if (result i32) - local.get $0 - local.get $2 - i32.ctz - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - local.get $0 - i32.load - i32.const -2 - i32.and - local.tee $1 - if (result i32) - local.get $0 - local.get $1 - i32.ctz - local.tee $1 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.tee $2 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $2 - i32.ctz - local.get $1 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - else - i32.const 0 - end - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/rt/tlsf/collectLock - if - i32.const 0 - i32.const 1040 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/tlsf/searchBlock - local.tee $1 - i32.eqz - if - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - call $~lib/rt/tlsf/searchBlock - local.tee $1 - i32.eqz - if - i32.const 16 - memory.size - local.tee $2 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - i32.load offset=1568 - i32.ne - i32.shl - i32.const 65551 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.set $1 - local.get $2 - local.get $1 - local.get $2 - local.get $1 - i32.gt_s - select - memory.grow - i32.const 0 - i32.lt_s - if - local.get $1 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - local.get $0 - local.get $2 - i32.const 16 - i32.shl - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - local.get $0 - call $~lib/rt/tlsf/searchBlock - local.tee $1 - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - end - local.get $1 - i32.load - i32.const -4 - i32.and - i32.const 16 - i32.lt_u - if - i32.const 0 - i32.const 1040 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 4 - i32.store offset=12 - local.get $0 - local.get $1 - call $~lib/rt/tlsf/removeBlock - local.get $1 - i32.load - local.tee $2 - i32.const -4 - i32.and - i32.const 16 - i32.sub - local.tee $3 - i32.const 32 - i32.ge_u - if - local.get $1 - local.get $2 - i32.const 2 - i32.and - i32.const 16 - i32.or - i32.store - local.get $1 - i32.const 32 - i32.add - local.tee $2 - local.get $3 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $2 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $2 - i32.const -2 - i32.and - i32.store - local.get $1 - i32.const 16 - i32.add - local.tee $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.get $0 - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - i32.load - i32.const -3 - i32.and - i32.store - end - local.get $1 - call $~lib/rt/rtrace/onalloc - local.get $1 - ) - (func $~start - (local $0 i32) - (local $1 i32) - (local $2 i32) - call $~lib/rt/tlsf/maybeInitialize - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - local.tee $1 - i32.const 123 - i32.store - local.get $1 - global.set $std/object-literal-unmanaged/foo - global.get $std/object-literal-unmanaged/foo - i32.load - i32.const 123 - i32.ne - if - i32.const 0 - i32.const 1152 - i32.const 13 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/object-literal-unmanaged/foo - local.set $1 - call $~lib/rt/tlsf/maybeInitialize - local.get $1 - i32.const 16 - i32.sub - local.set $0 - local.get $1 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $1 - select - if (result i32) - local.get $0 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $0 - i32.load offset=4 - i32.const -268435456 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1040 - i32.const 581 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $0 - i32.load - i32.const 1 - i32.or - i32.store - local.get $0 - call $~lib/rt/tlsf/insertBlock - local.get $0 - call $~lib/rt/rtrace/onfree - ) -) diff --git a/tests/compiler/std/object-literal-unmanaged.untouched.wat b/tests/compiler/std/object-literal-unmanaged.untouched.wat deleted file mode 100644 index 924f127b68..0000000000 --- a/tests/compiler/std/object-literal-unmanaged.untouched.wat +++ /dev/null @@ -1,1566 +0,0 @@ -(module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (import "rtrace" "onalloc" (func $~lib/rt/rtrace/onalloc (param i32))) - (import "rtrace" "onfree" (func $~lib/rt/rtrace/onfree (param i32))) - (memory $0 1) - (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) ">\00\00\00\01\00\00\00\01\00\00\00>\00\00\00s\00t\00d\00/\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00-\00u\00n\00m\00a\00n\00a\00g\00e\00d\00.\00t\00s\00") - (table $0 1 funcref) - (global $std/object-literal-unmanaged/foo (mut i32) (i32.const 0)) - (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 208)) - (export "memory" (memory $0)) - (start $~start) - (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $1 - i32.load - local.set $2 - i32.const 1 - drop - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 277 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $3 - i32.const 1 - drop - local.get $3 - i32.const 16 - i32.ge_u - if (result i32) - local.get $3 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 279 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $4 - local.get $3 - i32.const 4 - i32.shr_u - local.set $5 - else - i32.const 31 - local.get $3 - i32.clz - i32.sub - local.set $4 - local.get $3 - local.get $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $5 - local.get $4 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $4 - end - i32.const 1 - drop - local.get $4 - i32.const 23 - i32.lt_u - if (result i32) - local.get $5 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 292 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load offset=16 - local.set $6 - local.get $1 - i32.load offset=20 - local.set $7 - local.get $6 - if - local.get $6 - local.get $7 - i32.store offset=20 - end - local.get $7 - if - local.get $7 - local.get $6 - i32.store offset=16 - end - local.get $1 - local.get $0 - local.set $10 - local.get $4 - local.set $9 - local.get $5 - local.set $8 - local.get $10 - local.get $9 - i32.const 4 - i32.shl - local.get $8 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - i32.eq - if - local.get $0 - local.set $11 - local.get $4 - local.set $10 - local.get $5 - local.set $9 - local.get $7 - local.set $8 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $8 - i32.store offset=96 - local.get $7 - i32.eqz - if - local.get $0 - local.set $9 - local.get $4 - local.set $8 - local.get $9 - local.get $8 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $9 - local.get $0 - local.set $8 - local.get $4 - local.set $11 - local.get $9 - i32.const 1 - local.get $5 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $9 - local.set $10 - local.get $8 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.store offset=4 - local.get $9 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $4 - i32.shl - i32.const -1 - i32.xor - i32.and - i32.store - end - end - end - ) - (func $~lib/rt/tlsf/insertBlock (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - i32.const 1 - drop - local.get $1 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 205 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.load - local.set $2 - i32.const 1 - drop - local.get $2 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 207 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.set $3 - local.get $3 - i32.const 16 - i32.add - local.get $3 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - local.get $5 - i32.const 1 - i32.and - if - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $5 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $3 - local.get $3 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - i32.const 3 - i32.and - local.get $3 - i32.or - local.tee $2 - i32.store - local.get $1 - local.set $6 - local.get $6 - i32.const 16 - i32.add - local.get $6 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $4 - local.get $4 - i32.load - local.set $5 - end - end - local.get $2 - i32.const 2 - i32.and - if - local.get $1 - local.set $6 - local.get $6 - i32.const 4 - i32.sub - i32.load - local.set $6 - local.get $6 - i32.load - local.set $3 - i32.const 1 - drop - local.get $3 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 228 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.add - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.set $7 - local.get $7 - i32.const 1073741808 - i32.lt_u - if - local.get $0 - local.get $6 - call $~lib/rt/tlsf/removeBlock - local.get $6 - local.get $3 - i32.const 3 - i32.and - local.get $7 - i32.or - local.tee $2 - i32.store - local.get $6 - local.set $1 - end - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - i32.store - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $8 - i32.const 1 - drop - local.get $8 - i32.const 16 - i32.ge_u - if (result i32) - local.get $8 - i32.const 1073741808 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 243 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - drop - local.get $1 - i32.const 16 - i32.add - local.get $8 - i32.add - local.get $4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 244 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $8 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $9 - local.get $8 - i32.const 4 - i32.shr_u - local.set $10 - else - i32.const 31 - local.get $8 - i32.clz - i32.sub - local.set $9 - local.get $8 - local.get $9 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $10 - local.get $9 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $9 - end - i32.const 1 - drop - local.get $9 - i32.const 23 - i32.lt_u - if (result i32) - local.get $10 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 260 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $7 - local.get $9 - local.set $3 - local.get $10 - local.set $6 - local.get $7 - local.get $3 - i32.const 4 - i32.shl - local.get $6 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $11 - local.get $1 - i32.const 0 - i32.store offset=16 - local.get $1 - local.get $11 - i32.store offset=20 - local.get $11 - if - local.get $11 - local.get $1 - i32.store offset=16 - end - local.get $0 - local.set $12 - local.get $9 - local.set $7 - local.get $10 - local.set $3 - local.get $1 - local.set $6 - local.get $12 - local.get $7 - i32.const 4 - i32.shl - local.get $3 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $0 - local.get $0 - i32.load - i32.const 1 - local.get $9 - i32.shl - i32.or - i32.store - local.get $0 - local.set $13 - local.get $9 - local.set $12 - local.get $0 - local.set $3 - local.get $9 - local.set $6 - local.get $3 - local.get $6 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 1 - local.get $10 - i32.shl - i32.or - local.set $7 - local.get $13 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.store offset=4 - ) - (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - i32.const 1 - drop - local.get $1 - local.get $2 - i32.le_u - if (result i32) - local.get $1 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $2 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 386 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - local.set $4 - i32.const 0 - local.set $5 - local.get $4 - if - i32.const 1 - drop - local.get $1 - local.get $4 - i32.const 16 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 396 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 16 - i32.sub - local.get $4 - i32.eq - if - local.get $1 - i32.const 16 - i32.sub - local.set $1 - local.get $4 - i32.load - local.set $5 - else - nop - end - else - i32.const 1 - drop - local.get $1 - local.get $0 - i32.const 1572 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 408 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $2 - local.get $1 - i32.sub - local.set $6 - local.get $6 - i32.const 16 - i32.const 16 - i32.add - i32.const 16 - i32.add - i32.lt_u - if - i32.const 0 - return - end - local.get $6 - i32.const 16 - i32.const 1 - i32.shl - i32.sub - local.set $7 - local.get $1 - local.set $8 - local.get $8 - local.get $7 - i32.const 1 - i32.or - local.get $5 - i32.const 2 - i32.and - i32.or - i32.store - local.get $8 - i32.const 0 - i32.store offset=16 - local.get $8 - i32.const 0 - i32.store offset=20 - local.get $1 - local.get $6 - i32.add - i32.const 16 - i32.sub - local.set $4 - local.get $4 - i32.const 0 - i32.const 2 - i32.or - i32.store - local.get $0 - local.set $9 - local.get $4 - local.set $3 - local.get $9 - local.get $3 - i32.store offset=1568 - local.get $0 - local.get $8 - call $~lib/rt/tlsf/insertBlock - i32.const 1 - ) - (func $~lib/rt/tlsf/maybeInitialize (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - global.get $~lib/rt/tlsf/ROOT - local.set $0 - local.get $0 - i32.eqz - if - global.get $~lib/heap/__heap_base - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $1 - memory.size - local.set $2 - local.get $1 - i32.const 1572 - i32.add - 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 $3 - local.get $2 - i32.gt_s - if (result i32) - local.get $3 - local.get $2 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - local.get $1 - local.set $0 - local.get $0 - i32.const 0 - i32.store - local.get $0 - local.set $5 - i32.const 0 - local.set $4 - local.get $5 - local.get $4 - i32.store offset=1568 - i32.const 0 - local.set $5 - loop $for-loop|0 - local.get $5 - i32.const 23 - i32.lt_u - local.set $4 - local.get $4 - if - local.get $0 - local.set $8 - local.get $5 - local.set $7 - i32.const 0 - local.set $6 - local.get $8 - local.get $7 - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=4 - i32.const 0 - local.set $8 - loop $for-loop|1 - local.get $8 - i32.const 16 - i32.lt_u - local.set $7 - local.get $7 - if - local.get $0 - local.set $11 - local.get $5 - local.set $10 - local.get $8 - local.set $9 - i32.const 0 - local.set $6 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $9 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $6 - i32.store offset=96 - local.get $8 - i32.const 1 - i32.add - local.set $8 - br $for-loop|1 - end - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $1 - i32.const 1572 - i32.add - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $5 - i32.const 0 - drop - local.get $0 - local.get $5 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - local.get $0 - global.set $~lib/rt/tlsf/ROOT - end - local.get $0 - ) - (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.const 1073741808 - i32.ge_u - if - i32.const 80 - i32.const 32 - i32.const 461 - i32.const 30 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.tee $1 - i32.const 16 - local.tee $2 - local.get $1 - local.get $2 - i32.gt_u - select - ) - (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - local.get $1 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $2 - local.get $1 - i32.const 4 - i32.shr_u - local.set $3 - else - local.get $1 - i32.const 536870904 - i32.lt_u - if (result i32) - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.add - i32.const 1 - i32.sub - else - local.get $1 - end - local.set $4 - i32.const 31 - local.get $4 - i32.clz - i32.sub - local.set $2 - local.get $4 - local.get $2 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $3 - local.get $2 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $2 - end - i32.const 1 - drop - local.get $2 - i32.const 23 - i32.lt_u - if (result i32) - local.get $3 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 338 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $5 - local.get $2 - local.set $4 - local.get $5 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - i32.const 0 - i32.const -1 - i32.xor - local.get $3 - i32.shl - i32.and - local.set $6 - i32.const 0 - local.set $7 - local.get $6 - i32.eqz - if - local.get $0 - i32.load - i32.const 0 - i32.const -1 - i32.xor - local.get $2 - i32.const 1 - i32.add - i32.shl - i32.and - local.set $5 - local.get $5 - i32.eqz - if - i32.const 0 - local.set $7 - else - local.get $5 - i32.ctz - local.set $2 - local.get $0 - local.set $8 - local.get $2 - local.set $4 - local.get $8 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $6 - i32.const 1 - drop - local.get $6 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 351 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - else - local.get $0 - local.set $9 - local.get $2 - local.set $8 - local.get $6 - i32.ctz - local.set $4 - local.get $9 - local.get $8 - i32.const 4 - i32.shl - local.get $4 - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $7 - end - local.get $7 - ) - (func $~lib/rt/tlsf/growMemory (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 0 - drop - local.get $1 - i32.const 536870904 - i32.lt_u - if - local.get $1 - i32.const 1 - i32.const 27 - local.get $1 - i32.clz - i32.sub - i32.shl - i32.const 1 - i32.sub - i32.add - local.set $1 - end - memory.size - local.set $2 - local.get $1 - i32.const 16 - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.sub - local.get $0 - local.set $3 - local.get $3 - i32.load offset=1568 - i32.ne - i32.shl - i32.add - local.set $1 - local.get $1 - i32.const 65535 - i32.add - i32.const 65535 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.shr_u - local.set $4 - local.get $2 - local.tee $3 - local.get $4 - local.tee $5 - local.get $3 - local.get $5 - i32.gt_s - select - local.set $6 - local.get $6 - memory.grow - i32.const 0 - i32.lt_s - if - local.get $4 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - memory.size - local.set $7 - local.get $0 - local.get $2 - i32.const 16 - i32.shl - local.get $7 - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - ) - (func $~lib/rt/tlsf/prepareBlock (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $1 - i32.load - local.set $3 - i32.const 1 - drop - local.get $2 - i32.const 15 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 365 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.sub - local.set $4 - local.get $4 - i32.const 16 - i32.const 16 - i32.add - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - i32.store - local.get $1 - i32.const 16 - i32.add - local.get $2 - i32.add - local.set $5 - local.get $5 - local.get $4 - i32.const 16 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $5 - call $~lib/rt/tlsf/insertBlock - else - local.get $1 - local.get $3 - i32.const 1 - i32.const -1 - i32.xor - i32.and - i32.store - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.get $1 - local.set $5 - local.get $5 - i32.const 16 - i32.add - local.get $5 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - i32.load - i32.const 2 - i32.const -1 - i32.xor - i32.and - i32.store - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - i32.const 1 - drop - global.get $~lib/rt/tlsf/collectLock - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 501 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/rt/tlsf/prepareSize - local.set $3 - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - global.get $~lib/gc/gc.auto - if - i32.const 1 - drop - i32.const 1 - global.set $~lib/rt/tlsf/collectLock - call $~lib/rt/pure/__collect - i32.const 1 - drop - i32.const 0 - global.set $~lib/rt/tlsf/collectLock - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - local.get $4 - i32.eqz - if - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - i32.const 1 - drop - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 513 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - end - else - local.get $0 - local.get $3 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $3 - call $~lib/rt/tlsf/searchBlock - local.set $4 - i32.const 1 - drop - local.get $4 - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 518 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - end - end - i32.const 1 - drop - local.get $4 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $3 - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 521 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 0 - i32.store offset=4 - local.get $4 - local.get $2 - i32.store offset=8 - local.get $4 - local.get $1 - i32.store offset=12 - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $0 - local.get $4 - local.get $3 - call $~lib/rt/tlsf/prepareBlock - i32.const 1 - drop - local.get $4 - call $~lib/rt/rtrace/onalloc - local.get $4 - ) - (func $~lib/rt/tlsf/__alloc (param $0 i32) (param $1 i32) (result i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - local.get $1 - call $~lib/rt/tlsf/allocateBlock - i32.const 16 - i32.add - ) - (func $std/object-literal-unmanaged/test (param $0 i32) (result i32) - (local $1 i32) - i32.const 4 - i32.const 0 - call $~lib/rt/tlsf/__alloc - local.set $1 - local.get $1 - local.get $0 - i32.store - local.get $1 - global.set $std/object-literal-unmanaged/foo - global.get $std/object-literal-unmanaged/foo - i32.load - ) - (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 16 - i32.sub - local.set $1 - local.get $0 - i32.const 0 - i32.ne - if (result i32) - local.get $0 - i32.const 15 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $1 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - if (result i32) - local.get $1 - i32.load offset=4 - i32.const 268435455 - i32.const -1 - i32.xor - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 32 - i32.const 581 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $1 - i32.load - local.set $2 - local.get $1 - local.get $2 - i32.const 1 - i32.or - i32.store - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - i32.const 1 - drop - local.get $1 - call $~lib/rt/rtrace/onfree - ) - (func $~lib/rt/tlsf/__free (param $0 i32) - call $~lib/rt/tlsf/maybeInitialize - local.get $0 - call $~lib/rt/tlsf/checkUsedBlock - call $~lib/rt/tlsf/freeBlock - ) - (func $start:std/object-literal-unmanaged - i32.const 123 - call $std/object-literal-unmanaged/test - i32.const 123 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 144 - i32.const 13 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $std/object-literal-unmanaged/foo - call $~lib/rt/tlsf/__free - ) - (func $~start - call $start:std/object-literal-unmanaged - ) - (func $~lib/rt/pure/__collect - i32.const 1 - drop - return - ) -)