From 8aa0114fedb8fcf8828c0f7ba92785fb285627f1 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Fri, 28 May 2021 23:54:34 -0400 Subject: [PATCH 01/19] feat: add NonNullable builtin type to remove null from T --- src/common.ts | 1 + src/program.ts | 6 + src/resolver.ts | 111 +- std/assembly/index.d.ts | 2 + tests/compiler/ReturnType.untouched.wat | 1 - tests/compiler/abi.untouched.wat | 1 - tests/compiler/asc-constants.untouched.wat | 1 - tests/compiler/assert-nonnull.untouched.wat | 3 +- tests/compiler/assert.untouched.wat | 1 - tests/compiler/binary.untouched.wat | 5 +- tests/compiler/bool.untouched.wat | 1 - tests/compiler/builtins.optimized.wat | 26 +- tests/compiler/builtins.untouched.wat | 2 +- tests/compiler/call-inferred.untouched.wat | 3 +- tests/compiler/call-optional.optimized.wat | 2 +- tests/compiler/call-super.optimized.wat | 11 +- tests/compiler/call-super.untouched.wat | 3 +- tests/compiler/class-extends.optimized.wat | 2 +- tests/compiler/class-extends.untouched.wat | 5 +- tests/compiler/class-implements.optimized.wat | 11 +- tests/compiler/class-implements.untouched.wat | 3 +- .../compiler/class-overloading.optimized.wat | 37 +- .../compiler/class-overloading.untouched.wat | 3 +- .../class-static-function.optimized.wat | 2 +- .../class-static-function.untouched.wat | 2 +- tests/compiler/class.optimized.wat | 11 +- tests/compiler/class.untouched.wat | 5 +- tests/compiler/comma.optimized.wat | 2 +- tests/compiler/comma.untouched.wat | 1 - tests/compiler/const-folding.untouched.wat | 1 - tests/compiler/constructor.optimized.wat | 11 +- tests/compiler/constructor.untouched.wat | 3 +- tests/compiler/continue.untouched.wat | 1 - tests/compiler/converge.untouched.wat | 1 - tests/compiler/declare.untouched.wat | 1 - tests/compiler/do.optimized.wat | 11 +- tests/compiler/do.untouched.wat | 3 +- .../empty-exportruntime.optimized.wat | 11 +- .../empty-exportruntime.untouched.wat | 3 +- tests/compiler/empty-new.optimized.wat | 11 +- tests/compiler/empty-new.untouched.wat | 3 +- tests/compiler/empty.untouched.wat | 1 - tests/compiler/enum.untouched.wat | 1 - tests/compiler/export-default.untouched.wat | 1 - tests/compiler/export.untouched.wat | 1 - .../compiler/exportimport-table.optimized.wat | 2 +- .../compiler/exportimport-table.untouched.wat | 2 +- tests/compiler/exports-lazy.untouched.wat | 1 - tests/compiler/exports.optimized.wat | 11 +- tests/compiler/exports.untouched.wat | 3 +- .../exportstar-rereexport.optimized.wat | 13 +- .../exportstar-rereexport.untouched.wat | 3 +- tests/compiler/exportstar.untouched.wat | 1 - .../extends-baseaggregate.optimized.wat | 20 +- .../extends-baseaggregate.untouched.wat | 3 +- .../compiler/extends-recursive.optimized.wat | 11 +- .../compiler/extends-recursive.untouched.wat | 5 +- tests/compiler/external.untouched.wat | 1 - .../field-initialization.optimized.wat | 37 +- .../field-initialization.untouched.wat | 3 +- tests/compiler/for.optimized.wat | 11 +- tests/compiler/for.untouched.wat | 1 - tests/compiler/function-call.optimized.wat | 13 +- tests/compiler/function-types.optimized.wat | 2 +- tests/compiler/function-types.untouched.wat | 2 +- tests/compiler/getter-call.optimized.wat | 11 +- tests/compiler/getter-setter.optimized.wat | 2 +- tests/compiler/getter-setter.untouched.wat | 5 +- tests/compiler/heap.optimized.wat | 13 +- tests/compiler/heap.untouched.wat | 3 +- tests/compiler/if.untouched.wat | 1 - .../implicit-getter-setter.optimized.wat | 11 +- .../implicit-getter-setter.untouched.wat | 5 +- tests/compiler/import.untouched.wat | 1 - tests/compiler/indexof-valueof.untouched.wat | 1 - tests/compiler/infer-array.optimized.wat | 20 +- tests/compiler/infer-array.untouched.wat | 5 +- tests/compiler/infer-generic.optimized.wat | 13 +- tests/compiler/infer-generic.untouched.wat | 4 +- tests/compiler/infer-type.untouched.wat | 1 - .../inlining-blocklocals.optimized.wat | 2 +- .../inlining-blocklocals.untouched.wat | 1 - .../compiler/inlining-recursive.untouched.wat | 1 - tests/compiler/inlining.optimized.wat | 15 +- tests/compiler/instanceof-class.optimized.wat | 11 +- tests/compiler/instanceof-class.untouched.wat | 3 +- tests/compiler/instanceof.optimized.wat | 2 +- tests/compiler/instanceof.untouched.wat | 1 - tests/compiler/issues/1095.optimized.wat | 11 +- tests/compiler/issues/1095.untouched.wat | 3 +- tests/compiler/issues/1225.optimized.wat | 11 +- tests/compiler/issues/1225.untouched.wat | 1 - tests/compiler/issues/1699.optimized.wat | 20 +- tests/compiler/issues/1699.untouched.wat | 3 +- tests/compiler/issues/1714.untouched.wat | 1 - tests/compiler/issues/1751.untouched.wat | 1 - tests/compiler/limits.untouched.wat | 1 - tests/compiler/literals.untouched.wat | 1 - tests/compiler/logical.optimized.wat | 11 +- tests/compiler/logical.untouched.wat | 3 +- tests/compiler/loop-flow.optimized.wat | 2 +- tests/compiler/loop-flow.untouched.wat | 1 - tests/compiler/loop-wrap.untouched.wat | 1 - tests/compiler/managed-cast.optimized.wat | 11 +- tests/compiler/managed-cast.untouched.wat | 5 +- tests/compiler/many-locals.untouched.wat | 3 +- tests/compiler/memcpy.optimized.wat | 4 +- tests/compiler/memcpy.untouched.wat | 3 +- tests/compiler/memmove.optimized.wat | 4 +- tests/compiler/memmove.untouched.wat | 3 +- tests/compiler/memory.untouched.wat | 1 - tests/compiler/memorybase.untouched.wat | 1 - tests/compiler/memset.optimized.wat | 2 +- tests/compiler/memset.untouched.wat | 3 +- tests/compiler/merge.untouched.wat | 1 - .../named-export-default.untouched.wat | 1 - .../named-import-default.untouched.wat | 1 - tests/compiler/namespace.untouched.wat | 3 +- tests/compiler/new.optimized.wat | 11 +- tests/compiler/new.untouched.wat | 3 +- tests/compiler/nonnullable.json | 4 + tests/compiler/nonnullable.optimized.wat | 1714 ++++++++++ tests/compiler/nonnullable.ts | 31 + tests/compiler/nonnullable.untouched.wat | 2776 +++++++++++++++++ tests/compiler/number.optimized.wat | 35 +- tests/compiler/number.untouched.wat | 7 +- tests/compiler/object-literal.optimized.wat | 37 +- tests/compiler/object-literal.untouched.wat | 7 +- .../optional-typeparameters.optimized.wat | 11 +- .../optional-typeparameters.untouched.wat | 1 - tests/compiler/overflow.untouched.wat | 1 - .../portable-conversions.untouched.wat | 1 - tests/compiler/possibly-null.untouched.wat | 5 +- tests/compiler/recursive.untouched.wat | 1 - tests/compiler/reexport.optimized.wat | 11 +- tests/compiler/reexport.untouched.wat | 1 - tests/compiler/rereexport.optimized.wat | 13 +- tests/compiler/rereexport.untouched.wat | 3 +- tests/compiler/resolve-access.optimized.wat | 9 +- tests/compiler/resolve-access.untouched.wat | 9 +- tests/compiler/resolve-binary.optimized.wat | 39 +- tests/compiler/resolve-binary.untouched.wat | 11 +- .../resolve-elementaccess.optimized.wat | 47 +- .../resolve-elementaccess.untouched.wat | 15 +- .../resolve-function-expression.optimized.wat | 18 +- .../resolve-function-expression.untouched.wat | 6 +- tests/compiler/resolve-nested.optimized.wat | 13 +- tests/compiler/resolve-nested.untouched.wat | 5 +- tests/compiler/resolve-new.optimized.wat | 11 +- tests/compiler/resolve-new.untouched.wat | 3 +- .../resolve-propertyaccess.optimized.wat | 37 +- .../resolve-propertyaccess.untouched.wat | 5 +- tests/compiler/resolve-ternary.optimized.wat | 35 +- tests/compiler/resolve-ternary.untouched.wat | 8 +- tests/compiler/resolve-unary.optimized.wat | 37 +- tests/compiler/resolve-unary.untouched.wat | 7 +- tests/compiler/retain-i32.untouched.wat | 3 +- tests/compiler/rt/finalize.optimized.wat | 11 +- tests/compiler/rt/finalize.untouched.wat | 3 +- tests/compiler/rt/ids.untouched.wat | 1 - tests/compiler/rt/instanceof.optimized.wat | 11 +- tests/compiler/rt/instanceof.untouched.wat | 3 +- .../runtime-incremental-export.optimized.wat | 11 +- .../runtime-incremental-export.untouched.wat | 3 +- .../rt/runtime-incremental.untouched.wat | 1 - .../rt/runtime-minimal-export.optimized.wat | 11 +- .../rt/runtime-minimal-export.untouched.wat | 1 - .../compiler/rt/runtime-minimal.untouched.wat | 1 - .../rt/runtime-stub-export.optimized.wat | 4 +- .../rt/runtime-stub-export.untouched.wat | 3 +- tests/compiler/rt/runtime-stub.untouched.wat | 1 - tests/compiler/scoped.untouched.wat | 1 - tests/compiler/static-this.untouched.wat | 3 +- tests/compiler/std/array-access.optimized.wat | 4 +- tests/compiler/std/array-access.untouched.wat | 5 +- .../compiler/std/array-literal.optimized.wat | 22 +- .../compiler/std/array-literal.untouched.wat | 1 - tests/compiler/std/array.optimized.wat | 86 +- tests/compiler/std/array.untouched.wat | 20 +- tests/compiler/std/arraybuffer.optimized.wat | 9 +- tests/compiler/std/arraybuffer.untouched.wat | 3 +- tests/compiler/std/dataview.optimized.wat | 15 +- tests/compiler/std/dataview.untouched.wat | 11 +- tests/compiler/std/date.optimized.wat | 57 +- tests/compiler/std/date.untouched.wat | 15 +- tests/compiler/std/hash.optimized.wat | 2 +- tests/compiler/std/hash.untouched.wat | 3 +- tests/compiler/std/map.optimized.wat | 19 +- tests/compiler/std/map.untouched.wat | 21 +- tests/compiler/std/math.optimized.wat | 29 +- tests/compiler/std/math.untouched.wat | 29 +- tests/compiler/std/mod.optimized.wat | 4 +- tests/compiler/std/mod.untouched.wat | 9 +- tests/compiler/std/new.optimized.wat | 11 +- tests/compiler/std/new.untouched.wat | 5 +- tests/compiler/std/object.optimized.wat | 28 +- tests/compiler/std/object.untouched.wat | 5 +- .../std/operator-overloading.optimized.wat | 25 +- .../std/operator-overloading.untouched.wat | 1 - tests/compiler/std/pointer.optimized.wat | 2 +- tests/compiler/std/pointer.untouched.wat | 3 +- tests/compiler/std/polyfills.untouched.wat | 3 +- tests/compiler/std/set.optimized.wat | 17 +- tests/compiler/std/set.untouched.wat | 15 +- tests/compiler/std/simd.untouched.wat | 1 - tests/compiler/std/static-array.optimized.wat | 11 +- tests/compiler/std/static-array.untouched.wat | 5 +- tests/compiler/std/staticarray.optimized.wat | 64 +- tests/compiler/std/staticarray.untouched.wat | 5 +- .../std/string-casemapping.optimized.wat | 37 +- .../std/string-casemapping.untouched.wat | 9 +- .../std/string-encoding.optimized.wat | 35 +- .../std/string-encoding.untouched.wat | 3 +- tests/compiler/std/string.optimized.wat | 160 +- tests/compiler/std/string.untouched.wat | 15 +- tests/compiler/std/symbol.optimized.wat | 46 +- tests/compiler/std/symbol.untouched.wat | 3 +- tests/compiler/std/trace.optimized.wat | 2 +- tests/compiler/std/trace.untouched.wat | 3 +- tests/compiler/std/typedarray.optimized.wat | 397 +-- tests/compiler/std/typedarray.untouched.wat | 40 +- tests/compiler/std/uri.optimized.wat | 135 +- tests/compiler/std/uri.untouched.wat | 3 +- tests/compiler/super-inline.optimized.wat | 11 +- tests/compiler/super-inline.untouched.wat | 3 +- tests/compiler/switch.untouched.wat | 1 - tests/compiler/tablebase.optimized.wat | 2 +- tests/compiler/tablebase.untouched.wat | 2 +- tests/compiler/templateliteral.optimized.wat | 39 +- tests/compiler/templateliteral.untouched.wat | 9 +- tests/compiler/ternary.untouched.wat | 1 - tests/compiler/throw.optimized.wat | 9 +- tests/compiler/throw.untouched.wat | 5 +- tests/compiler/typealias.untouched.wat | 1 - tests/compiler/typeof.optimized.wat | 39 +- tests/compiler/typeof.untouched.wat | 4 +- tests/compiler/unary.untouched.wat | 1 - .../compiler/unify-local-flags.untouched.wat | 1 - tests/compiler/void.untouched.wat | 1 - tests/compiler/wasi/abort.optimized.wat | 2 +- tests/compiler/wasi/abort.untouched.wat | 3 +- tests/compiler/wasi/seed.optimized.wat | 2 +- tests/compiler/wasi/seed.untouched.wat | 11 +- .../wasi/snapshot_preview1.untouched.wat | 1 - tests/compiler/wasi/trace.optimized.wat | 17 +- tests/compiler/wasi/trace.untouched.wat | 5 +- tests/compiler/while.optimized.wat | 11 +- tests/compiler/while.untouched.wat | 3 +- 248 files changed, 6048 insertions(+), 1371 deletions(-) create mode 100644 tests/compiler/nonnullable.json create mode 100644 tests/compiler/nonnullable.optimized.wat create mode 100644 tests/compiler/nonnullable.ts create mode 100644 tests/compiler/nonnullable.untouched.wat diff --git a/src/common.ts b/src/common.ts index 2f7445a4e2..99b30402bc 100644 --- a/src/common.ts +++ b/src/common.ts @@ -147,6 +147,7 @@ export namespace CommonNames { export const indexof = "indexof"; export const valueof = "valueof"; export const returnof = "returnof"; + export const notnullable = "NonNullable" // aliases export const null_ = "null"; export const true_ = "true"; diff --git a/src/program.ts b/src/program.ts index 319624095a..72ac30390b 100644 --- a/src/program.ts +++ b/src/program.ts @@ -992,6 +992,12 @@ export class Program extends DiagnosticEmitter { this.makeNativeTypeDeclaration(CommonNames.returnof, CommonFlags.EXPORT | CommonFlags.GENERIC), DecoratorFlags.BUILTIN )); + this.nativeFile.add(CommonNames.notnullable, new TypeDefinition( + CommonNames.notnullable, + this.nativeFile, + this.makeNativeTypeDeclaration(CommonNames.notnullable, CommonFlags.EXPORT | CommonFlags.GENERIC), + DecoratorFlags.BUILTIN + )); // The following types might not be enabled by compiler options, so the // compiler needs to check this condition whenever such a value is created diff --git a/src/resolver.ts b/src/resolver.ts index 0cbc34d00f..bdc335b4e9 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -296,6 +296,7 @@ export class Resolver extends DiagnosticEmitter { if (text == CommonNames.indexof) return this.resolveBuiltinIndexofType(node, ctxElement, ctxTypes, reportMode); if (text == CommonNames.valueof) return this.resolveBuiltinValueofType(node, ctxElement, ctxTypes, reportMode); if (text == CommonNames.returnof) return this.resolveBuiltinReturnTypeType(node, ctxElement, ctxTypes, reportMode); + if (text == CommonNames.notnullable) return this.resolveBuiltinNotNullableType(node, ctxElement, ctxTypes, reportMode); } // Resolve normally @@ -438,19 +439,9 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - var typeArgumentNodes = node.typeArguments; - if (!typeArgumentNodes || typeArgumentNodes.length != 1) { - if (reportMode == ReportMode.REPORT) { - let numTypeArguments = 0; - if (typeArgumentNodes) numTypeArguments = typeArgumentNodes.length; - this.error( - DiagnosticCode.Expected_0_type_arguments_but_got_1, - node.range, "1", numTypeArguments.toString() - ); - } - return null; - } - var typeArgument = this.resolveType(typeArgumentNodes[0], ctxElement, ctxTypes, reportMode); + const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + if (!typeArgumentNode) return null; + var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; switch (typeArgument.kind) { case TypeKind.I8: @@ -483,26 +474,16 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - var typeArgumentNodes = node.typeArguments; - if (!typeArgumentNodes || typeArgumentNodes.length != 1) { - if (reportMode == ReportMode.REPORT) { - let numTypeArguments = 0; - if (typeArgumentNodes) numTypeArguments = typeArgumentNodes.length; - this.error( - DiagnosticCode.Expected_0_type_arguments_but_got_1, - node.range, "1", numTypeArguments.toString() - ); - } - return null; - } - var typeArgument = this.resolveType(typeArgumentNodes[0], ctxElement, ctxTypes, reportMode); + const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + if (!typeArgumentNode) return null; + var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; var classReference = typeArgument.classReference; if (!classReference) { if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Index_signature_is_missing_in_type_0, - typeArgumentNodes[0].range, typeArgument.toString() + typeArgumentNode.range, typeArgument.toString() ); } return null; @@ -520,7 +501,7 @@ export class Resolver extends DiagnosticEmitter { if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Index_signature_is_missing_in_type_0, - typeArgumentNodes[0].range, typeArgument.toString() + typeArgumentNode.range, typeArgument.toString() ); } return null; @@ -536,19 +517,9 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - var typeArgumentNodes = node.typeArguments; - if (!typeArgumentNodes || typeArgumentNodes.length != 1) { - let numTypeArguments = 0; - if (typeArgumentNodes) numTypeArguments = typeArgumentNodes.length; - if (reportMode == ReportMode.REPORT) { - this.error( - DiagnosticCode.Expected_0_type_arguments_but_got_1, - node.range, "1", numTypeArguments.toString() - ); - } - return null; - } - var typeArgument = this.resolveType(typeArgumentNodes[0], ctxElement, ctxTypes, reportMode); + const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + if (!typeArgumentNode) return null; + var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; var classReference = typeArgument.getClassOrWrapper(this.program); if (classReference) { @@ -558,7 +529,7 @@ export class Resolver extends DiagnosticEmitter { if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Index_signature_is_missing_in_type_0, - typeArgumentNodes[0].range, typeArgument.toString() + typeArgumentNode.range, typeArgument.toString() ); } return null; @@ -574,31 +545,39 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventualy diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - var typeArgumentNodes = node.typeArguments; - if (!typeArgumentNodes || typeArgumentNodes.length != 1) { - if (reportMode == ReportMode.REPORT) { - let numTypeArguments = 0; - if (typeArgumentNodes) numTypeArguments = typeArgumentNodes.length; - this.error( - DiagnosticCode.Expected_0_type_arguments_but_got_1, - node.range, "1", numTypeArguments.toString() - ); - } - return null; - } - var typeArgument = this.resolveType(typeArgumentNodes[0], ctxElement, ctxTypes, reportMode); + const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + if (!typeArgumentNode) return null; + var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; var signatureReference = typeArgument.getSignature(); if (signatureReference) return signatureReference.returnType; if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Type_0_has_no_call_signatures, - typeArgumentNodes[0].range, typeArgument.toString() + typeArgumentNode.range, typeArgument.toString() ); } return null; } + private resolveBuiltinNotNullableType( + /** The type to resolve. */ + node: NamedTypeNode, + /** Contextual element. */ + ctxElement: Element, + /** Contextual types, i.e. `T`. */ + ctxTypes: Map | null = null, + /** How to proceed with eventual diagnostics. */ + reportMode: ReportMode = ReportMode.REPORT + ): Type | null { + const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + if (!typeArgumentNode) return null; + var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); + if (!typeArgument) return null; + if (!typeArgument.isNullableReference) return typeArgument; + return typeArgument.nonNullableType; + } + /** Resolves a type name to the program element it refers to. */ resolveTypeName( /** The type name to resolve. */ @@ -3362,4 +3341,24 @@ export class Resolver extends DiagnosticEmitter { } return instance; } + + private assertOneTypeArgument( + /** The type to resolve. */ + node: NamedTypeNode, + /** How to proceed with eventual diagnostics. */ + reportMode: ReportMode = ReportMode.REPORT): TypeNode | null { + var typeArgumentNodes = node.typeArguments; + if (!typeArgumentNodes || typeArgumentNodes.length != 1) { + let numTypeArguments = 0; + if (typeArgumentNodes) numTypeArguments = typeArgumentNodes.length; + if (reportMode == ReportMode.REPORT) { + this.error( + DiagnosticCode.Expected_0_type_arguments_but_got_1, + node.range, "1", numTypeArguments.toString() + ); + } + return null; + } + return typeArgumentNodes[0]; + } } diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 73495ffac5..8286f10ee6 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1314,6 +1314,8 @@ declare type valueof = T[0]; declare type ReturnType any> = T extends (...args: any) => infer R ? R : any; /** A special type evaluated to the return type of T if T is a callable function. */ declare type returnof any> = ReturnType; +/** A special type that excludes null and undefined from T. */ +declare type NonNullable = T extends null | undefined ? never : T; /** Pseudo-class representing the backing class of integer types. */ declare class _Integer { diff --git a/tests/compiler/ReturnType.untouched.wat b/tests/compiler/ReturnType.untouched.wat index 2b4b16b344..7295676a6a 100644 --- a/tests/compiler/ReturnType.untouched.wat +++ b/tests/compiler/ReturnType.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:ReturnType diff --git a/tests/compiler/abi.untouched.wat b/tests/compiler/abi.untouched.wat index 06e2ca21e8..9319c08c04 100644 --- a/tests/compiler/abi.untouched.wat +++ b/tests/compiler/abi.untouched.wat @@ -11,7 +11,6 @@ (memory $0 1) (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "exported" (func $abi/exported)) (export "exportedExported" (func $abi/exportedExported)) (export "exportedInternal" (func $abi/exportedInternal)) diff --git a/tests/compiler/asc-constants.untouched.wat b/tests/compiler/asc-constants.untouched.wat index 0fc4903e56..564d8f86e9 100644 --- a/tests/compiler/asc-constants.untouched.wat +++ b/tests/compiler/asc-constants.untouched.wat @@ -22,7 +22,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:asc-constants diff --git a/tests/compiler/assert-nonnull.untouched.wat b/tests/compiler/assert-nonnull.untouched.wat index 1f7d895881..b36eed7921 100644 --- a/tests/compiler/assert-nonnull.untouched.wat +++ b/tests/compiler/assert-nonnull.untouched.wat @@ -2,8 +2,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result 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_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 380)) @@ -16,7 +16,6 @@ (data (i32.const 204) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 252) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "testVar" (func $export:assert-nonnull/testVar)) (export "testObj" (func $export:assert-nonnull/testObj)) diff --git a/tests/compiler/assert.untouched.wat b/tests/compiler/assert.untouched.wat index ed6a12d7d9..e3cc57ce06 100644 --- a/tests/compiler/assert.untouched.wat +++ b/tests/compiler/assert.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:assert diff --git a/tests/compiler/binary.untouched.wat b/tests/compiler/binary.untouched.wat index ae76893ff6..a04f652302 100644 --- a/tests/compiler/binary.untouched.wat +++ b/tests/compiler/binary.untouched.wat @@ -1,7 +1,7 @@ (module - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $none_=>_none (func)) + (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (global $binary/b (mut i32) (i32.const 0)) (global $binary/i (mut i32) (i32.const 0)) @@ -19,7 +19,6 @@ (data (i32.const 6152) "\be\f3\f8y\eca\f6?\190\96[\c6\fe\de\bf=\88\afJ\edq\f5?\a4\fc\d42h\0b\db\bf\b0\10\f0\f09\95\f4?{\b7\1f\n\8bA\d7\bf\85\03\b8\b0\95\c9\f3?{\cfm\1a\e9\9d\d3\bf\a5d\88\0c\19\0d\f3?1\b6\f2\f3\9b\1d\d0\bf\a0\8e\0b{\"^\f2?\f0z;\1b\1d|\c9\bf?4\1aJJ\bb\f1?\9f<\af\93\e3\f9\c2\bf\ba\e5\8a\f0X#\f1?\\\8dx\bf\cb`\b9\bf\a7\00\99A?\95\f0?\ce_G\b6\9do\aa\bf\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\acG\9a\fd\8c`\ee?=\f5$\9f\ca8\b3?\a0j\02\1f\b3\a4\ec?\ba\918T\a9v\c4?\e6\fcjW6 \eb?\d2\e4\c4J\0b\84\ce?-\aa\a1c\d1\c2\e9?\1ce\c6\f0E\06\d4?\edAx\03\e6\86\e8?\f8\9f\1b,\9c\8e\d8?bHS\f5\dcg\e7?\cc{\b1N\a4\e0\dc?") (data (i32.const 6408) "\00\00\00\00\00\00\f0?t\85\15\d3\b0\d9\ef?\0f\89\f9lX\b5\ef?Q[\12\d0\01\93\ef?{Q}<\b8r\ef?\aa\b9h1\87T\ef?8bunz8\ef?\e1\de\1f\f5\9d\1e\ef?\15\b71\n\fe\06\ef?\cb\a9:7\a7\f1\ee?\"4\12L\a6\de\ee?-\89a`\08\ce\ee?\'*6\d5\da\bf\ee?\82O\9dV+\b4\ee?)TH\dd\07\ab\ee?\85U:\b0~\a4\ee?\cd;\7ff\9e\a0\ee?t_\ec\e8u\9f\ee?\87\01\ebs\14\a1\ee?\13\ceL\99\89\a5\ee?\db\a0*B\e5\ac\ee?\e5\c5\cd\b07\b7\ee?\90\f0\a3\82\91\c4\ee?]%>\b2\03\d5\ee?\ad\d3Z\99\9f\e8\ee?G^\fb\f2v\ff\ee?\9cR\85\dd\9b\19\ef?i\90\ef\dc 7\ef?\87\a4\fb\dc\18X\ef?_\9b{3\97|\ef?\da\90\a4\a2\af\a4\ef?@En[v\d0\ef?") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/math/ipow32 (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/bool.untouched.wat b/tests/compiler/bool.untouched.wat index 686fff0312..83b137716c 100644 --- a/tests/compiler/bool.untouched.wat +++ b/tests/compiler/bool.untouched.wat @@ -47,7 +47,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:bool diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index dfee42b84d..f96d75edbb 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -87,10 +87,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -118,20 +118,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/builtins.untouched.wat b/tests/compiler/builtins.untouched.wat index 80f25dedf6..1cef95840e 100644 --- a/tests/compiler/builtins.untouched.wat +++ b/tests/compiler/builtins.untouched.wat @@ -4,8 +4,8 @@ (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 $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (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 "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (global $builtins/b (mut i32) (i32.const 0)) diff --git a/tests/compiler/call-inferred.untouched.wat b/tests/compiler/call-inferred.untouched.wat index 11ec525b28..c1e3dcf85a 100644 --- a/tests/compiler/call-inferred.untouched.wat +++ b/tests/compiler/call-inferred.untouched.wat @@ -1,8 +1,8 @@ (module (type $f32_=>_f32 (func (param f32) (result f32))) (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $f64_=>_f64 (func (param f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) @@ -12,7 +12,6 @@ (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $call-inferred/foo (param $0 i32) (result i32) diff --git a/tests/compiler/call-optional.optimized.wat b/tests/compiler/call-optional.optimized.wat index 4100d95a9b..c28e69c90f 100644 --- a/tests/compiler/call-optional.optimized.wat +++ b/tests/compiler/call-optional.optimized.wat @@ -1,7 +1,7 @@ (module (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_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/call-super.optimized.wat b/tests/compiler/call-super.optimized.wat index 2b5b8c0141..55c879f1dc 100644 --- a/tests/compiler/call-super.optimized.wat +++ b/tests/compiler/call-super.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param 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 $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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,17 +1044,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/call-super.untouched.wat b/tests/compiler/call-super.untouched.wat index 8a4cce9c44..6befd92c6d 100644 --- a/tests/compiler/call-super.untouched.wat +++ b/tests/compiler/call-super.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -37,7 +37,6 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\0d\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\04\00\00\00 \00\00\00\00\00\00\00 \00\00\00\06\00\00\00 \00\00\00\00\00\00\00 \00\00\00\08\00\00\00 \00\00\00\00\00\00\00 \00\00\00\n\00\00\00 \00\00\00\00\00\00\00 \00\00\00\0c\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/class-extends.optimized.wat b/tests/compiler/class-extends.optimized.wat index c847b7d897..e8ebfd1dce 100644 --- a/tests/compiler/class-extends.optimized.wat +++ b/tests/compiler/class-extends.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17408)) (memory $0 0) diff --git a/tests/compiler/class-extends.untouched.wat b/tests/compiler/class-extends.untouched.wat index 7aaa540a05..1a712a8ccf 100644 --- a/tests/compiler/class-extends.untouched.wat +++ b/tests/compiler/class-extends.untouched.wat @@ -1,15 +1,14 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 8)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16392)) (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "test" (func $export:class-extends/test)) (func $class-extends/A#set:a (param $0 i32) (param $1 i32) diff --git a/tests/compiler/class-implements.optimized.wat b/tests/compiler/class-implements.optimized.wat index c985274597..6d035d1178 100644 --- a/tests/compiler/class-implements.optimized.wat +++ b/tests/compiler/class-implements.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1066,17 +1066,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/class-implements.untouched.wat b/tests/compiler/class-implements.untouched.wat index b2fd1e69c1..c800f325e9 100644 --- a/tests/compiler/class-implements.untouched.wat +++ b/tests/compiler/class-implements.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -41,7 +41,6 @@ (data (i32.const 412) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00c\00l\00a\00s\00s\00-\00i\00m\00p\00l\00e\00m\00e\00n\00t\00s\00.\00t\00s\00\00\00\00\00\00\00") (data (i32.const 480) "\07\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\00 \00\00\00\06\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "A" (global $class-implements/A)) (export "C" (global $class-implements/C)) (export "memory" (memory $0)) diff --git a/tests/compiler/class-overloading.optimized.wat b/tests/compiler/class-overloading.optimized.wat index cebc44fb43..c9ca5a0717 100644 --- a/tests/compiler/class-overloading.optimized.wat +++ b/tests/compiler/class-overloading.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1104,17 +1104,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1424 @@ -1458,10 +1461,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -1489,20 +1492,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/class-overloading.untouched.wat b/tests/compiler/class-overloading.untouched.wat index 7030572e97..d9b04b79c2 100644 --- a/tests/compiler/class-overloading.untouched.wat +++ b/tests/compiler/class-overloading.untouched.wat @@ -6,8 +6,8 @@ (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (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))) (global $class-overloading/which (mut i32) (i32.const 32)) @@ -53,7 +53,6 @@ (data (i32.const 700) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00n\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 768) "\11\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\03\00\00\00 \00\00\00\04\00\00\00 \00\00\00\04\00\00\00 \00\00\00\06\00\00\00 \00\00\00\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\t\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\0d\00\00\00 \00\00\00\10\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/class-static-function.optimized.wat b/tests/compiler/class-static-function.optimized.wat index 3f47129a82..bfcc86d19a 100644 --- a/tests/compiler/class-static-function.optimized.wat +++ b/tests/compiler/class-static-function.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17532)) (memory $0 1) diff --git a/tests/compiler/class-static-function.untouched.wat b/tests/compiler/class-static-function.untouched.wat index 1801c0100c..a3e990ebad 100644 --- a/tests/compiler/class-static-function.untouched.wat +++ b/tests/compiler/class-static-function.untouched.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 124)) diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index bc0b236d29..d4490db749 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1056,17 +1056,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/class.untouched.wat b/tests/compiler/class.untouched.wat index ac65a7b27a..2e5c230a4d 100644 --- a/tests/compiler/class.untouched.wat +++ b/tests/compiler/class.untouched.wat @@ -6,10 +6,10 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) - (type $i32_f32_f32_=>_f32 (func (param i32 f32 f32) (result f32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_f32_f32_=>_f32 (func (param i32 f32 f32) (result f32))) + (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $class/Animal.ONE (mut i32) (i32.const 1)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -41,7 +41,6 @@ (data (i32.const 460) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 512) "\06\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\00\00\02\t\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "testGenericInitializer" (func $class/testGenericInitializer)) (export "memory" (memory $0)) (export "test" (func $export:class/test)) diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index 29a41112be..7771df73a2 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $comma/a (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0)) diff --git a/tests/compiler/comma.untouched.wat b/tests/compiler/comma.untouched.wat index df51ba253e..0d51475231 100644 --- a/tests/compiler/comma.untouched.wat +++ b/tests/compiler/comma.untouched.wat @@ -10,7 +10,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:comma diff --git a/tests/compiler/const-folding.untouched.wat b/tests/compiler/const-folding.untouched.wat index 7c4b547684..08bab6bef5 100644 --- a/tests/compiler/const-folding.untouched.wat +++ b/tests/compiler/const-folding.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "test" (func $const-folding/test)) (export "memory" (memory $0)) (func $const-folding/test (param $0 i64) (result i64) diff --git a/tests/compiler/constructor.optimized.wat b/tests/compiler/constructor.optimized.wat index 8aa24f1c6f..3253af0ec9 100644 --- a/tests/compiler/constructor.optimized.wat +++ b/tests/compiler/constructor.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param 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 $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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1112,17 +1112,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/constructor.untouched.wat b/tests/compiler/constructor.untouched.wat index b5949afb5d..789c4e77c3 100644 --- a/tests/compiler/constructor.untouched.wat +++ b/tests/compiler/constructor.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -47,7 +47,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\0d\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\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\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/continue.untouched.wat b/tests/compiler/continue.untouched.wat index 30208a4fa3..d761e26421 100644 --- a/tests/compiler/continue.untouched.wat +++ b/tests/compiler/continue.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "testInherit" (func $continue/testInherit)) (export "memory" (memory $0)) (func $continue/testInherit (param $0 i32) diff --git a/tests/compiler/converge.untouched.wat b/tests/compiler/converge.untouched.wat index ef7546254f..edbd3984ae 100644 --- a/tests/compiler/converge.untouched.wat +++ b/tests/compiler/converge.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "test" (func $converge/test)) (export "memory" (memory $0)) (func $converge/test diff --git a/tests/compiler/declare.untouched.wat b/tests/compiler/declare.untouched.wat index e2944babc5..64ab9172a6 100644 --- a/tests/compiler/declare.untouched.wat +++ b/tests/compiler/declare.untouched.wat @@ -12,7 +12,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:declare diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 80996cf5c6..06c4fe0dd7 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,17 +1044,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index 8f777ea54e..c46b54bd39 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -38,7 +38,6 @@ (data (i32.const 380) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 448) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $do/testSimple diff --git a/tests/compiler/empty-exportruntime.optimized.wat b/tests/compiler/empty-exportruntime.optimized.wat index f6d53b32c4..7fa1457bb2 100644 --- a/tests/compiler/empty-exportruntime.optimized.wat +++ b/tests/compiler/empty-exportruntime.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param 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 $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 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1062,17 +1062,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/empty-exportruntime.untouched.wat b/tests/compiler/empty-exportruntime.untouched.wat index ab3b34728b..44b8e896a9 100644 --- a/tests/compiler/empty-exportruntime.untouched.wat +++ b/tests/compiler/empty-exportruntime.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,7 +38,6 @@ (data (i32.const 476) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00O\00b\00j\00e\00c\00t\00 \00i\00s\00 \00n\00o\00t\00 \00p\00i\00n\00n\00e\00d\00\00\00\00\00") (data (i32.const 544) "\03\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) - (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/itcms/__new)) (export "__pin" (func $~lib/rt/itcms/__pin)) (export "__unpin" (func $~lib/rt/itcms/__unpin)) diff --git a/tests/compiler/empty-new.optimized.wat b/tests/compiler/empty-new.optimized.wat index f26e0b4178..6536231e50 100644 --- a/tests/compiler/empty-new.optimized.wat +++ b/tests/compiler/empty-new.optimized.wat @@ -2,8 +2,8 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1040,17 +1040,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/empty-new.untouched.wat b/tests/compiler/empty-new.untouched.wat index 01f6f1e0ac..1c448c7157 100644 --- a/tests/compiler/empty-new.untouched.wat +++ b/tests/compiler/empty-new.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -36,7 +36,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\03\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/empty.untouched.wat b/tests/compiler/empty.untouched.wat index f4d95ad56d..700fa1f9a6 100644 --- a/tests/compiler/empty.untouched.wat +++ b/tests/compiler/empty.untouched.wat @@ -4,6 +4,5 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/enum.untouched.wat b/tests/compiler/enum.untouched.wat index 5a2b7f189c..e829591565 100644 --- a/tests/compiler/enum.untouched.wat +++ b/tests/compiler/enum.untouched.wat @@ -37,7 +37,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "Implicit.ZERO" (global $enum/Implicit.ZERO)) (export "Implicit.ONE" (global $enum/Implicit.ONE)) (export "Implicit.TWO" (global $enum/Implicit.TWO)) diff --git a/tests/compiler/export-default.untouched.wat b/tests/compiler/export-default.untouched.wat index 649647c6a1..592f90a931 100644 --- a/tests/compiler/export-default.untouched.wat +++ b/tests/compiler/export-default.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "theDefault" (func $export-default/theDefault)) (export "default" (func $export-default/theDefault)) (export "memory" (memory $0)) diff --git a/tests/compiler/export.untouched.wat b/tests/compiler/export.untouched.wat index 75fdad29c7..938d6b7541 100644 --- a/tests/compiler/export.untouched.wat +++ b/tests/compiler/export.untouched.wat @@ -9,7 +9,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "add" (func $export/add)) (export "sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) diff --git a/tests/compiler/exportimport-table.optimized.wat b/tests/compiler/exportimport-table.optimized.wat index d2ea0fc1a9..fa1ffca691 100644 --- a/tests/compiler/exportimport-table.optimized.wat +++ b/tests/compiler/exportimport-table.optimized.wat @@ -1,10 +1,10 @@ (module (type $none_=>_none (func)) (import "env" "table" (table $0 2 funcref)) + (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (memory $0 1) (data (i32.const 1036) "\1c") (data (i32.const 1048) "\03\00\00\00\08\00\00\00\01") - (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (export "memory" (memory $0)) (export "table" (table $0)) (func $start:exportimport-table~anonymous|0 diff --git a/tests/compiler/exportimport-table.untouched.wat b/tests/compiler/exportimport-table.untouched.wat index 421b929e98..05ce6bc9db 100644 --- a/tests/compiler/exportimport-table.untouched.wat +++ b/tests/compiler/exportimport-table.untouched.wat @@ -1,13 +1,13 @@ (module (type $none_=>_none (func)) (import "env" "table" (table $0 2 funcref)) + (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (global $exportimport-table/f (mut i32) (i32.const 32)) (global $~lib/memory/__data_end i32 (i32.const 44)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16428)) (global $~lib/memory/__heap_base i32 (i32.const 16428)) (memory $0 1) (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\08\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") - (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (export "memory" (memory $0)) (export "table" (table $0)) (start $~start) diff --git a/tests/compiler/exports-lazy.untouched.wat b/tests/compiler/exports-lazy.untouched.wat index 4a986f6f5a..e00bcae142 100644 --- a/tests/compiler/exports-lazy.untouched.wat +++ b/tests/compiler/exports-lazy.untouched.wat @@ -8,7 +8,6 @@ (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") (data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\10\00\00\00 \00\00\00 \00\00\00\0c\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "lazyGlobalUsed" (global $exports-lazy/lazyGlobalUsed)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index 6be1e46aed..397867cc2a 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -5,8 +5,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $exports/Animal.CAT i32 (i32.const 0)) (global $exports/Animal.DOG i32 (i32.const 1)) @@ -1094,17 +1094,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index ba6f0c0360..2cbadeb9c2 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -4,8 +4,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) @@ -49,7 +49,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "add" (func $exports/add)) (export "subOpt" (func $exports/subOpt@varargs)) (export "math.sub" (func $exports/math.sub)) diff --git a/tests/compiler/exportstar-rereexport.optimized.wat b/tests/compiler/exportstar-rereexport.optimized.wat index d9c0ebacf3..76a21d3980 100644 --- a/tests/compiler/exportstar-rereexport.optimized.wat +++ b/tests/compiler/exportstar-rereexport.optimized.wat @@ -1,11 +1,11 @@ (module (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -1095,17 +1095,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/exportstar-rereexport.untouched.wat b/tests/compiler/exportstar-rereexport.untouched.wat index a5edbf7713..541d842408 100644 --- a/tests/compiler/exportstar-rereexport.untouched.wat +++ b/tests/compiler/exportstar-rereexport.untouched.wat @@ -6,8 +6,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -47,7 +47,6 @@ (data (i32.const 460) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00r\00e\00r\00e\00e\00x\00p\00o\00r\00t\00.\00t\00s\00\00\00") (data (i32.const 512) "\04\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) - (elem $0 (i32.const 1)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/compiler/exportstar.untouched.wat b/tests/compiler/exportstar.untouched.wat index 75fdad29c7..938d6b7541 100644 --- a/tests/compiler/exportstar.untouched.wat +++ b/tests/compiler/exportstar.untouched.wat @@ -9,7 +9,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "add" (func $export/add)) (export "sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index 7e02830631..88d503da3a 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -1062,17 +1062,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1552 @@ -1772,11 +1775,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index 89042890f3..40892c936a 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -7,8 +7,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_f64_=>_none (func (param i32 f64))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $extends-baseaggregate/poolB i32 (i32.const 64)) (global $extends-baseaggregate/poolA i32 (i32.const 144)) @@ -45,7 +45,6 @@ (data (i32.const 620) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 672) "\t\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\02A\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/extends-recursive.optimized.wat b/tests/compiler/extends-recursive.optimized.wat index b502ff0347..1c4bb9f84a 100644 --- a/tests/compiler/extends-recursive.optimized.wat +++ b/tests/compiler/extends-recursive.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1051,17 +1051,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/extends-recursive.untouched.wat b/tests/compiler/extends-recursive.untouched.wat index dabc4a9489..818f5cd865 100644 --- a/tests/compiler/extends-recursive.untouched.wat +++ b/tests/compiler/extends-recursive.untouched.wat @@ -2,12 +2,12 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 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_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -37,7 +37,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\04\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "Child" (global $extends-recursive/Child)) (export "memory" (memory $0)) (export "Child#get:child" (func $export:extends-recursive/Parent#get:child)) diff --git a/tests/compiler/external.untouched.wat b/tests/compiler/external.untouched.wat index 8931a5f95f..20a24519ae 100644 --- a/tests/compiler/external.untouched.wat +++ b/tests/compiler/external.untouched.wat @@ -10,7 +10,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "foo" (func $external/foo)) (export "foo.bar" (func $external/foo.bar)) (export "two" (func $external/two)) diff --git a/tests/compiler/field-initialization.optimized.wat b/tests/compiler/field-initialization.optimized.wat index 38af4021b4..eaf089fa02 100644 --- a/tests/compiler/field-initialization.optimized.wat +++ b/tests/compiler/field-initialization.optimized.wat @@ -5,8 +5,8 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1069,17 +1069,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 @@ -1807,10 +1810,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -1838,20 +1841,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/field-initialization.untouched.wat b/tests/compiler/field-initialization.untouched.wat index ccd54580ff..3ea7f9b150 100644 --- a/tests/compiler/field-initialization.untouched.wat +++ b/tests/compiler/field-initialization.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -45,7 +45,6 @@ (data (i32.const 732) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00c\00c\00\00\00\00\00\00\00\00\00") (data (i32.const 768) "\19\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\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\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\14\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index d34636526e..33bc640b24 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,17 +1044,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 2b0be62bd9..504a5402a2 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -38,7 +38,6 @@ (data (i32.const 380) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 448) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $for/testInitExpression diff --git a/tests/compiler/function-call.optimized.wat b/tests/compiler/function-call.optimized.wat index f1593b31c0..654b1295de 100644 --- a/tests/compiler/function-call.optimized.wat +++ b/tests/compiler/function-call.optimized.wat @@ -1,13 +1,13 @@ (module (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) (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_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1082,17 +1082,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1616 diff --git a/tests/compiler/function-types.optimized.wat b/tests/compiler/function-types.optimized.wat index 691bd94c4a..f37c90f66f 100644 --- a/tests/compiler/function-types.optimized.wat +++ b/tests/compiler/function-types.optimized.wat @@ -2,8 +2,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $function-types/i32Adder (mut i32) (i32.const 0)) (global $~argumentsLength (mut i32) (i32.const 0)) diff --git a/tests/compiler/function-types.untouched.wat b/tests/compiler/function-types.untouched.wat index 68a8396c6f..b7e8e09cd2 100644 --- a/tests/compiler/function-types.untouched.wat +++ b/tests/compiler/function-types.untouched.wat @@ -1,8 +1,8 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) diff --git a/tests/compiler/getter-call.optimized.wat b/tests/compiler/getter-call.optimized.wat index f00688e1bd..f6e5fd8584 100644 --- a/tests/compiler/getter-call.optimized.wat +++ b/tests/compiler/getter-call.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1047,17 +1047,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/getter-setter.optimized.wat b/tests/compiler/getter-setter.optimized.wat index cc065dee2c..79f2faf0bf 100644 --- a/tests/compiler/getter-setter.optimized.wat +++ b/tests/compiler/getter-setter.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/getter-setter.untouched.wat b/tests/compiler/getter-setter.untouched.wat index 7667899ca0..39963933ec 100644 --- a/tests/compiler/getter-setter.untouched.wat +++ b/tests/compiler/getter-setter.untouched.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_none (func (param 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))) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 76)) @@ -11,7 +11,6 @@ (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $getter-setter/Foo.get:bar (result i32) diff --git a/tests/compiler/heap.optimized.wat b/tests/compiler/heap.optimized.wat index 0c41748546..0edcbfd3ed 100644 --- a/tests/compiler/heap.optimized.wat +++ b/tests/compiler/heap.optimized.wat @@ -1,12 +1,12 @@ (module - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $heap/ptr (mut i32) (i32.const 0)) @@ -984,17 +984,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1056 diff --git a/tests/compiler/heap.untouched.wat b/tests/compiler/heap.untouched.wat index 2673f79c6d..94215c8e03 100644 --- a/tests/compiler/heap.untouched.wat +++ b/tests/compiler/heap.untouched.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -21,7 +21,6 @@ (data (i32.const 140) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 204) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "heap.alloc" (func $~lib/memory/heap.alloc)) (export "heap.realloc" (func $~lib/memory/heap.realloc)) (export "heap.free" (func $~lib/memory/heap.free)) diff --git a/tests/compiler/if.untouched.wat b/tests/compiler/if.untouched.wat index 66c8766dda..c1bf1dd30d 100644 --- a/tests/compiler/if.untouched.wat +++ b/tests/compiler/if.untouched.wat @@ -10,7 +10,6 @@ (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00i\00f\00.\00t\00s\00\00\00") (data (i32.const 44) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00e\00r\00r\00o\00r\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "ifThenElse" (func $if/ifThenElse)) (export "ifThen" (func $if/ifThen)) (export "ifThenElseBlock" (func $if/ifThenElseBlock)) diff --git a/tests/compiler/implicit-getter-setter.optimized.wat b/tests/compiler/implicit-getter-setter.optimized.wat index 2ff6ade2b5..b2eb0106a9 100644 --- a/tests/compiler/implicit-getter-setter.optimized.wat +++ b/tests/compiler/implicit-getter-setter.optimized.wat @@ -4,8 +4,8 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1057,17 +1057,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/implicit-getter-setter.untouched.wat b/tests/compiler/implicit-getter-setter.untouched.wat index 238e45538d..c5437b355c 100644 --- a/tests/compiler/implicit-getter-setter.untouched.wat +++ b/tests/compiler/implicit-getter-setter.untouched.wat @@ -3,11 +3,11 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,7 +38,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "Basic" (global $implicit-getter-setter/Basic)) (export "Managed" (global $implicit-getter-setter/Managed)) (export "memory" (memory $0)) diff --git a/tests/compiler/import.untouched.wat b/tests/compiler/import.untouched.wat index 83f253388e..05f3b40d0e 100644 --- a/tests/compiler/import.untouched.wat +++ b/tests/compiler/import.untouched.wat @@ -9,7 +9,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $export/add (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/indexof-valueof.untouched.wat b/tests/compiler/indexof-valueof.untouched.wat index 914888e72d..3709c5ce16 100644 --- a/tests/compiler/indexof-valueof.untouched.wat +++ b/tests/compiler/indexof-valueof.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:indexof-valueof diff --git a/tests/compiler/infer-array.optimized.wat b/tests/compiler/infer-array.optimized.wat index 64f3ef092d..8c8b1a9164 100644 --- a/tests/compiler/infer-array.optimized.wat +++ b/tests/compiler/infer-array.optimized.wat @@ -1083,17 +1083,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1424 @@ -2546,11 +2549,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/infer-array.untouched.wat b/tests/compiler/infer-array.untouched.wat index 58ec5bd189..048d2cf2dd 100644 --- a/tests/compiler/infer-array.untouched.wat +++ b/tests/compiler/infer-array.untouched.wat @@ -8,9 +8,9 @@ (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_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -55,7 +55,6 @@ (data (i32.const 956) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 1088) "\0c\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\02\t\00\00\00\00\00\00\02\1a\00\00\00\00\00\00\02\01\00\00\00\00\00\00\02\19\00\00\00\00\00\00 \00\00\00\00\00\00\00\02a\00\00\00\00\00\00\02a\00\00\00\00\00\00\02\01\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/infer-generic.optimized.wat b/tests/compiler/infer-generic.optimized.wat index 0aa5029c5b..8c27338c1c 100644 --- a/tests/compiler/infer-generic.optimized.wat +++ b/tests/compiler/infer-generic.optimized.wat @@ -1,12 +1,12 @@ (module (type $none_=>_none (func)) - (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 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 $f32_=>_f32 (func (param f32) (result f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1069,17 +1069,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1568 diff --git a/tests/compiler/infer-generic.untouched.wat b/tests/compiler/infer-generic.untouched.wat index 79b87293f0..f3476f986b 100644 --- a/tests/compiler/infer-generic.untouched.wat +++ b/tests/compiler/infer-generic.untouched.wat @@ -5,12 +5,12 @@ (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_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) (type $f32_=>_f32 (func (param f32) (result f32))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $infer-generic/arr i32 (i32.const 128)) (global $~argumentsLength (mut i32) (i32.const 0)) diff --git a/tests/compiler/infer-type.untouched.wat b/tests/compiler/infer-type.untouched.wat index 59c61e82fc..398d9c9e4b 100644 --- a/tests/compiler/infer-type.untouched.wat +++ b/tests/compiler/infer-type.untouched.wat @@ -18,7 +18,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $infer-type/locals diff --git a/tests/compiler/inlining-blocklocals.optimized.wat b/tests/compiler/inlining-blocklocals.optimized.wat index 3f736dff7d..22b0b2d69e 100644 --- a/tests/compiler/inlining-blocklocals.optimized.wat +++ b/tests/compiler/inlining-blocklocals.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $inlining-blocklocals/b (mut i32) (i32.const 2)) (global $inlining-blocklocals/theCall_b (mut i32) (i32.const 0)) diff --git a/tests/compiler/inlining-blocklocals.untouched.wat b/tests/compiler/inlining-blocklocals.untouched.wat index bf10d68e90..6056cd3d55 100644 --- a/tests/compiler/inlining-blocklocals.untouched.wat +++ b/tests/compiler/inlining-blocklocals.untouched.wat @@ -12,7 +12,6 @@ (memory $0 1) (data (i32.const 12) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00.\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00-\00b\00l\00o\00c\00k\00l\00o\00c\00a\00l\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $inlining-blocklocals/test diff --git a/tests/compiler/inlining-recursive.untouched.wat b/tests/compiler/inlining-recursive.untouched.wat index 9293419782..9ef7fa3071 100644 --- a/tests/compiler/inlining-recursive.untouched.wat +++ b/tests/compiler/inlining-recursive.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "foo" (func $inlining-recursive/foo)) (export "bar" (func $inlining-recursive/bar)) (export "baz" (func $inlining-recursive/baz)) diff --git a/tests/compiler/inlining.optimized.wat b/tests/compiler/inlining.optimized.wat index 3efc001b52..4bef068634 100644 --- a/tests/compiler/inlining.optimized.wat +++ b/tests/compiler/inlining.optimized.wat @@ -1,12 +1,12 @@ (module (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1056,17 +1056,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1472 diff --git a/tests/compiler/instanceof-class.optimized.wat b/tests/compiler/instanceof-class.optimized.wat index 0c7aae8a8e..d6741d5830 100644 --- a/tests/compiler/instanceof-class.optimized.wat +++ b/tests/compiler/instanceof-class.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1058,17 +1058,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/instanceof-class.untouched.wat b/tests/compiler/instanceof-class.untouched.wat index 0d7ced0f57..e28a73e2c2 100644 --- a/tests/compiler/instanceof-class.untouched.wat +++ b/tests/compiler/instanceof-class.untouched.wat @@ -6,8 +6,8 @@ (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -39,7 +39,6 @@ (data (i32.const 412) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00-\00c\00l\00a\00s\00s\00.\00t\00s\00\00\00\00\00\00\00") (data (i32.const 480) "\07\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\04\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\05\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/instanceof.optimized.wat b/tests/compiler/instanceof.optimized.wat index ae2a8f756f..edd8c5042f 100644 --- a/tests/compiler/instanceof.optimized.wat +++ b/tests/compiler/instanceof.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $instanceof/an (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/instanceof.untouched.wat b/tests/compiler/instanceof.untouched.wat index 49f7d42622..95decea0c1 100644 --- a/tests/compiler/instanceof.untouched.wat +++ b/tests/compiler/instanceof.untouched.wat @@ -17,7 +17,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $instanceof/isI32 (param $0 i32) (result i32) diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index d234e0a29b..49ea45e239 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1051,17 +1051,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/1095.untouched.wat b/tests/compiler/issues/1095.untouched.wat index 607298b673..7abd437ea0 100644 --- a/tests/compiler/issues/1095.untouched.wat +++ b/tests/compiler/issues/1095.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -39,7 +39,6 @@ (data (i32.const 508) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\000\009\005\00.\00t\00s\00") (data (i32.const 560) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/issues/1225.optimized.wat b/tests/compiler/issues/1225.optimized.wat index b20c57acb5..782160a25f 100644 --- a/tests/compiler/issues/1225.optimized.wat +++ b/tests/compiler/issues/1225.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1053,17 +1053,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/1225.untouched.wat b/tests/compiler/issues/1225.untouched.wat index 4823771c9e..e6517cf44c 100644 --- a/tests/compiler/issues/1225.untouched.wat +++ b/tests/compiler/issues/1225.untouched.wat @@ -38,7 +38,6 @@ (data (i32.const 412) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\002\002\005\00.\00t\00s\00") (data (i32.const 464) "\04\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) - (elem $0 (i32.const 1)) (export "normal" (func $issues/1225/normal)) (export "viaThis" (func $issues/1225/viaThis)) (export "memory" (memory $0)) diff --git a/tests/compiler/issues/1699.optimized.wat b/tests/compiler/issues/1699.optimized.wat index 503f16a35c..8813a61e94 100644 --- a/tests/compiler/issues/1699.optimized.wat +++ b/tests/compiler/issues/1699.optimized.wat @@ -1058,17 +1058,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1488 @@ -1768,11 +1771,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/issues/1699.untouched.wat b/tests/compiler/issues/1699.untouched.wat index 472d30f154..47b4298932 100644 --- a/tests/compiler/issues/1699.untouched.wat +++ b/tests/compiler/issues/1699.untouched.wat @@ -6,8 +6,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -40,7 +40,6 @@ (data (i32.const 636) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\006\009\009\00.\00t\00s\00") (data (i32.const 688) "\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\02A\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/issues/1714.untouched.wat b/tests/compiler/issues/1714.untouched.wat index ea38be61bd..f99e8183a5 100644 --- a/tests/compiler/issues/1714.untouched.wat +++ b/tests/compiler/issues/1714.untouched.wat @@ -10,7 +10,6 @@ (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\007\001\004\00.\00t\00s\00") (data (i32.const 60) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00i\003\002\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $issues/1714/a_i64_i32 (result i32) diff --git a/tests/compiler/issues/1751.untouched.wat b/tests/compiler/issues/1751.untouched.wat index f4d95ad56d..700fa1f9a6 100644 --- a/tests/compiler/issues/1751.untouched.wat +++ b/tests/compiler/issues/1751.untouched.wat @@ -4,6 +4,5 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/limits.untouched.wat b/tests/compiler/limits.untouched.wat index 871dfc3787..b41fd91ade 100644 --- a/tests/compiler/limits.untouched.wat +++ b/tests/compiler/limits.untouched.wat @@ -31,7 +31,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:limits diff --git a/tests/compiler/literals.untouched.wat b/tests/compiler/literals.untouched.wat index 57ae32613d..72d9375de2 100644 --- a/tests/compiler/literals.untouched.wat +++ b/tests/compiler/literals.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:literals diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index 281aaf02b4..7c21d3f995 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,17 +1044,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/logical.untouched.wat b/tests/compiler/logical.untouched.wat index f644b48940..b5cffe969a 100644 --- a/tests/compiler/logical.untouched.wat +++ b/tests/compiler/logical.untouched.wat @@ -7,8 +7,8 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $logical/i (mut i32) (i32.const 0)) (global $logical/I (mut i64) (i64.const 0)) @@ -42,7 +42,6 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $logical/testShortcutAnd (param $0 i64) (param $1 i32) (result i32) diff --git a/tests/compiler/loop-flow.optimized.wat b/tests/compiler/loop-flow.optimized.wat index 91ceb5712c..ad06501000 100644 --- a/tests/compiler/loop-flow.optimized.wat +++ b/tests/compiler/loop-flow.optimized.wat @@ -1,8 +1,8 @@ (module (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 1036) ",") diff --git a/tests/compiler/loop-flow.untouched.wat b/tests/compiler/loop-flow.untouched.wat index d28c1bb319..3d5b5916e0 100644 --- a/tests/compiler/loop-flow.untouched.wat +++ b/tests/compiler/loop-flow.untouched.wat @@ -11,7 +11,6 @@ (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00l\00o\00o\00p\00-\00f\00l\00o\00w\00.\00t\00s\00\00\00\00\00") (data (i32.const 60) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00t\00e\00r\00m\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "whileReturn" (func $loop-flow/whileReturn)) (export "whileThrow" (func $loop-flow/whileThrow)) (export "whileContinue" (func $loop-flow/whileContinue)) diff --git a/tests/compiler/loop-wrap.untouched.wat b/tests/compiler/loop-wrap.untouched.wat index 43f9d007a9..900273d284 100644 --- a/tests/compiler/loop-wrap.untouched.wat +++ b/tests/compiler/loop-wrap.untouched.wat @@ -6,7 +6,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "testAlwaysWrapped" (func $loop-wrap/testAlwaysWrapped)) (export "testFirstWrapped" (func $loop-wrap/testFirstWrapped)) (export "testSubsequentWrapped" (func $loop-wrap/testSubsequentWrapped)) diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 4aa2a78181..1402b99423 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -4,8 +4,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1048,17 +1048,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index a8345d8d4f..4916b81681 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -1,13 +1,13 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) (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 (func (param 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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -39,7 +39,6 @@ (data (i32.const 540) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\"\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00u\00p\00c\00a\00s\00t\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 608) "\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\04\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/many-locals.untouched.wat b/tests/compiler/many-locals.untouched.wat index 8a263436ce..4788ffba0b 100644 --- a/tests/compiler/many-locals.untouched.wat +++ b/tests/compiler/many-locals.untouched.wat @@ -1,6 +1,6 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 60)) @@ -9,7 +9,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "testI32" (func $many-locals/testI32)) (export "testI8" (func $many-locals/testI8)) (export "memory" (memory $0)) diff --git a/tests/compiler/memcpy.optimized.wat b/tests/compiler/memcpy.optimized.wat index 36b4eb652f..70fd267858 100644 --- a/tests/compiler/memcpy.optimized.wat +++ b/tests/compiler/memcpy.optimized.wat @@ -1,7 +1,7 @@ (module - (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_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $memcpy/dest (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/memcpy.untouched.wat b/tests/compiler/memcpy.untouched.wat index ddd8ea225a..b4301b54e5 100644 --- a/tests/compiler/memcpy.untouched.wat +++ b/tests/compiler/memcpy.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memcpy/base i32 (i32.const 8)) (global $memcpy/dest (mut i32) (i32.const 0)) @@ -11,7 +11,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memcpy" (func $memcpy/memcpy)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/memmove.optimized.wat b/tests/compiler/memmove.optimized.wat index 21ae653cfb..5413cf6c29 100644 --- a/tests/compiler/memmove.optimized.wat +++ b/tests/compiler/memmove.optimized.wat @@ -1,7 +1,7 @@ (module - (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_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $memmove/dest (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/memmove.untouched.wat b/tests/compiler/memmove.untouched.wat index bd8faf34f5..f011b0840a 100644 --- a/tests/compiler/memmove.untouched.wat +++ b/tests/compiler/memmove.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memmove/base i32 (i32.const 8)) (global $memmove/dest (mut i32) (i32.const 0)) @@ -11,7 +11,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $memmove/memmove (param $0 i32) (param $1 i32) (param $2 i32) (result i32) diff --git a/tests/compiler/memory.untouched.wat b/tests/compiler/memory.untouched.wat index 70d29f29dc..d30d0ebbac 100644 --- a/tests/compiler/memory.untouched.wat +++ b/tests/compiler/memory.untouched.wat @@ -34,7 +34,6 @@ (data (i32.const 207) "\01") (data (i32.const 208) "\01") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $memory/test (result i32) diff --git a/tests/compiler/memorybase.untouched.wat b/tests/compiler/memorybase.untouched.wat index db18d4b952..c948a68e5d 100644 --- a/tests/compiler/memorybase.untouched.wat +++ b/tests/compiler/memorybase.untouched.wat @@ -8,7 +8,6 @@ (memory $0 1) (data (i32.const 1024) "\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:memorybase diff --git a/tests/compiler/memset.optimized.wat b/tests/compiler/memset.optimized.wat index 094e13b17d..632c4af153 100644 --- a/tests/compiler/memset.optimized.wat +++ b/tests/compiler/memset.optimized.wat @@ -1,7 +1,7 @@ (module + (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_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memset/dest (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/memset.untouched.wat b/tests/compiler/memset.untouched.wat index a3ff6086d9..f66d231f46 100644 --- a/tests/compiler/memset.untouched.wat +++ b/tests/compiler/memset.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memset/dest (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 60)) @@ -10,7 +10,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $memset/memset (param $0 i32) (param $1 i32) (param $2 i32) (result i32) diff --git a/tests/compiler/merge.untouched.wat b/tests/compiler/merge.untouched.wat index d837510f77..1d0cb1c945 100644 --- a/tests/compiler/merge.untouched.wat +++ b/tests/compiler/merge.untouched.wat @@ -15,7 +15,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $merge/namespaceType.test diff --git a/tests/compiler/named-export-default.untouched.wat b/tests/compiler/named-export-default.untouched.wat index e8141ba408..b0298f18be 100644 --- a/tests/compiler/named-export-default.untouched.wat +++ b/tests/compiler/named-export-default.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "default" (func $named-export-default/get3)) (export "memory" (memory $0)) (func $named-export-default/get3 (result i32) diff --git a/tests/compiler/named-import-default.untouched.wat b/tests/compiler/named-import-default.untouched.wat index 15b4ea9176..9bac391fe1 100644 --- a/tests/compiler/named-import-default.untouched.wat +++ b/tests/compiler/named-import-default.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "getValue" (func $named-import-default/getValue)) (export "memory" (memory $0)) (func $named-export-default/get3 (result i32) diff --git a/tests/compiler/namespace.untouched.wat b/tests/compiler/namespace.untouched.wat index 58835e187f..ca1f6681d3 100644 --- a/tests/compiler/namespace.untouched.wat +++ b/tests/compiler/namespace.untouched.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_i32 (func (result i32))) (type $none_=>_none (func)) + (type $none_=>_i32 (func (result i32))) (global $namespace/Outer.outerVar (mut i32) (i32.const 1)) (global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0)) (global $namespace/Outer.Inner.anotherVar (mut i32) (i32.const 0)) @@ -12,7 +12,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $namespace/Outer.Inner.aFunc (result i32) diff --git a/tests/compiler/new.optimized.wat b/tests/compiler/new.optimized.wat index ec7fb0c94a..830eef54a0 100644 --- a/tests/compiler/new.optimized.wat +++ b/tests/compiler/new.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $new/ref (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1084,17 +1084,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/new.untouched.wat b/tests/compiler/new.untouched.wat index 2b52be241c..2d1a4357d0 100644 --- a/tests/compiler/new.untouched.wat +++ b/tests/compiler/new.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $new/ref (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -42,7 +42,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\07\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\00 \00\00\00\00\00\00\00 \00\00\00\04\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/nonnullable.json b/tests/compiler/nonnullable.json new file mode 100644 index 0000000000..73d40f91f2 --- /dev/null +++ b/tests/compiler/nonnullable.json @@ -0,0 +1,4 @@ +{ + "asc_flags": [ + ] +} \ No newline at end of file diff --git a/tests/compiler/nonnullable.optimized.wat b/tests/compiler/nonnullable.optimized.wat new file mode 100644 index 0000000000..94e6c35ac0 --- /dev/null +++ b/tests/compiler/nonnullable.optimized.wat @@ -0,0 +1,1714 @@ +(module + (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_i32 (func (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 $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) + (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) + (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) + (global $nonnullable/y (mut i32) (i32.const 0)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 18028)) + (memory $0 1) + (data (i32.const 1036) "\1c") + (data (i32.const 1048) "\01\00\00\00\06\00\00\00u\003\002") + (data (i32.const 1068) ",") + (data (i32.const 1080) "\01\00\00\00\1c\00\00\00n\00o\00n\00n\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s") + (data (i32.const 1116) "L") + (data (i32.const 1128) "\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>") + (data (i32.const 1196) "<") + (data (i32.const 1208) "\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 1260) "<") + (data (i32.const 1272) "\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s") + (data (i32.const 1388) "<") + (data (i32.const 1400) "\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") + (data (i32.const 1452) ",") + (data (i32.const 1464) "\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") + (data (i32.const 1532) "<") + (data (i32.const 1544) "\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 1600) "\05\00\00\00 \00\00\00\00\00\00\00 ") + (data (i32.const 1628) "\02A\00\00\00\00\00\00 ") + (export "memory" (memory $0)) + (start $~start) + (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 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 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + local.tee $4 + local.get $1 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + i32.ne + if + i32.const 0 + return + end + block $__inlined_func$~lib/util/string/compareImpl (result i32) + local.get $0 + local.set $2 + local.get $1 + local.set $3 + local.get $4 + local.tee $0 + i32.const 4 + i32.ge_u + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end + if + loop $do-continue|0 + local.get $2 + i64.load + local.get $3 + i64.load + i64.eq + if + local.get $2 + i32.const 8 + i32.add + local.set $2 + local.get $3 + i32.const 8 + i32.add + local.set $3 + local.get $0 + i32.const 4 + i32.sub + local.tee $0 + i32.const 4 + i32.ge_u + br_if $do-continue|0 + end + end + end + loop $while-continue|1 + local.get $0 + local.tee $1 + i32.const 1 + i32.sub + local.set $0 + local.get $1 + if + local.get $2 + i32.load16_u + local.tee $1 + local.get $3 + i32.load16_u + local.tee $4 + i32.ne + if + local.get $1 + local.get $4 + i32.sub + br $__inlined_func$~lib/util/string/compareImpl + end + local.get $2 + i32.const 2 + i32.add + local.set $2 + local.get $3 + i32.const 2 + i32.add + local.set $3 + br $while-continue|1 + end + end + i32.const 0 + end + i32.eqz + ) + (func $~lib/rt/itcms/visitRoots + (local $0 i32) + (local $1 i32) + global.get $nonnullable/y + local.tee $0 + if + local.get $0 + call $~lib/rt/itcms/__visit + end + i32.const 1408 + call $~lib/rt/itcms/__visit + i32.const 1216 + call $~lib/rt/itcms/__visit + global.get $~lib/rt/itcms/pinSpace + local.tee $1 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + loop $while-continue|0 + local.get $0 + local.get $1 + i32.ne + if + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.const 3 + i32.ne + if + i32.const 0 + i32.const 1280 + i32.const 159 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 20 + i32.add + call $~lib/rt/__visit_members + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/__visit (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.eqz + if + return + end + global.get $~lib/rt/itcms/white + local.get $0 + i32.const 20 + i32.sub + local.tee $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.eq + if + local.get $0 + global.get $~lib/rt/itcms/iter + i32.eq + if + local.get $0 + i32.load offset=8 + local.tee $1 + i32.eqz + if + i32.const 0 + i32.const 1280 + i32.const 147 + i32.const 30 + call $~lib/builtins/abort + unreachable + end + local.get $1 + global.set $~lib/rt/itcms/iter + end + block $__inlined_func$~lib/rt/itcms/Object#unlink + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.tee $2 + i32.eqz + if + i32.const 0 + local.get $0 + i32.const 18028 + i32.lt_u + local.get $0 + i32.load offset=8 + select + i32.eqz + if + i32.const 0 + i32.const 1280 + i32.const 127 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + br $__inlined_func$~lib/rt/itcms/Object#unlink + end + local.get $0 + i32.load offset=8 + local.tee $1 + i32.eqz + if + i32.const 0 + i32.const 1280 + i32.const 131 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $1 + i32.store offset=8 + local.get $1 + local.get $2 + local.get $1 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + i32.store offset=4 + end + global.get $~lib/rt/itcms/toSpace + local.set $1 + local.get $0 + i32.load offset=12 + local.tee $2 + i32.const 1 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $2 + i32.const 1600 + i32.load + i32.gt_u + if + i32.const 1408 + i32.const 1472 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 3 + i32.shl + i32.const 1604 + i32.add + i32.load + i32.const 32 + i32.and + end + if (result i32) + global.get $~lib/rt/itcms/white + i32.eqz + else + i32.const 2 + end + local.set $3 + local.get $1 + i32.load offset=8 + local.set $2 + local.get $0 + local.get $1 + local.get $3 + i32.or + i32.store offset=4 + local.get $0 + local.get $2 + i32.store offset=8 + local.get $2 + local.get $0 + local.get $2 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + i32.store offset=4 + local.get $1 + local.get $0 + i32.store offset=8 + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.add + global.set $~lib/rt/itcms/visitCount + end + ) + (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 1552 + i32.const 268 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const -4 + i32.and + local.tee $2 + i32.const 12 + i32.lt_u + if + i32.const 0 + i32.const 1552 + i32.const 270 + 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 + i32.const 31 + local.get $2 + i32.const 1073741820 + local.get $2 + i32.const 1073741820 + i32.lt_u + select + local.tee $2 + i32.clz + i32.sub + local.set $3 + local.get $2 + local.get $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 $3 + end + local.get $2 + i32.const 16 + i32.lt_u + i32.const 0 + local.get $3 + i32.const 23 + i32.lt_u + select + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 284 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=8 + local.set $4 + local.get $1 + i32.load offset=4 + local.tee $5 + if + local.get $5 + local.get $4 + i32.store offset=8 + end + local.get $4 + if + local.get $4 + local.get $5 + i32.store offset=4 + end + local.get $1 + local.get $0 + local.get $2 + local.get $3 + 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 $3 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + local.get $4 + i32.store offset=96 + local.get $4 + i32.eqz + if + local.get $0 + local.get $3 + i32.const 2 + i32.shl + i32.add + local.tee $4 + i32.load offset=4 + i32.const -2 + local.get $2 + i32.rotl + i32.and + local.set $1 + local.get $4 + local.get $1 + i32.store offset=4 + local.get $1 + i32.eqz + if + local.get $0 + local.get $0 + i32.load + i32.const -2 + local.get $3 + i32.rotl + 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.get $1 + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 201 + 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 1552 + i32.const 203 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.tee $2 + i32.const 1 + i32.and + if + local.get $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $3 + i32.const 4 + i32.add + local.get $2 + i32.const -4 + i32.and + i32.add + local.tee $3 + i32.store + local.get $1 + i32.const 4 + i32.add + local.get $1 + i32.load + i32.const -4 + i32.and + i32.add + local.tee $4 + i32.load + local.set $2 + end + local.get $3 + i32.const 2 + i32.and + if + local.get $1 + i32.const 4 + i32.sub + i32.load + local.tee $1 + i32.load + local.tee $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 221 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $6 + i32.const 4 + i32.add + local.get $3 + i32.const -4 + i32.and + i32.add + local.tee $3 + i32.store + end + local.get $4 + local.get $2 + i32.const 2 + i32.or + i32.store + local.get $3 + i32.const -4 + i32.and + local.tee $3 + i32.const 12 + i32.lt_u + if + i32.const 0 + i32.const 1552 + i32.const 233 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $3 + local.get $1 + i32.const 4 + i32.add + i32.add + local.get $4 + i32.ne + if + i32.const 0 + i32.const 1552 + i32.const 234 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $3 + i32.const 256 + i32.lt_u + if (result i32) + local.get $3 + i32.const 4 + i32.shr_u + else + i32.const 31 + local.get $3 + i32.const 1073741820 + local.get $3 + i32.const 1073741820 + i32.lt_u + select + local.tee $3 + i32.clz + i32.sub + local.tee $4 + i32.const 7 + i32.sub + local.set $5 + local.get $3 + local.get $4 + i32.const 4 + i32.sub + i32.shr_u + i32.const 16 + i32.xor + end + local.tee $3 + i32.const 16 + i32.lt_u + i32.const 0 + local.get $5 + i32.const 23 + i32.lt_u + select + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 251 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $3 + local.get $5 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.add + i32.load offset=96 + local.set $4 + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + local.get $4 + i32.store offset=8 + local.get $4 + if + local.get $4 + local.get $1 + i32.store offset=4 + end + local.get $0 + local.get $3 + local.get $5 + 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 $5 + i32.shl + i32.or + i32.store + local.get $0 + local.get $5 + i32.const 2 + i32.shl + i32.add + local.tee $0 + local.get $0 + i32.load offset=4 + i32.const 1 + local.get $3 + 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 $1 + local.get $2 + i32.gt_u + if + i32.const 0 + i32.const 1552 + i32.const 377 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 19 + i32.add + i32.const -16 + i32.and + i32.const 4 + i32.sub + local.set $1 + local.get $2 + i32.const -16 + i32.and + local.get $0 + i32.load offset=1568 + local.tee $2 + if + local.get $1 + local.get $2 + i32.const 4 + i32.add + i32.lt_u + if + i32.const 0 + i32.const 1552 + i32.const 384 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $2 + local.get $1 + i32.const 16 + i32.sub + i32.eq + if + local.get $2 + 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 1552 + i32.const 397 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + end + local.get $1 + i32.sub + local.tee $2 + i32.const 20 + i32.lt_u + if + return + end + local.get $1 + local.get $4 + i32.const 2 + i32.and + local.get $2 + i32.const 8 + i32.sub + local.tee $2 + i32.const 1 + i32.or + i32.or + i32.store + local.get $1 + i32.const 0 + i32.store offset=4 + local.get $1 + i32.const 0 + i32.store offset=8 + local.get $2 + local.get $1 + i32.const 4 + i32.add + i32.add + 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/initialize + (local $0 i32) + (local $1 i32) + memory.size + local.tee $0 + i32.const 1 + i32.lt_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 18032 + i32.const 0 + i32.store + i32.const 19600 + 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 18032 + i32.add + i32.const 0 + i32.store offset=4 + i32.const 0 + local.set $0 + loop $for-loop|1 + local.get $0 + i32.const 16 + i32.lt_u + if + local.get $0 + local.get $1 + i32.const 4 + i32.shl + i32.add + i32.const 2 + i32.shl + i32.const 18032 + i32.add + i32.const 0 + i32.store offset=96 + local.get $0 + i32.const 1 + i32.add + local.set $0 + 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 18032 + i32.const 19604 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + i32.const 18032 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/itcms/step (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + block $folding-inner0 + block $break|0 + block $case2|0 + block $case1|0 + block $case0|0 + global.get $~lib/rt/itcms/state + br_table $case0|0 $case1|0 $case2|0 $break|0 + end + i32.const 1 + global.set $~lib/rt/itcms/state + i32.const 0 + global.set $~lib/rt/itcms/visitCount + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/iter + br $folding-inner0 + end + global.get $~lib/rt/itcms/white + i32.eqz + local.set $1 + global.get $~lib/rt/itcms/iter + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + loop $while-continue|1 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $0 + global.set $~lib/rt/itcms/iter + local.get $1 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.ne + if + local.get $0 + local.get $1 + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + i32.or + i32.store offset=4 + i32.const 0 + global.set $~lib/rt/itcms/visitCount + local.get $0 + i32.const 20 + i32.add + call $~lib/rt/__visit_members + br $folding-inner0 + end + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + br $while-continue|1 + end + end + i32.const 0 + global.set $~lib/rt/itcms/visitCount + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/iter + i32.load offset=4 + i32.const -4 + i32.and + i32.eq + if + global.get $~lib/memory/__stack_pointer + local.set $0 + loop $while-continue|0 + local.get $0 + i32.const 18028 + i32.lt_u + if + local.get $0 + i32.load + call $~lib/rt/itcms/__visit + local.get $0 + i32.const 4 + i32.add + local.set $0 + br $while-continue|0 + end + end + global.get $~lib/rt/itcms/iter + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + loop $while-continue|2 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $1 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.ne + if + local.get $0 + local.get $1 + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + i32.or + i32.store offset=4 + local.get $0 + i32.const 20 + i32.add + call $~lib/rt/__visit_members + end + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + local.set $0 + br $while-continue|2 + end + end + global.get $~lib/rt/itcms/fromSpace + local.set $0 + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/fromSpace + local.get $0 + global.set $~lib/rt/itcms/toSpace + local.get $1 + global.set $~lib/rt/itcms/white + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + global.set $~lib/rt/itcms/iter + i32.const 2 + global.set $~lib/rt/itcms/state + end + br $folding-inner0 + end + global.get $~lib/rt/itcms/iter + local.tee $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $0 + i32.load offset=4 + i32.const -4 + i32.and + global.set $~lib/rt/itcms/iter + global.get $~lib/rt/itcms/white + i32.eqz + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.ne + if + i32.const 0 + i32.const 1280 + i32.const 228 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.const 18028 + i32.lt_u + if + local.get $0 + i32.const 0 + i32.store offset=4 + local.get $0 + i32.const 0 + i32.store offset=8 + else + global.get $~lib/rt/itcms/total + local.get $0 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.sub + global.set $~lib/rt/itcms/total + local.get $0 + i32.const 4 + i32.add + local.tee $0 + i32.const 18028 + i32.ge_u + if + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + i32.const 4 + i32.sub + local.set $1 + local.get $0 + i32.const 15 + i32.and + i32.eqz + i32.const 0 + local.get $0 + select + if (result i32) + local.get $1 + i32.load + i32.const 1 + i32.and + i32.eqz + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 559 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.tee $0 + i32.load + i32.const 1 + i32.or + local.set $1 + local.get $0 + local.get $1 + i32.store + local.get $0 + call $~lib/rt/tlsf/insertBlock + end + end + i32.const 10 + return + end + global.get $~lib/rt/itcms/toSpace + local.tee $0 + local.get $0 + i32.store offset=4 + global.get $~lib/rt/itcms/toSpace + local.tee $0 + local.get $0 + i32.store offset=8 + i32.const 0 + global.set $~lib/rt/itcms/state + end + i32.const 0 + return + end + global.get $~lib/rt/itcms/visitCount + ) + (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 1552 + i32.const 343 + 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/itcms/__new (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + block $__inlined_func$~lib/rt/itcms/interrupt + i32.const 2048 + local.set $0 + loop $do-continue|0 + local.get $0 + call $~lib/rt/itcms/step + i32.sub + local.set $0 + global.get $~lib/rt/itcms/state + i32.eqz + if + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i64.const 200 + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + br $__inlined_func$~lib/rt/itcms/interrupt + end + local.get $0 + i32.const 0 + i32.gt_s + br_if $do-continue|0 + end + global.get $~lib/rt/itcms/total + local.tee $0 + local.get $0 + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.const 10 + i32.shl + i32.add + global.set $~lib/rt/itcms/threshold + end + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.tee $1 + call $~lib/rt/tlsf/searchBlock + local.tee $0 + i32.eqz + if + i32.const 4 + memory.size + local.tee $0 + i32.const 16 + i32.shl + i32.const 4 + i32.sub + local.get $1 + i32.load offset=1568 + i32.ne + i32.shl + i32.const 65563 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + local.set $2 + local.get $0 + local.get $2 + local.get $0 + local.get $2 + i32.gt_s + select + memory.grow + i32.const 0 + i32.lt_s + if + local.get $2 + memory.grow + i32.const 0 + i32.lt_s + if + unreachable + end + end + local.get $1 + local.get $0 + i32.const 16 + i32.shl + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + local.get $1 + call $~lib/rt/tlsf/searchBlock + local.tee $0 + i32.eqz + if + i32.const 0 + i32.const 1552 + i32.const 496 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + end + local.get $0 + i32.load + i32.const -4 + i32.and + i32.const 28 + i32.lt_u + if + i32.const 0 + i32.const 1552 + i32.const 498 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $0 + call $~lib/rt/tlsf/removeBlock + local.get $0 + i32.load + local.tee $2 + i32.const -4 + i32.and + i32.const 28 + i32.sub + local.tee $3 + i32.const 16 + i32.ge_u + if + local.get $0 + local.get $2 + i32.const 2 + i32.and + i32.const 28 + i32.or + i32.store + local.get $0 + i32.const 32 + i32.add + local.tee $2 + local.get $3 + i32.const 4 + i32.sub + i32.const 1 + i32.or + i32.store + local.get $1 + local.get $2 + call $~lib/rt/tlsf/insertBlock + else + local.get $0 + local.get $2 + i32.const -2 + i32.and + i32.store + local.get $0 + i32.const 4 + i32.add + local.tee $1 + local.get $0 + i32.load + i32.const -4 + i32.and + i32.add + local.get $1 + local.get $0 + i32.load + i32.const -4 + i32.and + i32.add + i32.load + i32.const -3 + i32.and + i32.store + end + local.get $0 + i32.const 4 + i32.store offset=12 + local.get $0 + i32.const 0 + i32.store offset=16 + global.get $~lib/rt/itcms/fromSpace + local.tee $2 + i32.load offset=8 + local.set $1 + local.get $0 + local.get $2 + global.get $~lib/rt/itcms/white + i32.or + i32.store offset=4 + local.get $0 + local.get $1 + i32.store offset=8 + local.get $1 + local.get $0 + local.get $1 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + i32.store offset=4 + local.get $2 + local.get $0 + i32.store offset=8 + global.get $~lib/rt/itcms/total + local.get $0 + i32.load + i32.const -4 + i32.and + i32.const 4 + i32.add + i32.add + global.set $~lib/rt/itcms/total + local.get $0 + i32.const 20 + i32.add + ) + (func $~lib/rt/__visit_members (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + block $invalid + block $nonnullable/Tee + block $~lib/array/Array<~lib/string/String> + block $~lib/arraybuffer/ArrayBufferView + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $~lib/array/Array<~lib/string/String> $nonnullable/Tee $invalid + end + return + end + return + end + local.get $0 + i32.load + local.tee $0 + if + local.get $0 + call $~lib/rt/itcms/__visit + end + return + end + local.get $0 + i32.load offset=4 + local.tee $1 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $2 + loop $while-continue|0 + local.get $1 + local.get $2 + i32.lt_u + if + local.get $1 + i32.load + local.tee $3 + if + local.get $3 + call $~lib/rt/itcms/__visit + end + local.get $1 + i32.const 4 + i32.add + local.set $1 + br $while-continue|0 + end + end + local.get $0 + i32.load + call $~lib/rt/itcms/__visit + return + end + return + end + unreachable + ) + (func $~start + (local $0 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + block $folding-inner0 + global.get $~lib/memory/__stack_pointer + i32.const 1644 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i64.const 0 + i64.store + local.get $0 + i32.const 1056 + i32.store + local.get $0 + i32.const 1056 + i32.store offset=4 + i32.const 1056 + i32.const 1056 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 4 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 1136 + i32.store + local.get $0 + i32.const 1136 + i32.store offset=4 + i32.const 1136 + i32.const 1136 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 6 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + memory.size + i32.const 16 + i32.shl + i32.const 18028 + i32.sub + i32.const 1 + i32.shr_u + global.set $~lib/rt/itcms/threshold + i32.const 1332 + i32.const 1328 + i32.store + i32.const 1336 + i32.const 1328 + i32.store + i32.const 1328 + global.set $~lib/rt/itcms/pinSpace + i32.const 1364 + i32.const 1360 + i32.store + i32.const 1368 + i32.const 1360 + i32.store + i32.const 1360 + global.set $~lib/rt/itcms/toSpace + i32.const 1508 + i32.const 1504 + i32.store + i32.const 1512 + i32.const 1504 + i32.store + i32.const 1504 + global.set $~lib/rt/itcms/fromSpace + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 1644 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 0 + i32.store + local.get $0 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $0 + global.set $nonnullable/y + global.get $~lib/memory/__stack_pointer + local.tee $0 + global.get $nonnullable/y + i32.store + local.get $0 + i32.const 8 + i32.add + global.set $~lib/memory/__stack_pointer + return + end + i32.const 18048 + i32.const 18096 + i32.const 1 + i32.const 1 + call $~lib/builtins/abort + unreachable + ) +) diff --git a/tests/compiler/nonnullable.ts b/tests/compiler/nonnullable.ts new file mode 100644 index 0000000000..384f526f5e --- /dev/null +++ b/tests/compiler/nonnullable.ts @@ -0,0 +1,31 @@ + + + +assert(nameof>() == nameof()) + +assert(nameof>() == nameof()) + +function takesGeneric(t: T): void { + if (!isNullable() || t != null){ + // @ts-ignore + if (isDefined(t.call)){ + t.call() + } + } +} + +function callsGeneric(t: T): void { + if (t != null) { + takesGeneric>(t); // Would be nice to have a `notNull` here + } +} + +class Tee { + call(): void { + let x: i8 = 0; + } +} + +let y: Tee | null = new Tee(); + +callsGeneric(y); \ No newline at end of file diff --git a/tests/compiler/nonnullable.untouched.wat b/tests/compiler/nonnullable.untouched.wat new file mode 100644 index 0000000000..b4f7d59485 --- /dev/null +++ b/tests/compiler/nonnullable.untouched.wat @@ -0,0 +1,2776 @@ +(module + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param 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 (func (param i32 i32 i32) (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))) + (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) + (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) + (global $~lib/rt/itcms/fromSpace (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 $nonnullable/y (mut i32) (i32.const 0)) + (global $~lib/rt/__rtti_base i32 (i32.const 576)) + (global $~lib/memory/__data_end i32 (i32.const 620)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17004)) + (global $~lib/memory/__heap_base i32 (i32.const 17004)) + (memory $0 1) + (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00u\003\002\00\00\00\00\00\00\00") + (data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00n\00o\00n\00n\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s\00") + (data (i32.const 92) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 172) "<\00\00\00\00\00\00\00\00\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\00\00\00\00") + (data (i32.const 236) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 304) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 336) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 364) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00") + (data (i32.const 428) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00") + (data (i32.const 480) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 508) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 576) "\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\02A\00\00\00\00\00\00 \00\00\00\00\00\00\00") + (table $0 1 funcref) + (export "memory" (memory $0)) + (start $~start) + (func $~lib/string/String#get:length (param $0 i32) (result i32) + local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + 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.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 + 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 + ) + (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 $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 + return + end + local.get $0 + call $~lib/string/String#get:length + local.set $2 + local.get $2 + local.get $1 + call $~lib/string/String#get:length + i32.ne + if + i32.const 0 + return + end + local.get $0 + i32.const 0 + local.get $1 + i32.const 0 + local.get $2 + call $~lib/util/string/compareImpl + i32.eqz + ) + (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $~lib/rt/itcms/Object#set:prev (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=8 + ) + (func $~lib/rt/itcms/initLazy (param $0 i32) (result i32) + local.get $0 + local.get $0 + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $0 + local.get $0 + call $~lib/rt/itcms/Object#set:prev + local.get $0 + ) + (func $~lib/rt/itcms/Object#get:next (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + ) + (func $~lib/rt/itcms/Object#get:color (param $0 i32) (result i32) + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + ) + (func $~lib/rt/itcms/visitRoots (param $0 i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + local.get $0 + call $~lib/rt/__visit_globals + global.get $~lib/rt/itcms/pinSpace + local.set $1 + local.get $1 + call $~lib/rt/itcms/Object#get:next + local.set $2 + loop $while-continue|0 + local.get $2 + local.get $1 + i32.ne + local.set $3 + local.get $3 + if + i32.const 1 + drop + local.get $2 + call $~lib/rt/itcms/Object#get:color + i32.const 3 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 256 + i32.const 159 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $2 + i32.const 20 + i32.add + local.get $0 + call $~lib/rt/__visit_members + local.get $2 + call $~lib/rt/itcms/Object#get:next + local.set $2 + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/Object#set:color (param $0 i32) (param $1 i32) + local.get $0 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $1 + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + ) + (func $~lib/rt/itcms/Object#set:next (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + local.get $0 + i32.load offset=4 + i32.const 3 + i32.and + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + ) + (func $~lib/rt/itcms/Object#unlink (param $0 i32) + (local $1 i32) + (local $2 i32) + local.get $0 + call $~lib/rt/itcms/Object#get:next + local.set $1 + local.get $1 + i32.const 0 + i32.eq + if + i32.const 1 + drop + local.get $0 + i32.load offset=8 + i32.const 0 + i32.eq + if (result i32) + local.get $0 + global.get $~lib/memory/__heap_base + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 256 + i32.const 127 + i32.const 18 + call $~lib/builtins/abort + unreachable + end + return + end + local.get $0 + i32.load offset=8 + local.set $2 + i32.const 1 + drop + local.get $2 + i32.eqz + if + i32.const 0 + i32.const 256 + i32.const 131 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.get $2 + call $~lib/rt/itcms/Object#set:prev + local.get $2 + local.get $1 + call $~lib/rt/itcms/Object#set:next + ) + (func $~lib/rt/__typeinfo (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/rt/__rtti_base + local.set $1 + local.get $0 + local.get $1 + i32.load + i32.gt_u + if + i32.const 384 + i32.const 448 + i32.const 22 + i32.const 28 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + local.get $0 + i32.const 8 + i32.mul + i32.add + i32.load + ) + (func $~lib/rt/itcms/Object#get:isPointerfree (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.load offset=12 + local.set $1 + local.get $1 + i32.const 1 + i32.le_u + if (result i32) + i32.const 1 + else + local.get $1 + call $~lib/rt/__typeinfo + i32.const 32 + i32.and + i32.const 0 + i32.ne + end + ) + (func $~lib/rt/itcms/Object#linkTo (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + local.get $1 + i32.load offset=8 + local.set $3 + local.get $0 + local.get $1 + local.get $2 + i32.or + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $0 + local.get $3 + call $~lib/rt/itcms/Object#set:prev + local.get $3 + local.get $0 + call $~lib/rt/itcms/Object#set:next + local.get $1 + local.get $0 + call $~lib/rt/itcms/Object#set:prev + ) + (func $~lib/rt/itcms/Object#makeGray (param $0 i32) + (local $1 i32) + local.get $0 + global.get $~lib/rt/itcms/iter + i32.eq + if + local.get $0 + i32.load offset=8 + local.tee $1 + i32.eqz + if (result i32) + i32.const 0 + i32.const 256 + i32.const 147 + i32.const 30 + call $~lib/builtins/abort + unreachable + else + local.get $1 + end + global.set $~lib/rt/itcms/iter + end + local.get $0 + call $~lib/rt/itcms/Object#unlink + local.get $0 + global.get $~lib/rt/itcms/toSpace + local.get $0 + call $~lib/rt/itcms/Object#get:isPointerfree + if (result i32) + global.get $~lib/rt/itcms/white + i32.eqz + else + i32.const 2 + end + call $~lib/rt/itcms/Object#linkTo + ) + (func $~lib/rt/itcms/__visit (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.eqz + if + return + end + local.get $0 + i32.const 20 + i32.sub + local.set $2 + i32.const 0 + drop + local.get $2 + call $~lib/rt/itcms/Object#get:color + global.get $~lib/rt/itcms/white + i32.eq + if + local.get $2 + call $~lib/rt/itcms/Object#makeGray + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.add + global.set $~lib/rt/itcms/visitCount + end + ) + (func $~lib/rt/itcms/visitStack (param $0 i32) + (local $1 i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + local.set $1 + loop $while-continue|0 + local.get $1 + global.get $~lib/memory/__heap_base + i32.lt_u + local.set $2 + local.get $2 + if + local.get $1 + i32.load + local.get $0 + call $~lib/rt/itcms/__visit + local.get $1 + i32.const 4 + i32.add + local.set $1 + br $while-continue|0 + end + end + ) + (func $~lib/rt/itcms/Object#get:size (param $0 i32) (result i32) + i32.const 4 + local.get $0 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + ) + (func $~lib/rt/tlsf/Root#set:flMap (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $~lib/rt/common/BLOCK#set:mmInfo (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store + ) + (func $~lib/rt/tlsf/Block#set:prev (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=4 + ) + (func $~lib/rt/tlsf/Block#set:next (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=8 + ) + (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 528 + i32.const 268 + 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 12 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 270 + 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 + local.get $3 + local.tee $6 + i32.const 1073741820 + local.tee $7 + local.get $6 + local.get $7 + i32.lt_u + select + local.set $6 + i32.const 31 + local.get $6 + i32.clz + i32.sub + local.set $4 + local.get $6 + 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 528 + i32.const 284 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.load offset=4 + local.set $8 + local.get $1 + i32.load offset=8 + local.set $9 + local.get $8 + if + local.get $8 + local.get $9 + call $~lib/rt/tlsf/Block#set:next + end + local.get $9 + if + local.get $9 + local.get $8 + call $~lib/rt/tlsf/Block#set:prev + end + local.get $1 + local.get $0 + local.set $10 + local.get $4 + local.set $6 + local.get $5 + local.set $7 + local.get $10 + local.get $6 + i32.const 4 + i32.shl + local.get $7 + 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 $6 + local.get $9 + local.set $7 + local.get $11 + local.get $10 + i32.const 4 + i32.shl + local.get $6 + i32.add + i32.const 2 + i32.shl + i32.add + local.get $7 + i32.store offset=96 + local.get $9 + i32.eqz + if + local.get $0 + local.set $6 + local.get $4 + local.set $7 + local.get $6 + local.get $7 + i32.const 2 + i32.shl + i32.add + i32.load offset=4 + local.set $6 + local.get $0 + local.set $7 + local.get $4 + local.set $11 + local.get $6 + i32.const 1 + local.get $5 + i32.shl + i32.const -1 + i32.xor + i32.and + local.tee $6 + local.set $10 + local.get $7 + local.get $11 + i32.const 2 + i32.shl + i32.add + local.get $10 + i32.store offset=4 + local.get $6 + 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 + call $~lib/rt/tlsf/Root#set:flMap + 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 528 + i32.const 201 + 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 528 + i32.const 203 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + 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 $0 + local.get $4 + call $~lib/rt/tlsf/removeBlock + local.get $1 + local.get $2 + i32.const 4 + i32.add + local.get $5 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.tee $2 + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + 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 + end + local.get $2 + i32.const 2 + i32.and + if + local.get $1 + local.set $3 + local.get $3 + i32.const 4 + i32.sub + i32.load + local.set $3 + local.get $3 + i32.load + local.set $6 + i32.const 1 + drop + local.get $6 + i32.const 1 + i32.and + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 221 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $3 + local.set $1 + local.get $1 + local.get $6 + i32.const 4 + i32.add + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + i32.add + local.tee $2 + call $~lib/rt/common/BLOCK#set:mmInfo + end + local.get $4 + local.get $5 + i32.const 2 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $2 + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.set $7 + i32.const 1 + drop + local.get $7 + i32.const 12 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 233 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + i32.const 1 + drop + local.get $1 + i32.const 4 + i32.add + local.get $7 + i32.add + local.get $4 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 234 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $4 + i32.const 4 + i32.sub + local.get $1 + i32.store + local.get $7 + i32.const 256 + i32.lt_u + if + i32.const 0 + local.set $8 + local.get $7 + i32.const 4 + i32.shr_u + local.set $9 + else + local.get $7 + local.tee $3 + i32.const 1073741820 + local.tee $6 + local.get $3 + local.get $6 + i32.lt_u + select + local.set $3 + i32.const 31 + local.get $3 + i32.clz + i32.sub + local.set $8 + local.get $3 + local.get $8 + i32.const 4 + i32.sub + i32.shr_u + i32.const 1 + i32.const 4 + i32.shl + i32.xor + local.set $9 + local.get $8 + i32.const 8 + i32.const 1 + i32.sub + i32.sub + local.set $8 + end + i32.const 1 + drop + local.get $8 + i32.const 23 + i32.lt_u + if (result i32) + local.get $9 + i32.const 16 + i32.lt_u + else + i32.const 0 + end + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 251 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $10 + local.get $8 + local.set $3 + local.get $9 + local.set $6 + local.get $10 + 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 + call $~lib/rt/tlsf/Block#set:prev + local.get $1 + local.get $11 + call $~lib/rt/tlsf/Block#set:next + local.get $11 + if + local.get $11 + local.get $1 + call $~lib/rt/tlsf/Block#set:prev + end + local.get $0 + local.set $12 + local.get $8 + local.set $10 + local.get $9 + local.set $3 + local.get $1 + local.set $6 + local.get $12 + local.get $10 + 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 $8 + i32.shl + i32.or + call $~lib/rt/tlsf/Root#set:flMap + local.get $0 + local.set $13 + local.get $8 + local.set $12 + local.get $0 + local.set $3 + local.get $8 + 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 $9 + i32.shl + i32.or + local.set $10 + local.get $13 + local.get $12 + i32.const 2 + i32.shl + i32.add + local.get $10 + 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 + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 377 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $1 + i32.const 4 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + i32.const 4 + i32.sub + local.set $1 + local.get $2 + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $2 + 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 4 + i32.add + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 384 + 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 528 + i32.const 397 + 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 4 + i32.const 12 + i32.add + i32.const 4 + i32.add + i32.lt_u + if + i32.const 0 + return + end + local.get $6 + i32.const 2 + i32.const 4 + i32.mul + 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 + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $8 + i32.const 0 + call $~lib/rt/tlsf/Block#set:prev + local.get $8 + i32.const 0 + call $~lib/rt/tlsf/Block#set:next + local.get $1 + i32.const 4 + i32.add + local.get $7 + i32.add + local.set $4 + local.get $4 + i32.const 0 + i32.const 2 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + 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/initialize + (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) + (local $12 i32) + i32.const 0 + drop + global.get $~lib/memory/__heap_base + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + local.set $0 + memory.size + local.set $1 + local.get $0 + 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 $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else + i32.const 0 + end + if + unreachable + end + local.get $0 + local.set $3 + local.get $3 + i32.const 0 + call $~lib/rt/tlsf/Root#set:flMap + local.get $3 + 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 $3 + 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 $3 + 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 $0 + i32.const 1572 + i32.add + local.set $12 + i32.const 0 + drop + local.get $3 + local.get $12 + memory.size + i32.const 16 + i32.shl + call $~lib/rt/tlsf/addMemory + drop + local.get $3 + global.set $~lib/rt/tlsf/ROOT + ) + (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) + (local $1 i32) + local.get $0 + i32.const 4 + 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 + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 559 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $1 + ) + (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) + i32.const 0 + drop + local.get $1 + local.get $1 + i32.load + i32.const 1 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $0 + local.get $1 + call $~lib/rt/tlsf/insertBlock + ) + (func $~lib/rt/tlsf/__free (param $0 i32) + local.get $0 + global.get $~lib/memory/__heap_base + i32.lt_u + if + return + end + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/checkUsedBlock + call $~lib/rt/tlsf/freeBlock + ) + (func $~lib/rt/itcms/free (param $0 i32) + local.get $0 + global.get $~lib/memory/__heap_base + i32.lt_u + if + local.get $0 + i32.const 0 + call $~lib/rt/itcms/Object#set:nextWithColor + local.get $0 + i32.const 0 + call $~lib/rt/itcms/Object#set:prev + else + global.get $~lib/rt/itcms/total + local.get $0 + call $~lib/rt/itcms/Object#get:size + i32.sub + global.set $~lib/rt/itcms/total + i32.const 0 + drop + local.get $0 + i32.const 4 + i32.add + call $~lib/rt/tlsf/__free + end + ) + (func $~lib/rt/itcms/step (result i32) + (local $0 i32) + (local $1 i32) + (local $2 i32) + block $break|0 + block $case2|0 + block $case1|0 + block $case0|0 + global.get $~lib/rt/itcms/state + local.set $1 + local.get $1 + i32.const 0 + i32.eq + br_if $case0|0 + local.get $1 + i32.const 1 + i32.eq + br_if $case1|0 + local.get $1 + i32.const 2 + i32.eq + br_if $case2|0 + br $break|0 + end + i32.const 1 + global.set $~lib/rt/itcms/state + i32.const 0 + global.set $~lib/rt/itcms/visitCount + i32.const 0 + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/iter + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + global.get $~lib/rt/itcms/white + i32.eqz + local.set $1 + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $0 + loop $while-continue|1 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + local.set $2 + local.get $2 + if + local.get $0 + global.set $~lib/rt/itcms/iter + local.get $0 + call $~lib/rt/itcms/Object#get:color + local.get $1 + i32.ne + if + local.get $0 + local.get $1 + call $~lib/rt/itcms/Object#set:color + i32.const 0 + global.set $~lib/rt/itcms/visitCount + local.get $0 + i32.const 20 + i32.add + i32.const 0 + call $~lib/rt/__visit_members + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + local.get $0 + call $~lib/rt/itcms/Object#get:next + local.set $0 + br $while-continue|1 + end + end + i32.const 0 + global.set $~lib/rt/itcms/visitCount + i32.const 0 + call $~lib/rt/itcms/visitRoots + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $0 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.eq + if + i32.const 0 + call $~lib/rt/itcms/visitStack + global.get $~lib/rt/itcms/iter + call $~lib/rt/itcms/Object#get:next + local.set $0 + loop $while-continue|2 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + local.set $2 + local.get $2 + if + local.get $0 + call $~lib/rt/itcms/Object#get:color + local.get $1 + i32.ne + if + local.get $0 + local.get $1 + call $~lib/rt/itcms/Object#set:color + local.get $0 + i32.const 20 + i32.add + i32.const 0 + call $~lib/rt/__visit_members + end + local.get $0 + call $~lib/rt/itcms/Object#get:next + local.set $0 + br $while-continue|2 + end + end + global.get $~lib/rt/itcms/fromSpace + local.set $2 + global.get $~lib/rt/itcms/toSpace + global.set $~lib/rt/itcms/fromSpace + local.get $2 + global.set $~lib/rt/itcms/toSpace + local.get $1 + global.set $~lib/rt/itcms/white + local.get $2 + call $~lib/rt/itcms/Object#get:next + global.set $~lib/rt/itcms/iter + i32.const 2 + global.set $~lib/rt/itcms/state + end + global.get $~lib/rt/itcms/visitCount + i32.const 1 + i32.mul + return + end + global.get $~lib/rt/itcms/iter + local.set $0 + local.get $0 + global.get $~lib/rt/itcms/toSpace + i32.ne + if + local.get $0 + call $~lib/rt/itcms/Object#get:next + global.set $~lib/rt/itcms/iter + i32.const 1 + drop + local.get $0 + call $~lib/rt/itcms/Object#get:color + global.get $~lib/rt/itcms/white + i32.eqz + i32.eq + i32.eqz + if + i32.const 0 + i32.const 256 + i32.const 228 + i32.const 20 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/itcms/free + i32.const 10 + return + end + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/toSpace + call $~lib/rt/itcms/Object#set:nextWithColor + global.get $~lib/rt/itcms/toSpace + global.get $~lib/rt/itcms/toSpace + call $~lib/rt/itcms/Object#set:prev + i32.const 0 + global.set $~lib/rt/itcms/state + br $break|0 + end + i32.const 0 + ) + (func $~lib/rt/itcms/interrupt + (local $0 i32) + (local $1 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1024 + i32.const 200 + i32.mul + i32.const 100 + i32.div_u + local.set $0 + loop $do-continue|0 + local.get $0 + call $~lib/rt/itcms/step + i32.sub + local.set $0 + global.get $~lib/rt/itcms/state + i32.const 0 + i32.eq + if + i32.const 0 + drop + global.get $~lib/rt/itcms/total + i64.extend_i32_u + i64.const 200 + i64.mul + i64.const 100 + i64.div_u + i32.wrap_i64 + i32.const 1024 + i32.add + global.set $~lib/rt/itcms/threshold + i32.const 0 + drop + return + end + local.get $0 + i32.const 0 + i32.gt_s + local.set $1 + local.get $1 + br_if $do-continue|0 + end + i32.const 0 + drop + global.get $~lib/rt/itcms/total + i32.const 1024 + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.sub + i32.const 1024 + i32.lt_u + i32.mul + i32.add + global.set $~lib/rt/itcms/threshold + i32.const 0 + drop + ) + (func $~lib/rt/tlsf/computeSize (param $0 i32) (result i32) + local.get $0 + i32.const 12 + i32.le_u + if (result i32) + i32.const 12 + else + local.get $0 + i32.const 4 + i32.add + i32.const 15 + i32.add + i32.const 15 + i32.const -1 + i32.xor + i32.and + i32.const 4 + i32.sub + end + ) + (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) + local.get $0 + i32.const 1073741820 + i32.gt_u + if + i32.const 192 + i32.const 528 + i32.const 458 + i32.const 29 + call $~lib/builtins/abort + unreachable + end + local.get $0 + call $~lib/rt/tlsf/computeSize + ) + (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 536870910 + 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 528 + i32.const 330 + 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 528 + i32.const 343 + 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 536870910 + 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 4 + local.get $2 + i32.const 16 + i32.shl + i32.const 4 + 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 4 + i32.add + i32.const 15 + i32.and + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 357 + 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 4 + i32.const 12 + i32.add + i32.ge_u + if + local.get $1 + local.get $2 + local.get $3 + i32.const 2 + i32.and + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $1 + i32.const 4 + i32.add + local.get $2 + i32.add + local.set $5 + local.get $5 + local.get $4 + i32.const 4 + i32.sub + i32.const 1 + i32.or + call $~lib/rt/common/BLOCK#set:mmInfo + 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 + call $~lib/rt/common/BLOCK#set:mmInfo + local.get $1 + local.set $5 + local.get $5 + i32.const 4 + 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 4 + 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 + call $~lib/rt/common/BLOCK#set:mmInfo + end + ) + (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $1 + call $~lib/rt/tlsf/prepareSize + local.set $2 + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + local.get $2 + call $~lib/rt/tlsf/growMemory + local.get $0 + local.get $2 + call $~lib/rt/tlsf/searchBlock + local.set $3 + i32.const 1 + drop + local.get $3 + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 496 + i32.const 16 + call $~lib/builtins/abort + unreachable + end + end + i32.const 1 + drop + local.get $3 + i32.load + i32.const 3 + i32.const -1 + i32.xor + i32.and + local.get $2 + i32.ge_u + i32.eqz + if + i32.const 0 + i32.const 528 + i32.const 498 + i32.const 14 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $3 + call $~lib/rt/tlsf/removeBlock + local.get $0 + local.get $3 + local.get $2 + call $~lib/rt/tlsf/prepareBlock + i32.const 0 + drop + local.get $3 + ) + (func $~lib/rt/tlsf/__alloc (param $0 i32) (result i32) + global.get $~lib/rt/tlsf/ROOT + i32.eqz + if + call $~lib/rt/tlsf/initialize + end + global.get $~lib/rt/tlsf/ROOT + local.get $0 + call $~lib/rt/tlsf/allocateBlock + i32.const 4 + i32.add + ) + (func $~lib/rt/itcms/Object#set:rtId (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=12 + ) + (func $~lib/rt/itcms/Object#set:rtSize (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + i32.store offset=16 + ) + (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i64) + (local $10 i32) + block $~lib/util/memory/memset|inlined.0 + local.get $0 + local.set $5 + local.get $1 + local.set $4 + local.get $2 + local.set $3 + i32.const 0 + i32.const 1 + i32.gt_s + drop + local.get $3 + i32.eqz + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $3 + i32.add + local.set $6 + local.get $5 + local.get $4 + i32.store8 + local.get $6 + i32.const 1 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 2 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 offset=1 + local.get $5 + local.get $4 + i32.store8 offset=2 + local.get $6 + i32.const 2 + i32.sub + local.get $4 + i32.store8 + local.get $6 + i32.const 3 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 6 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $4 + i32.store8 offset=3 + local.get $6 + i32.const 4 + i32.sub + local.get $4 + i32.store8 + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + i32.const 0 + local.get $5 + i32.sub + i32.const 3 + i32.and + local.set $7 + local.get $5 + local.get $7 + i32.add + local.set $5 + local.get $3 + local.get $7 + i32.sub + local.set $3 + local.get $3 + i32.const -4 + i32.and + local.set $3 + i32.const -1 + i32.const 255 + i32.div_u + local.get $4 + i32.const 255 + i32.and + i32.mul + local.set $8 + local.get $5 + local.get $3 + i32.add + local.set $6 + local.get $5 + local.get $8 + i32.store + local.get $6 + i32.const 4 + i32.sub + local.get $8 + i32.store + local.get $3 + i32.const 8 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $8 + i32.store offset=4 + local.get $5 + local.get $8 + i32.store offset=8 + local.get $6 + i32.const 12 + i32.sub + local.get $8 + i32.store + local.get $6 + i32.const 8 + i32.sub + local.get $8 + i32.store + local.get $3 + i32.const 24 + i32.le_u + if + br $~lib/util/memory/memset|inlined.0 + end + local.get $5 + local.get $8 + i32.store offset=12 + local.get $5 + local.get $8 + i32.store offset=16 + local.get $5 + local.get $8 + i32.store offset=20 + local.get $5 + local.get $8 + i32.store offset=24 + local.get $6 + i32.const 28 + i32.sub + local.get $8 + i32.store + local.get $6 + i32.const 24 + i32.sub + local.get $8 + i32.store + local.get $6 + i32.const 20 + i32.sub + local.get $8 + i32.store + local.get $6 + i32.const 16 + i32.sub + local.get $8 + i32.store + i32.const 24 + local.get $5 + i32.const 4 + i32.and + i32.add + local.set $7 + local.get $5 + local.get $7 + i32.add + local.set $5 + local.get $3 + local.get $7 + i32.sub + local.set $3 + local.get $8 + i64.extend_i32_u + local.get $8 + i64.extend_i32_u + i64.const 32 + i64.shl + i64.or + local.set $9 + loop $while-continue|0 + local.get $3 + i32.const 32 + i32.ge_u + local.set $10 + local.get $10 + if + local.get $5 + local.get $9 + i64.store + local.get $5 + local.get $9 + i64.store offset=8 + local.get $5 + local.get $9 + i64.store offset=16 + local.get $5 + local.get $9 + i64.store offset=24 + local.get $3 + i32.const 32 + i32.sub + local.set $3 + local.get $5 + i32.const 32 + i32.add + local.set $5 + br $while-continue|0 + end + end + end + ) + (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + local.get $0 + i32.const 1073741804 + i32.ge_u + if + i32.const 192 + i32.const 256 + i32.const 260 + i32.const 31 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/rt/itcms/total + global.get $~lib/rt/itcms/threshold + i32.ge_u + if + call $~lib/rt/itcms/interrupt + end + i32.const 16 + local.get $0 + i32.add + call $~lib/rt/tlsf/__alloc + i32.const 4 + i32.sub + local.set $2 + local.get $2 + local.get $1 + call $~lib/rt/itcms/Object#set:rtId + local.get $2 + local.get $0 + call $~lib/rt/itcms/Object#set:rtSize + local.get $2 + global.get $~lib/rt/itcms/fromSpace + global.get $~lib/rt/itcms/white + call $~lib/rt/itcms/Object#linkTo + global.get $~lib/rt/itcms/total + local.get $2 + call $~lib/rt/itcms/Object#get:size + i32.add + global.set $~lib/rt/itcms/total + local.get $2 + i32.const 20 + i32.add + local.set $3 + local.get $3 + i32.const 0 + local.get $0 + call $~lib/memory/memory.fill + local.get $3 + ) + (func $nonnullable/Tee#call (param $0 i32) + (local $1 i32) + i32.const 0 + local.set $1 + ) + (func $nonnullable/takesGeneric (param $0 i32) + i32.const 0 + i32.eqz + if (result i32) + i32.const 1 + else + local.get $0 + i32.const 0 + i32.ne + end + drop + i32.const 1 + drop + local.get $0 + call $nonnullable/Tee#call + ) + (func $nonnullable/callsGeneric (param $0 i32) + local.get $0 + i32.const 0 + i32.ne + if + local.get $0 + call $nonnullable/takesGeneric + end + ) + (func $~lib/rt/__visit_globals (param $0 i32) + (local $1 i32) + global.get $nonnullable/y + local.tee $1 + if + local.get $1 + local.get $0 + call $~lib/rt/itcms/__visit + end + i32.const 384 + local.get $0 + call $~lib/rt/itcms/__visit + i32.const 192 + local.get $0 + call $~lib/rt/itcms/__visit + ) + (func $~lib/arraybuffer/ArrayBufferView~visit (param $0 i32) (param $1 i32) + (local $2 i32) + local.get $0 + i32.load + local.tee $2 + if + local.get $2 + local.get $1 + call $~lib/rt/itcms/__visit + end + ) + (func $~lib/array/Array<~lib/string/String>#__visit (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + i32.const 1 + drop + local.get $0 + i32.load offset=4 + local.set $2 + local.get $2 + local.get $0 + i32.load offset=12 + i32.const 2 + i32.shl + i32.add + local.set $3 + loop $while-continue|0 + local.get $2 + local.get $3 + i32.lt_u + local.set $4 + local.get $4 + if + local.get $2 + i32.load + local.set $5 + local.get $5 + if + local.get $5 + local.get $1 + call $~lib/rt/itcms/__visit + end + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $while-continue|0 + end + end + local.get $0 + i32.load + local.get $1 + call $~lib/rt/itcms/__visit + ) + (func $~lib/array/Array<~lib/string/String>~visit (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>#__visit + ) + (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + block $invalid + block $nonnullable/Tee + block $~lib/array/Array<~lib/string/String> + block $~lib/arraybuffer/ArrayBufferView + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $~lib/array/Array<~lib/string/String> $nonnullable/Tee $invalid + end + return + end + return + end + local.get $0 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView~visit + return + end + local.get $0 + local.get $1 + call $~lib/array/Array<~lib/string/String>~visit + return + end + return + end + unreachable + ) + (func $~start + call $start:nonnullable + ) + (func $~stack_check + global.get $~lib/memory/__stack_pointer + global.get $~lib/memory/__data_end + i32.lt_s + if + i32.const 17024 + i32.const 17072 + i32.const 1 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + ) + (func $start:nonnullable + (local $0 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + i32.const 32 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 + i32.const 32 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + local.get $0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 4 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + i32.const 112 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 + i32.const 112 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + local.get $0 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 6 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + memory.size + i32.const 16 + i32.shl + global.get $~lib/memory/__heap_base + i32.sub + i32.const 1 + i32.shr_u + global.set $~lib/rt/itcms/threshold + i32.const 304 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/pinSpace + i32.const 336 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/toSpace + i32.const 480 + call $~lib/rt/itcms/initLazy + global.set $~lib/rt/itcms/fromSpace + i32.const 0 + call $nonnullable/Tee#constructor + global.set $nonnullable/y + global.get $nonnullable/y + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 + call $nonnullable/callsGeneric + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $nonnullable/Tee#constructor (param $0 i32) (result i32) + (local $1 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + i32.eqz + if + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.const 4 + call $~lib/rt/itcms/__new + local.tee $0 + i32.store + end + local.get $0 + local.set $1 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $1 + ) +) diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index 7689283fff..320c6999e4 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -1091,17 +1091,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1616 @@ -1875,10 +1878,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -1906,20 +1909,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 659e2fc3fa..7707d4d94d 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -6,16 +6,16 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $f32_=>_i32 (func (param f32) (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_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $number/a (mut i32) (i32.const 1)) @@ -85,7 +85,6 @@ (data (i32.const 3596) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e\00\00\00") (data (i32.const 3632) "\03\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/util/number/decimalCount32 (param $0 i32) (result i32) diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index 48e60473ad..b8a3de7242 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (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))) @@ -922,17 +922,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 @@ -1805,10 +1808,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -1836,20 +1839,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat index f54cd3df18..24350af97d 100644 --- a/tests/compiler/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -2,16 +2,16 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 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_f64_=>_none (func (param i32 f64))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) + (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 $i32_f32_=>_none (func (param i32 f32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_f32_=>_none (func (param i32 f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) @@ -47,7 +47,6 @@ (data (i32.const 652) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00b\00a\00z\00\00\00\00\00\00\00") (data (i32.const 688) "\07\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $object-literal/Managed#set:bar (param $0 i32) (param $1 i32) diff --git a/tests/compiler/optional-typeparameters.optimized.wat b/tests/compiler/optional-typeparameters.optimized.wat index 215d715993..12579207ca 100644 --- a/tests/compiler/optional-typeparameters.optimized.wat +++ b/tests/compiler/optional-typeparameters.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1056,17 +1056,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat index 39eb4ada0e..08c41ebb34 100644 --- a/tests/compiler/optional-typeparameters.untouched.wat +++ b/tests/compiler/optional-typeparameters.untouched.wat @@ -39,7 +39,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $optional-typeparameters/testConcrete (param $0 i32) (result i32) diff --git a/tests/compiler/overflow.untouched.wat b/tests/compiler/overflow.untouched.wat index 66b4056373..b7d2046208 100644 --- a/tests/compiler/overflow.untouched.wat +++ b/tests/compiler/overflow.untouched.wat @@ -8,7 +8,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\16\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:overflow diff --git a/tests/compiler/portable-conversions.untouched.wat b/tests/compiler/portable-conversions.untouched.wat index fda49f783b..61c3488b3b 100644 --- a/tests/compiler/portable-conversions.untouched.wat +++ b/tests/compiler/portable-conversions.untouched.wat @@ -12,7 +12,6 @@ (memory $0 1) (data (i32.const 12) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00.\00\00\00p\00o\00r\00t\00a\00b\00l\00e\00-\00c\00o\00n\00v\00e\00r\00s\00i\00o\00n\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:portable-conversions diff --git a/tests/compiler/possibly-null.untouched.wat b/tests/compiler/possibly-null.untouched.wat index 831bb2c21e..aa17e4593a 100644 --- a/tests/compiler/possibly-null.untouched.wat +++ b/tests/compiler/possibly-null.untouched.wat @@ -1,16 +1,15 @@ (module (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 8)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16392)) (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "testTrue" (func $export:possibly-null/testTrue)) (export "testFalseElse" (func $export:possibly-null/testFalseElse)) diff --git a/tests/compiler/recursive.untouched.wat b/tests/compiler/recursive.untouched.wat index e435f21f18..ea3410c17b 100644 --- a/tests/compiler/recursive.untouched.wat +++ b/tests/compiler/recursive.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "fib" (func $recursive/fib)) (export "memory" (memory $0)) (func $recursive/fib (param $0 i32) (result i32) diff --git a/tests/compiler/reexport.optimized.wat b/tests/compiler/reexport.optimized.wat index d6cf608c9e..20a33d4c4d 100644 --- a/tests/compiler/reexport.optimized.wat +++ b/tests/compiler/reexport.optimized.wat @@ -5,8 +5,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -1133,17 +1133,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/reexport.untouched.wat b/tests/compiler/reexport.untouched.wat index dfeefaf1a6..d1df27a40e 100644 --- a/tests/compiler/reexport.untouched.wat +++ b/tests/compiler/reexport.untouched.wat @@ -51,7 +51,6 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\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\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "add" (func $export/add)) (export "renamed_sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) diff --git a/tests/compiler/rereexport.optimized.wat b/tests/compiler/rereexport.optimized.wat index 211ab5d6e7..333343394e 100644 --- a/tests/compiler/rereexport.optimized.wat +++ b/tests/compiler/rereexport.optimized.wat @@ -1,11 +1,11 @@ (module (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -1095,17 +1095,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/rereexport.untouched.wat b/tests/compiler/rereexport.untouched.wat index 1bee66560a..7533f5ae91 100644 --- a/tests/compiler/rereexport.untouched.wat +++ b/tests/compiler/rereexport.untouched.wat @@ -6,8 +6,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -47,7 +47,6 @@ (data (i32.const 460) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00r\00e\00r\00e\00e\00x\00p\00o\00r\00t\00.\00t\00s\00\00\00") (data (i32.const 512) "\04\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) - (elem $0 (i32.const 1)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/compiler/resolve-access.optimized.wat b/tests/compiler/resolve-access.optimized.wat index e4af9d5ab6..88f7ad3a8b 100644 --- a/tests/compiler/resolve-access.optimized.wat +++ b/tests/compiler/resolve-access.optimized.wat @@ -1069,17 +1069,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/resolve-access.untouched.wat b/tests/compiler/resolve-access.untouched.wat index f91b27254c..d984a0a2af 100644 --- a/tests/compiler/resolve-access.untouched.wat +++ b/tests/compiler/resolve-access.untouched.wat @@ -7,14 +7,14 @@ (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 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 $i32_i32_=>_i64 (func (param i32 i32) (result i64))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i32_i64_=>_none (func (param i32 i64))) + (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -52,7 +52,6 @@ (data (i32.const 2172) "\\\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00H\00\00\000\001\002\003\004\005\006\007\008\009\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\00\00\00\00\00") (data (i32.const 2272) "\06\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\02\02\00\00\00\00\00\00\02\t\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "arrayAccess" (func $resolve-access/arrayAccess)) (export "fieldAccess" (func $resolve-access/fieldAccess)) (export "propertyAccess" (func $resolve-access/propertyAccess)) diff --git a/tests/compiler/resolve-binary.optimized.wat b/tests/compiler/resolve-binary.optimized.wat index 346530940b..b4fcca726f 100644 --- a/tests/compiler/resolve-binary.optimized.wat +++ b/tests/compiler/resolve-binary.optimized.wat @@ -1,13 +1,13 @@ (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result 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 $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i64_i32_i64_i32_i64_=>_i32 (func (param i64 i32 i64 i32 i64) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i64_i32_i64_i32_i64_=>_i32 (func (param i64 i32 i64 i32 i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-binary/a (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -250,10 +250,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -281,20 +281,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 @@ -1388,17 +1390,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1776 diff --git a/tests/compiler/resolve-binary.untouched.wat b/tests/compiler/resolve-binary.untouched.wat index 5226bafe9d..7d3a95eb8e 100644 --- a/tests/compiler/resolve-binary.untouched.wat +++ b/tests/compiler/resolve-binary.untouched.wat @@ -6,17 +6,17 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 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_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) + (type $none_=>_i32 (func (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $resolve-binary/a (mut i32) (i32.const 0)) @@ -95,7 +95,6 @@ (data (i32.const 10188) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00p\00o\00w\00\00\00\00\00\00\00") (data (i32.const 10224) "\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\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/number/Bool#toString (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/resolve-elementaccess.optimized.wat b/tests/compiler/resolve-elementaccess.optimized.wat index f028db980e..7bd11c6571 100644 --- a/tests/compiler/resolve-elementaccess.optimized.wat +++ b/tests/compiler/resolve-elementaccess.optimized.wat @@ -5,14 +5,14 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $f32_=>_i32 (func (param f32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1121,17 +1121,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1504 @@ -4102,10 +4105,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -4133,20 +4136,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-elementaccess.untouched.wat b/tests/compiler/resolve-elementaccess.untouched.wat index 3760f257b0..c6879a5eed 100644 --- a/tests/compiler/resolve-elementaccess.untouched.wat +++ b/tests/compiler/resolve-elementaccess.untouched.wat @@ -7,17 +7,17 @@ (type $none_=>_none (func)) (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_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $f32_i32_=>_i32 (func (param f32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) + (type $f32_i32_=>_i32 (func (param f32 i32) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -78,7 +78,6 @@ (data (i32.const 3740) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\001\001\00\00\00\00\00\00\00\00\00") (data (i32.const 3776) "\06\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\01\19\00\00\02\00\00\00A\00\00\00\05\00\00\00A\00\00\00\02\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/resolve-function-expression.optimized.wat b/tests/compiler/resolve-function-expression.optimized.wat index 6b1d64e078..f7b7df0d49 100644 --- a/tests/compiler/resolve-function-expression.optimized.wat +++ b/tests/compiler/resolve-function-expression.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1084,17 +1084,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1792 @@ -2081,10 +2084,7 @@ br_if $__inlined_func$~lib/string/String.__eq drop i32.const 0 - i32.const 3408 - i32.const 0 local.get $1 - select i32.eqz br_if $__inlined_func$~lib/string/String.__eq drop @@ -2110,13 +2110,13 @@ local.tee $0 i32.const 7 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $2 local.tee $1 i32.const 4 i32.ge_u select - i32.eqz if loop $do-continue|0 local.get $0 diff --git a/tests/compiler/resolve-function-expression.untouched.wat b/tests/compiler/resolve-function-expression.untouched.wat index 7174e25b13..99d36bada8 100644 --- a/tests/compiler/resolve-function-expression.untouched.wat +++ b/tests/compiler/resolve-function-expression.untouched.wat @@ -6,12 +6,12 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) diff --git a/tests/compiler/resolve-nested.optimized.wat b/tests/compiler/resolve-nested.optimized.wat index 1b85176177..4a988d23b6 100644 --- a/tests/compiler/resolve-nested.optimized.wat +++ b/tests/compiler/resolve-nested.optimized.wat @@ -5,9 +5,9 @@ (type $i32_i32_=>_none (func (param i32 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_=>_none (func (param i32 i32 i32 i32 i32 i32))) (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) + (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1053,17 +1053,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/resolve-nested.untouched.wat b/tests/compiler/resolve-nested.untouched.wat index 32ada90a5c..1820a44757 100644 --- a/tests/compiler/resolve-nested.untouched.wat +++ b/tests/compiler/resolve-nested.untouched.wat @@ -5,11 +5,11 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) + (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $resolve-nested/Outer.Inner.a (mut i32) (i32.const 0)) (global $resolve-nested/Outer.Inner.b (mut i32) (i32.const 0)) @@ -54,7 +54,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\06\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\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "Outer.InnerClass" (global $resolve-nested/Outer.InnerClass)) (export "Outer.Inner.EvenInnerClass" (global $resolve-nested/Outer.Inner.EvenInnerClass)) (export "memory" (memory $0)) diff --git a/tests/compiler/resolve-new.optimized.wat b/tests/compiler/resolve-new.optimized.wat index d015ce8fa5..502e4e81c3 100644 --- a/tests/compiler/resolve-new.optimized.wat +++ b/tests/compiler/resolve-new.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1049,17 +1049,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/resolve-new.untouched.wat b/tests/compiler/resolve-new.untouched.wat index 4e69d703fd..32eda1ab6a 100644 --- a/tests/compiler/resolve-new.untouched.wat +++ b/tests/compiler/resolve-new.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -37,7 +37,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/resolve-propertyaccess.optimized.wat b/tests/compiler/resolve-propertyaccess.optimized.wat index 5c60253bf6..e9cd3e6928 100644 --- a/tests/compiler/resolve-propertyaccess.optimized.wat +++ b/tests/compiler/resolve-propertyaccess.optimized.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1084,17 +1084,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1616 @@ -1764,10 +1767,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -1795,20 +1798,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-propertyaccess.untouched.wat b/tests/compiler/resolve-propertyaccess.untouched.wat index 43c71aa342..9e67cfdb52 100644 --- a/tests/compiler/resolve-propertyaccess.untouched.wat +++ b/tests/compiler/resolve-propertyaccess.untouched.wat @@ -7,11 +7,11 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-propertyaccess/Namespace.member i32 (i32.const 1)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -68,7 +68,6 @@ (data (i32.const 2620) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\008\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 2656) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/util/number/decimalCount32 (param $0 i32) (result i32) diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index 51fd751aea..530e39c7a2 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -1088,17 +1088,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1616 @@ -1872,10 +1875,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -1903,20 +1906,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index 8c7ab33c96..1a756f89c8 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -1,21 +1,21 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (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_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-ternary/b (mut i32) (i32.const 1)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) diff --git a/tests/compiler/resolve-unary.optimized.wat b/tests/compiler/resolve-unary.optimized.wat index 3cb3074983..ee80174999 100644 --- a/tests/compiler/resolve-unary.optimized.wat +++ b/tests/compiler/resolve-unary.optimized.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1104,17 +1104,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1616 @@ -1784,10 +1787,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -1815,20 +1818,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-unary.untouched.wat b/tests/compiler/resolve-unary.untouched.wat index 93609cf020..18da1fab02 100644 --- a/tests/compiler/resolve-unary.untouched.wat +++ b/tests/compiler/resolve-unary.untouched.wat @@ -6,12 +6,12 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -65,7 +65,6 @@ (data (i32.const 2668) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00i\00-\00-\00\00\00\00\00\00\00") (data (i32.const 2704) "\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\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/util/number/decimalCount32 (param $0 i32) (result i32) diff --git a/tests/compiler/retain-i32.untouched.wat b/tests/compiler/retain-i32.untouched.wat index 9e07d285b9..d9f39ee703 100644 --- a/tests/compiler/retain-i32.untouched.wat +++ b/tests/compiler/retain-i32.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128)) @@ -21,7 +21,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $retain-i32/test (param $0 i32) (param $1 i32) diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat index 8b15381f84..2a8639e75a 100644 --- a/tests/compiler/rt/finalize.optimized.wat +++ b/tests/compiler/rt/finalize.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $rt/finalize/expect (mut i32) (i32.const 0)) @@ -1062,17 +1062,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/rt/finalize.untouched.wat b/tests/compiler/rt/finalize.untouched.wat index fa8d7a379b..4bfff2000c 100644 --- a/tests/compiler/rt/finalize.untouched.wat +++ b/tests/compiler/rt/finalize.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $rt/finalize/expect (mut i32) (i32.const 0)) (global $rt/finalize/ran (mut i32) (i32.const 0)) @@ -40,7 +40,6 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/rt/ids.untouched.wat b/tests/compiler/rt/ids.untouched.wat index e0aa4ac445..dc9a07c925 100644 --- a/tests/compiler/rt/ids.untouched.wat +++ b/tests/compiler/rt/ids.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:rt/ids diff --git a/tests/compiler/rt/instanceof.optimized.wat b/tests/compiler/rt/instanceof.optimized.wat index 2f088c4a51..fb319b27de 100644 --- a/tests/compiler/rt/instanceof.optimized.wat +++ b/tests/compiler/rt/instanceof.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1087,17 +1087,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/rt/instanceof.untouched.wat b/tests/compiler/rt/instanceof.untouched.wat index b0dd9f536a..3556fc4609 100644 --- a/tests/compiler/rt/instanceof.untouched.wat +++ b/tests/compiler/rt/instanceof.untouched.wat @@ -6,8 +6,8 @@ (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -47,7 +47,6 @@ (data (i32.const 412) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00r\00t\00/\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 480) "\06\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\03\00\00\00 \00\00\00\04\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/rt/runtime-incremental-export.optimized.wat b/tests/compiler/rt/runtime-incremental-export.optimized.wat index f6d53b32c4..7fa1457bb2 100644 --- a/tests/compiler/rt/runtime-incremental-export.optimized.wat +++ b/tests/compiler/rt/runtime-incremental-export.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param 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 $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 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1062,17 +1062,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/rt/runtime-incremental-export.untouched.wat b/tests/compiler/rt/runtime-incremental-export.untouched.wat index ab3b34728b..44b8e896a9 100644 --- a/tests/compiler/rt/runtime-incremental-export.untouched.wat +++ b/tests/compiler/rt/runtime-incremental-export.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,7 +38,6 @@ (data (i32.const 476) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00O\00b\00j\00e\00c\00t\00 \00i\00s\00 \00n\00o\00t\00 \00p\00i\00n\00n\00e\00d\00\00\00\00\00") (data (i32.const 544) "\03\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) - (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/itcms/__new)) (export "__pin" (func $~lib/rt/itcms/__pin)) (export "__unpin" (func $~lib/rt/itcms/__unpin)) diff --git a/tests/compiler/rt/runtime-incremental.untouched.wat b/tests/compiler/rt/runtime-incremental.untouched.wat index f4d95ad56d..700fa1f9a6 100644 --- a/tests/compiler/rt/runtime-incremental.untouched.wat +++ b/tests/compiler/rt/runtime-incremental.untouched.wat @@ -4,6 +4,5 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/rt/runtime-minimal-export.optimized.wat b/tests/compiler/rt/runtime-minimal-export.optimized.wat index 3971c2f831..4a30a4aea5 100644 --- a/tests/compiler/rt/runtime-minimal-export.optimized.wat +++ b/tests/compiler/rt/runtime-minimal-export.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -1336,17 +1336,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $3 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1184 diff --git a/tests/compiler/rt/runtime-minimal-export.untouched.wat b/tests/compiler/rt/runtime-minimal-export.untouched.wat index 4a4b8da36f..f69cc7b58e 100644 --- a/tests/compiler/rt/runtime-minimal-export.untouched.wat +++ b/tests/compiler/rt/runtime-minimal-export.untouched.wat @@ -28,7 +28,6 @@ (data (i32.const 400) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 432) "\03\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) - (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/tcms/__new)) (export "__pin" (func $~lib/rt/tcms/__pin)) (export "__unpin" (func $~lib/rt/tcms/__unpin)) diff --git a/tests/compiler/rt/runtime-minimal.untouched.wat b/tests/compiler/rt/runtime-minimal.untouched.wat index 00fc29c6cc..bffe105a3d 100644 --- a/tests/compiler/rt/runtime-minimal.untouched.wat +++ b/tests/compiler/rt/runtime-minimal.untouched.wat @@ -1,6 +1,5 @@ (module (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/rt/runtime-stub-export.optimized.wat b/tests/compiler/rt/runtime-stub-export.optimized.wat index 7a9ee9f9ef..13f4d06bf4 100644 --- a/tests/compiler/rt/runtime-stub-export.optimized.wat +++ b/tests/compiler/rt/runtime-stub-export.optimized.wat @@ -1,9 +1,9 @@ (module (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/rt/__rtti_base i32 (i32.const 1168)) diff --git a/tests/compiler/rt/runtime-stub-export.untouched.wat b/tests/compiler/rt/runtime-stub-export.untouched.wat index 481f696f34..0c8ca82e54 100644 --- a/tests/compiler/rt/runtime-stub-export.untouched.wat +++ b/tests/compiler/rt/runtime-stub-export.untouched.wat @@ -1,8 +1,8 @@ (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 $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -15,7 +15,6 @@ (data (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00s\00t\00u\00b\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 144) "\03\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) - (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/stub/__new)) (export "__pin" (func $~lib/rt/stub/__pin)) (export "__unpin" (func $~lib/rt/stub/__unpin)) diff --git a/tests/compiler/rt/runtime-stub.untouched.wat b/tests/compiler/rt/runtime-stub.untouched.wat index 00fc29c6cc..bffe105a3d 100644 --- a/tests/compiler/rt/runtime-stub.untouched.wat +++ b/tests/compiler/rt/runtime-stub.untouched.wat @@ -1,6 +1,5 @@ (module (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/scoped.untouched.wat b/tests/compiler/scoped.untouched.wat index 664f2e8fc3..f87183185e 100644 --- a/tests/compiler/scoped.untouched.wat +++ b/tests/compiler/scoped.untouched.wat @@ -9,7 +9,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $scoped/fn (param $0 i32) diff --git a/tests/compiler/static-this.untouched.wat b/tests/compiler/static-this.untouched.wat index 2d695fd6a5..11d91212bf 100644 --- a/tests/compiler/static-this.untouched.wat +++ b/tests/compiler/static-this.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $none_=>_i32 (func (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))) (global $static-this/Foo.bar (mut i32) (i32.const 42)) (global $~lib/memory/__data_end i32 (i32.const 60)) @@ -10,7 +10,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $static-this/Foo.getBar (result i32) diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index ead727b809..8bcbee5535 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -61,13 +61,13 @@ local.tee $2 i32.const 7 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $1 local.tee $0 i32.const 4 i32.ge_u select - i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index ded68ad72b..12bf8213b3 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -1,10 +1,10 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) + (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))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 284)) @@ -16,7 +16,6 @@ (data (i32.const 124) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 252) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "i32ArrayArrayElementAccess" (func $export:std/array-access/i32ArrayArrayElementAccess)) (export "stringArrayPropertyAccess" (func $export:std/array-access/stringArrayPropertyAccess)) diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index c4d0037a4b..a13b011767 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) @@ -1142,17 +1142,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1744 @@ -1849,11 +1852,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 5cbfefc3df..1cad1167b7 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -53,7 +53,6 @@ (data (i32.const 700) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 768) "\t\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00B\08\00\00\00\00\00\00\02\t\00\00\00\00\00\00 \00\00\00\00\00\00\00\02A\00\00\00\00\00\00 \00\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/array/Array#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index f9716db932..20e15a7958 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -11,15 +11,15 @@ (type $none_=>_none (func)) (type $none_=>_f64 (func (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) + (type $i64_=>_none (func (param i64))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i64_=>_none (func (param i64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (import "env" "seed" (func $~lib/builtins/seed (result f64))) @@ -1512,17 +1512,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1488 @@ -2442,11 +2445,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 @@ -5937,16 +5943,17 @@ (local $4 i32) (local $5 i32) (local $6 i32) + i32.const 1 local.get $1 - i32.const 0 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 + i32.eqz local.get $0 local.get $1 i32.eq select select - i32.eqz if i32.const 0 return @@ -5984,14 +5991,6 @@ return end block $__inlined_func$~lib/util/string/compareImpl (result i32) - local.get $0 - i32.const 7 - i32.and - local.get $1 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $6 local.get $5 local.get $5 @@ -6001,8 +6000,18 @@ local.tee $3 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $0 + i32.const 7 + i32.and + local.get $1 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $0 @@ -6082,10 +6091,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -6110,20 +6119,23 @@ end block $__inlined_func$~lib/util/string/compareImpl (result i32) local.get $0 - local.tee $3 - i32.const 7 - i32.and - local.get $1 - i32.const 7 - i32.and - i32.or - i32.const 1 + local.set $3 local.get $2 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $3 + i32.const 7 + i32.and + local.get $1 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $3 diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 4517210ada..5e8a1ff554 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -9,25 +9,25 @@ (type $none_=>_none (func)) (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) - (type $none_=>_f64 (func (result f64))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) + (type $none_=>_f64 (func (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i64_=>_i64 (func (param i64) (result i64))) (type $i64_=>_none (func (param i64))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i64_=>_i64 (func (param i64) (result i64))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (import "env" "seed" (func $~lib/builtins/seed (result f64))) diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 0826be898f..60156b3fd5 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -1059,17 +1059,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 59208e9c67..753029cb35 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -2,8 +2,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 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_=>_i32 (func (param i32 i32 i32 i32) (result i32))) @@ -43,7 +43,6 @@ (data (i32.const 620) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 688) "\10\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\02\t\00\00\00\00\00\00A\08\00\00\02\00\00\00A\00\00\00\02\00\00\00A\00\00\00\02\00\00\00\81\08\00\00\02\00\00\00\81\00\00\00\02\00\00\00\01\t\00\00\02\00\00\00\01\01\00\00\02\00\00\00\01\n\00\00\02\00\00\00\01\02\00\00\02\00\00\00\01\19\00\00\02\00\00\00\01\1a\00\00\02\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 22ff198433..c1bc285939 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -5,14 +5,14 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) + (type $i32_f64_i32_=>_none (func (param i32 f64 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) - (type $i32_f64_i32_=>_none (func (param i32 f64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1065,17 +1065,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index c2cb3f4fbb..75add628d2 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -3,19 +3,19 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) (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 $i32_i32_i32_=>_i64 (func (param i32 i32 i32) (result i64))) (type $i32_i32_i64_i32_=>_none (func (param i32 i32 i64 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_i32_=>_i64 (func (param i32 i32 i32) (result i64))) + (type $i32_i32_f32_i32_=>_none (func (param i32 i32 f32 i32))) + (type $i32_i32_f64_i32_=>_none (func (param i32 i32 f64 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) (type $i64_=>_i64 (func (param i64) (result i64))) + (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) (type $i32_i32_i32_=>_f64 (func (param i32 i32 i32) (result f64))) - (type $i32_i32_f32_i32_=>_none (func (param i32 i32 f32 i32))) - (type $i32_i32_f64_i32_=>_none (func (param i32 i32 f64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -50,7 +50,6 @@ (data (i32.const 652) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 720) "\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\00A\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index c89a8613c8..196385c5a2 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -6,12 +6,12 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/date/_day (mut i32) (i32.const 0)) (global $~lib/date/_month (mut i32) (i32.const 0)) @@ -1424,17 +1424,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1536 @@ -3536,19 +3539,22 @@ i32.const 1 i32.shl i32.add - local.tee $1 - i32.const 7 - i32.and - local.get $2 - i32.const 7 - i32.and - i32.or - i32.const 1 + local.set $1 local.get $3 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $1 + i32.const 7 + i32.and + local.get $2 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $1 @@ -3619,10 +3625,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -3759,11 +3765,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 @@ -9613,7 +9622,7 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - i32.const 0 + i32.const 1 i32.const 1868 i32.load i32.const 1 @@ -9621,6 +9630,7 @@ i32.const 1 i32.shl local.tee $3 + i32.eqz local.get $0 i32.const 20 i32.sub @@ -9636,7 +9646,6 @@ local.tee $2 i32.gt_u select - i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index 877b20efb8..cf459b4d5e 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -2,22 +2,22 @@ (type $i32_i32_=>_none (func (param i32 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 (func (param i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_i64_=>_i64 (func (param i32 i64) (result i64))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) + (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) + (type $i32_i64_=>_i64 (func (param i32 i64) (result i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/date/_day (mut i32) (i32.const 0)) (global $~lib/date/_month (mut i32) (i32.const 0)) @@ -146,7 +146,6 @@ (data (i32.const 6396) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\001\00Z\00\00\00\00\00\00\00") (data (i32.const 6480) "\07\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\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00\02\t\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/date/daysSinceEpoch (param $0 i32) (param $1 i32) (param $2 i32) (result i32) diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 72f358b8ca..6fe5434804 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17788)) diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 0f361c1678..911e6494c9 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -1,9 +1,9 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 380)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16764)) @@ -20,7 +20,6 @@ (data (i32.const 284) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 332) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 87a0ba14a8..7d0fd43a4f 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -4,19 +4,19 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_f64_=>_none (func (param i32 f64))) (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) + (type $i32_f64_=>_none (func (param i32 f64))) (type $i32_f64_i32_=>_none (func (param i32 f64 i32))) + (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1073,17 +1073,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index fc7e0b30b7..4a43797f69 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -6,29 +6,29 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_f64_=>_none (func (param i32 f64))) + (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) + (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i64_=>_i32 (func (param i32 i64 i64) (result i32))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $none_=>_i32 (func (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (result i32))) (type $i32_f64_f64_=>_i32 (func (param i32 f64 f64) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -63,7 +63,6 @@ (data (i32.const 684) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 736) " \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\10\89\10\00\00\00\00\00B\08\00\00\00\00\00\00\02\t\00\00\00\00\00\00P\88\10\00\00\00\00\00\10\t\12\00\00\00\00\00\10\89\00\00\00\00\00\00B\00\00\00\00\00\00\00P\80\00\00\00\00\00\00\10\t\11\00\00\00\00\00\82\08\00\00\00\00\00\00\90\08\11\00\00\00\00\00\10\t\01\00\00\00\00\00\82\00\00\00\00\00\00\00\90\00\01\00\00\00\00\00\10\t\02\00\00\00\00\00\02\01\00\00\00\00\00\00\10\01\02\00\00\00\00\00\10\t\14\00\00\00\00\00\02\n\00\00\00\00\00\00\10\n\14\00\00\00\00\00\10\t\04\00\00\00\00\00\02\02\00\00\00\00\00\00\10\02\04\00\00\00\00\00\10\t2\00\00\00\00\00\02\19\00\00\00\00\00\00\10\192\00\00\00\00\00\10\t4\00\00\00\00\00\02\1a\00\00\00\00\00\00\10\1a4\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 343fd59f3d..55559f5afd 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -5,22 +5,22 @@ (type $f32_=>_f32 (func (param f32) (result f32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $f64_f64_f64_f64_=>_i32 (func (param f64 f64 f64 f64) (result i32))) + (type $none_=>_none (func)) + (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $f32_f32_f32_f32_=>_i32 (func (param f32 f32 f32 f32) (result i32))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $none_=>_f64 (func (result f64))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) - (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) - (type $none_=>_none (func)) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $f32_i32_f32_=>_i32 (func (param f32 i32 f32) (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) (type $i64_=>_none (func (param i64))) - (type $f64_f64_i32_=>_f64 (func (param f64 f64 i32) (result f64))) (type $f64_=>_none (func (param f64))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i64_i64_i64_i64_i64_=>_none (func (param i64 i64 i64 i64 i64))) - (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $f32_i32_f32_=>_i32 (func (param f32 i32 f32) (result i32))) + (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) + (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) + (type $f64_f64_i32_=>_f64 (func (param f64 f64 i32) (result f64))) (import "Math" "E" (global $~lib/bindings/Math/E f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN10" (global $~lib/bindings/Math/LN10 f64)) @@ -6085,13 +6085,13 @@ local.get $5 f64.reinterpret_i64 local.tee $0 - i64.const 0 + i32.const 1 local.get $4 + i64.eqz local.get $11 i32.const 2047 i32.eq select - i64.eqz br_if $__inlined_func$~lib/math/NativeMath.hypot drop local.get $0 @@ -6245,14 +6245,15 @@ local.get $0 local.get $1 f32.add + i32.const 1 local.get $5 local.get $4 i32.sub i32.const 209715200 i32.ge_u i32.const 1 - i32.const 0 local.get $4 + i32.eqz local.get $5 i32.const 2139095040 i32.ge_u @@ -6391,12 +6392,12 @@ local.get $6 i64.const 32 i64.shl - i64.const 1 + i64.eqz + i32.const 0 local.get $4 i32.const 1072693248 i32.eq select - i64.eqz if f64.const 0 local.set $3 diff --git a/tests/compiler/std/math.untouched.wat b/tests/compiler/std/math.untouched.wat index 9919a8c6d9..5b62b7264e 100644 --- a/tests/compiler/std/math.untouched.wat +++ b/tests/compiler/std/math.untouched.wat @@ -1,33 +1,33 @@ (module (type $f64_=>_f64 (func (param f64) (result f64))) - (type $f64_f64_f64_i32_=>_i32 (func (param f64 f64 f64 i32) (result i32))) (type $f32_f32_f32_i32_=>_i32 (func (param f32 f32 f32 i32) (result i32))) + (type $f64_f64_f64_i32_=>_i32 (func (param f64 f64 f64 i32) (result i32))) (type $f32_=>_f32 (func (param f32) (result f32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $f64_f64_f64_f64_i32_=>_i32 (func (param f64 f64 f64 f64 i32) (result i32))) (type $f32_f32_f32_f32_i32_=>_i32 (func (param f32 f32 f32 f32 i32) (result i32))) + (type $f64_f64_f64_f64_i32_=>_i32 (func (param f64 f64 f64 f64 i32) (result i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $none_=>_f64 (func (result f64))) - (type $f64_=>_i32 (func (param f64) (result i32))) (type $none_=>_none (func)) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) - (type $f64_f64_f64_=>_f64 (func (param f64 f64 f64) (result f64))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i64_=>_none (func (param i64))) + (type $f64_=>_none (func (param f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) - (type $f32_i32_=>_f32 (func (param f32 i32) (result f32))) - (type $f32_f32_f32_=>_f32 (func (param f32 f32 f32) (result f32))) - (type $f64_i32_f64_f64_i32_=>_i32 (func (param f64 i32 f64 f64 i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i64_i64_i64_i64_i64_i32_=>_i32 (func (param i64 i64 i64 i64 i64 i32) (result i32))) (type $f32_i32_f32_f32_i32_=>_i32 (func (param f32 i32 f32 f32 i32) (result i32))) + (type $f64_i32_f64_f64_i32_=>_i32 (func (param f64 i32 f64 f64 i32) (result i32))) (type $f64_i64_=>_i32 (func (param f64 i64) (result i32))) (type $i64_=>_i64 (func (param i64) (result i64))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i64_=>_none (func (param i64))) + (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $none_=>_f32 (func (result f32))) + (type $f32_i32_=>_f32 (func (param f32 i32) (result f32))) + (type $f32_f32_f32_=>_f32 (func (param f32 f32 f32) (result f32))) + (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $f64_f64_i32_=>_f64 (func (param f64 f64 i32) (result f64))) - (type $f64_=>_none (func (param f64))) - (type $i64_i64_i64_i64_i64_i32_=>_i32 (func (param i64 i64 i64 i64 i64 i32) (result i32))) - (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $f64_f64_f64_=>_f64 (func (param f64 f64 f64) (result f64))) (import "Math" "E" (global $~lib/bindings/Math/E f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN10" (global $~lib/bindings/Math/LN10 f64)) @@ -126,7 +126,6 @@ (data (i32.const 9248) "\00\00\00\00\00\a0\f6?\00\00\00\00\00\00\00\00\00\c8\b9\f2\82,\d6\bf\80V7($\b4\fa<\00\00\00\00\00\80\f6?\00\00\00\00\00\00\00\00\00\08X\bf\bd\d1\d5\bf \f7\e0\d8\08\a5\1c\bd\00\00\00\00\00`\f6?\00\00\00\00\00\00\00\00\00XE\17wv\d5\bfmP\b6\d5\a4b#\bd\00\00\00\00\00@\f6?\00\00\00\00\00\00\00\00\00\f8-\87\ad\1a\d5\bf\d5g\b0\9e\e4\84\e6\bc\00\00\00\00\00 \f6?\00\00\00\00\00\00\00\00\00xw\95_\be\d4\bf\e0>)\93i\1b\04\bd\00\00\00\00\00\00\f6?\00\00\00\00\00\00\00\00\00`\1c\c2\8ba\d4\bf\cc\84LH/\d8\13=\00\00\00\00\00\e0\f5?\00\00\00\00\00\00\00\00\00\a8\86\860\04\d4\bf:\0b\82\ed\f3B\dc<\00\00\00\00\00\c0\f5?\00\00\00\00\00\00\00\00\00HiUL\a6\d3\bf`\94Q\86\c6\b1 =\00\00\00\00\00\a0\f5?\00\00\00\00\00\00\00\00\00\80\98\9a\ddG\d3\bf\92\80\c5\d4MY%=\00\00\00\00\00\80\f5?\00\00\00\00\00\00\00\00\00 \e1\ba\e2\e8\d2\bf\d8+\b7\99\1e{&=\00\00\00\00\00`\f5?\00\00\00\00\00\00\00\00\00\88\de\13Z\89\d2\bf?\b0\cf\b6\14\ca\15=\00\00\00\00\00`\f5?\00\00\00\00\00\00\00\00\00\88\de\13Z\89\d2\bf?\b0\cf\b6\14\ca\15=\00\00\00\00\00@\f5?\00\00\00\00\00\00\00\00\00x\cf\fbA)\d2\bfv\daS($Z\16\bd\00\00\00\00\00 \f5?\00\00\00\00\00\00\00\00\00\98i\c1\98\c8\d1\bf\04T\e7h\bc\af\1f\bd\00\00\00\00\00\00\f5?\00\00\00\00\00\00\00\00\00\a8\ab\ab\\g\d1\bf\f0\a8\823\c6\1f\1f=\00\00\00\00\00\e0\f4?\00\00\00\00\00\00\00\00\00H\ae\f9\8b\05\d1\bffZ\05\fd\c4\a8&\bd\00\00\00\00\00\c0\f4?\00\00\00\00\00\00\00\00\00\90s\e2$\a3\d0\bf\0e\03\f4~\eek\0c\bd\00\00\00\00\00\a0\f4?\00\00\00\00\00\00\00\00\00\d0\b4\94%@\d0\bf\7f-\f4\9e\b86\f0\bc\00\00\00\00\00\a0\f4?\00\00\00\00\00\00\00\00\00\d0\b4\94%@\d0\bf\7f-\f4\9e\b86\f0\bc\00\00\00\00\00\80\f4?\00\00\00\00\00\00\00\00\00@^m\18\b9\cf\bf\87<\99\ab*W\0d=\00\00\00\00\00`\f4?\00\00\00\00\00\00\00\00\00`\dc\cb\ad\f0\ce\bf$\af\86\9c\b7&+=\00\00\00\00\00@\f4?\00\00\00\00\00\00\00\00\00\f0*n\07\'\ce\bf\10\ff?TO/\17\bd\00\00\00\00\00 \f4?\00\00\00\00\00\00\00\00\00\c0Ok!\\\cd\bf\1bh\ca\bb\91\ba!=\00\00\00\00\00\00\f4?\00\00\00\00\00\00\00\00\00\a0\9a\c7\f7\8f\cc\bf4\84\9fhOy\'=\00\00\00\00\00\00\f4?\00\00\00\00\00\00\00\00\00\a0\9a\c7\f7\8f\cc\bf4\84\9fhOy\'=\00\00\00\00\00\e0\f3?\00\00\00\00\00\00\00\00\00\90-t\86\c2\cb\bf\8f\b7\8b1\b0N\19=\00\00\00\00\00\c0\f3?\00\00\00\00\00\00\00\00\00\c0\80N\c9\f3\ca\bff\90\cd?cN\ba<\00\00\00\00\00\a0\f3?\00\00\00\00\00\00\00\00\00\b0\e2\1f\bc#\ca\bf\ea\c1F\dcd\8c%\bd\00\00\00\00\00\a0\f3?\00\00\00\00\00\00\00\00\00\b0\e2\1f\bc#\ca\bf\ea\c1F\dcd\8c%\bd\00\00\00\00\00\80\f3?\00\00\00\00\00\00\00\00\00P\f4\9cZR\c9\bf\e3\d4\c1\04\d9\d1*\bd\00\00\00\00\00`\f3?\00\00\00\00\00\00\00\00\00\d0 e\a0\7f\c8\bf\t\fa\db\7f\bf\bd+=\00\00\00\00\00@\f3?\00\00\00\00\00\00\00\00\00\e0\10\02\89\ab\c7\bfXJSr\90\db+=\00\00\00\00\00@\f3?\00\00\00\00\00\00\00\00\00\e0\10\02\89\ab\c7\bfXJSr\90\db+=\00\00\00\00\00 \f3?\00\00\00\00\00\00\00\00\00\d0\19\e7\0f\d6\c6\bff\e2\b2\a3j\e4\10\bd\00\00\00\00\00\00\f3?\00\00\00\00\00\00\00\00\00\90\a7p0\ff\c5\bf9P\10\9fC\9e\1e\bd\00\00\00\00\00\00\f3?\00\00\00\00\00\00\00\00\00\90\a7p0\ff\c5\bf9P\10\9fC\9e\1e\bd\00\00\00\00\00\e0\f2?\00\00\00\00\00\00\00\00\00\b0\a1\e3\e5&\c5\bf\8f[\07\90\8b\de \bd\00\00\00\00\00\c0\f2?\00\00\00\00\00\00\00\00\00\80\cbl+M\c4\bf\11\0e\bd\00\00\00\00\00\e0\ed?\00\00\00\00\00\00\00\00\00`F\d1;\97\b1?\9b\9e\0dV]2%\bd\00\00\00\00\00\a0\ed?\00\00\00\00\00\00\00\00\00\e0\d1\a7\f5\bd\b3?\d7N\db\a5^\c8,=\00\00\00\00\00`\ed?\00\00\00\00\00\00\00\00\00\a0\97MZ\e9\b5?\1e\1d]<\06i,\bd\00\00\00\00\00@\ed?\00\00\00\00\00\00\00\00\00\c0\ea\n\d3\00\b7?2\ed\9d\a9\8d\1e\ec<\00\00\00\00\00\00\ed?\00\00\00\00\00\00\00\00\00@Y]^3\b9?\daG\bd:\\\11#=\00\00\00\00\00\c0\ec?\00\00\00\00\00\00\00\00\00`\ad\8d\c8j\bb?\e5h\f7+\80\90\13\bd\00\00\00\00\00\a0\ec?\00\00\00\00\00\00\00\00\00@\bc\01X\88\bc?\d3\acZ\c6\d1F&=\00\00\00\00\00`\ec?\00\00\00\00\00\00\00\00\00 \n\839\c7\be?\e0E\e6\afh\c0-\bd\00\00\00\00\00@\ec?\00\00\00\00\00\00\00\00\00\e0\db9\91\e8\bf?\fd\n\a1O\d64%\bd\00\00\00\00\00\00\ec?\00\00\00\00\00\00\00\00\00\e0\'\82\8e\17\c1?\f2\07-\cex\ef!=\00\00\00\00\00\e0\eb?\00\00\00\00\00\00\00\00\00\f0#~+\aa\c1?4\998D\8e\a7,=\00\00\00\00\00\a0\eb?\00\00\00\00\00\00\00\00\00\80\86\0ca\d1\c2?\a1\b4\81\cbl\9d\03=\00\00\00\00\00\80\eb?\00\00\00\00\00\00\00\00\00\90\15\b0\fce\c3?\89rK#\a8/\c6<\00\00\00\00\00@\eb?\00\00\00\00\00\00\00\00\00\b03\83=\91\c4?x\b6\fdTy\83%=\00\00\00\00\00 \eb?\00\00\00\00\00\00\00\00\00\b0\a1\e4\e5\'\c5?\c7}i\e5\e83&=\00\00\00\00\00\e0\ea?\00\00\00\00\00\00\00\00\00\10\8c\beNW\c6?x.<,\8b\cf\19=\00\00\00\00\00\c0\ea?\00\00\00\00\00\00\00\00\00pu\8b\12\f0\c6?\e1!\9c\e5\8d\11%\bd\00\00\00\00\00\a0\ea?\00\00\00\00\00\00\00\00\00PD\85\8d\89\c7?\05C\91p\10f\1c\bd\00\00\00\00\00`\ea?\00\00\00\00\00\00\00\00\00\009\eb\af\be\c8?\d1,\e9\aaT=\07\bd\00\00\00\00\00@\ea?\00\00\00\00\00\00\00\00\00\00\f7\dcZZ\c9?o\ff\a0X(\f2\07=\00\00\00\00\00\00\ea?\00\00\00\00\00\00\00\00\00\e0\8a<\ed\93\ca?i!VPCr(\bd\00\00\00\00\00\e0\e9?\00\00\00\00\00\00\00\00\00\d0[W\d81\cb?\aa\e1\acN\8d5\0c\bd\00\00\00\00\00\c0\e9?\00\00\00\00\00\00\00\00\00\e0;8\87\d0\cb?\b6\12TY\c4K-\bd\00\00\00\00\00\a0\e9?\00\00\00\00\00\00\00\00\00\10\f0\c6\fbo\cc?\d2+\96\c5r\ec\f1\bc\00\00\00\00\00`\e9?\00\00\00\00\00\00\00\00\00\90\d4\b0=\b1\cd?5\b0\15\f7*\ff*\bd\00\00\00\00\00@\e9?\00\00\00\00\00\00\00\00\00\10\e7\ff\0eS\ce?0\f4A`\'\12\c2<\00\00\00\00\00 \e9?\00\00\00\00\00\00\00\00\00\00\dd\e4\ad\f5\ce?\11\8e\bbe\15!\ca\bc\00\00\00\00\00\00\e9?\00\00\00\00\00\00\00\00\00\b0\b3l\1c\99\cf?0\df\0c\ca\ec\cb\1b=\00\00\00\00\00\c0\e8?\00\00\00\00\00\00\00\00\00XM`8q\d0?\91N\ed\16\db\9c\f8<\00\00\00\00\00\a0\e8?\00\00\00\00\00\00\00\00\00`ag-\c4\d0?\e9\ea<\16\8b\18\'=\00\00\00\00\00\80\e8?\00\00\00\00\00\00\00\00\00\e8\'\82\8e\17\d1?\1c\f0\a5c\0e!,\bd\00\00\00\00\00`\e8?\00\00\00\00\00\00\00\00\00\f8\ac\cb\\k\d1?\81\16\a5\f7\cd\9a+=\00\00\00\00\00@\e8?\00\00\00\00\00\00\00\00\00hZc\99\bf\d1?\b7\bdGQ\ed\a6,=\00\00\00\00\00 \e8?\00\00\00\00\00\00\00\00\00\b8\0emE\14\d2?\ea\baF\ba\de\87\n=\00\00\00\00\00\e0\e7?\00\00\00\00\00\00\00\00\00\90\dc|\f0\be\d2?\f4\04PJ\fa\9c*=\00\00\00\00\00\c0\e7?\00\00\00\00\00\00\00\00\00`\d3\e1\f1\14\d3?\b8_none (func)) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f32_f32_f32_=>_i32 (func (param f32 f32 f32) (result i32))) + (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (import "mod" "mod" (func $std/mod/mod (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) diff --git a/tests/compiler/std/mod.untouched.wat b/tests/compiler/std/mod.untouched.wat index 382666044f..08120fd376 100644 --- a/tests/compiler/std/mod.untouched.wat +++ b/tests/compiler/std/mod.untouched.wat @@ -1,12 +1,12 @@ (module - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $none_=>_none (func)) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) - (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $f32_f32_f32_=>_i32 (func (param f32 f32 f32) (result i32))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) + (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) + (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (import "mod" "mod" (func $std/mod/mod (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/mod/js i32 (i32.const 1)) @@ -16,7 +16,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "mod" (func $std/mod/mod)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/std/new.optimized.wat b/tests/compiler/std/new.optimized.wat index 564f94918e..431198a500 100644 --- a/tests/compiler/std/new.optimized.wat +++ b/tests/compiler/std/new.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1049,17 +1049,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 2e146335e4..4f5c2ba371 100644 --- a/tests/compiler/std/new.untouched.wat +++ b/tests/compiler/std/new.untouched.wat @@ -5,10 +5,10 @@ (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_f32_=>_none (func (param i32 f32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_f32_=>_none (func (param i32 f32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/new/AClass.aStaticField (mut i32) (i32.const 0)) @@ -40,7 +40,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $std/new/AClass#set:aField (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/object.optimized.wat b/tests/compiler/std/object.optimized.wat index 14c652d58d..e2aa506ddb 100644 --- a/tests/compiler/std/object.optimized.wat +++ b/tests/compiler/std/object.optimized.wat @@ -1,7 +1,7 @@ (module + (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17596)) (memory $0 1) @@ -29,10 +29,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -60,20 +60,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/object.untouched.wat b/tests/compiler/std/object.untouched.wat index f6c40ec4a8..d9b31e2443 100644 --- a/tests/compiler/std/object.untouched.wat +++ b/tests/compiler/std/object.untouched.wat @@ -1,11 +1,11 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 188)) @@ -18,7 +18,6 @@ (data (i32.const 124) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b\00\00\00\00\00\00\00\00\00") (data (i32.const 156) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/object/Object.is (param $0 f64) (param $1 f64) (result i32) diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 099c5f590d..0aa520f7b3 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1108,17 +1108,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 @@ -2361,9 +2364,11 @@ if (result i32) global.get $std/operator-overloading/f i32.load offset=4 + i32.eqz else - i32.const 1 + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1456 @@ -3151,23 +3156,23 @@ local.get $0 i32.load if (result i32) - i32.const 1 + i32.const 0 else local.get $0 i32.load offset=4 + i32.eqz end - i32.eqz global.set $std/operator-overloading/bres - global.get $std/operator-overloading/bres global.get $std/operator-overloading/excl i32.load if (result i32) - i32.const 1 + i32.const 0 else global.get $std/operator-overloading/excl i32.load offset=4 + i32.eqz end - i32.eqz + global.get $std/operator-overloading/bres i32.ne if i32.const 0 diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 8e9cf23cca..80656982bd 100644 --- a/tests/compiler/std/operator-overloading.untouched.wat +++ b/tests/compiler/std/operator-overloading.untouched.wat @@ -104,7 +104,6 @@ (data (i32.const 412) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00\00\00\00\00\00\00") (data (i32.const 496) "\06\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\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index f20ac84049..fdd2f6a6cb 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/pointer/one (mut i32) (i32.const 0)) (global $std/pointer/two (mut i32) (i32.const 0)) diff --git a/tests/compiler/std/pointer.untouched.wat b/tests/compiler/std/pointer.untouched.wat index aa23eef8ba..c98e2f2605 100644 --- a/tests/compiler/std/pointer.untouched.wat +++ b/tests/compiler/std/pointer.untouched.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/pointer/one (mut i32) (i32.const 0)) @@ -17,7 +17,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $std/pointer/Entry#set:key (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/polyfills.untouched.wat b/tests/compiler/std/polyfills.untouched.wat index 3cdafecc27..35ff491b8d 100644 --- a/tests/compiler/std/polyfills.untouched.wat +++ b/tests/compiler/std/polyfills.untouched.wat @@ -1,7 +1,7 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i64_=>_i64 (func (param i64) (result i64))) (type $none_=>_none (func)) + (type $i64_=>_i64 (func (param i64) (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 76)) @@ -10,7 +10,6 @@ (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/polyfills/bswap (param $0 i32) (result i32) diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 2e71a2df2a..990c5a8a91 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -7,15 +7,15 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_f64_=>_none (func (param i32 f64))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1066,17 +1066,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index c87a7d036f..c502a5c8e7 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -11,20 +11,20 @@ (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) + (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) - (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) - (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) + (type $i32_f32_=>_none (func (param i32 f32))) + (type $i32_f64_=>_none (func (param i32 f64))) (type $none_=>_i32 (func (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) - (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) - (type $i32_f64_=>_none (func (param i32 f64))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -58,7 +58,6 @@ (data (i32.const 572) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 624) "\17\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00H\08\00\00\00\00\00\00B\08\00\00\00\00\00\00H\00\00\00\00\00\00\00B\00\00\00\00\00\00\00\88\08\00\00\00\00\00\00\82\08\00\00\00\00\00\00\88\00\00\00\00\00\00\00\82\00\00\00\00\00\00\00\08\t\00\00\00\00\00\00\02\t\00\00\00\00\00\00\08\01\00\00\00\00\00\00\02\01\00\00\00\00\00\00\08\n\00\00\00\00\00\00\02\n\00\00\00\00\00\00\08\02\00\00\00\00\00\00\02\02\00\00\00\00\00\00\08\19\00\00\00\00\00\00\02\19\00\00\00\00\00\00\08\1a\00\00\00\00\00\00\02\1a\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/simd.untouched.wat b/tests/compiler/std/simd.untouched.wat index 196aa636d5..82bf172278 100644 --- a/tests/compiler/std/simd.untouched.wat +++ b/tests/compiler/std/simd.untouched.wat @@ -6,7 +6,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:std/simd diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 85e597f65d..320092808c 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -5,8 +5,8 @@ (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 $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_i64 (func (param i32) (result i64))) (type $i32_=>_f32 (func (param i32) (result f32))) (type $i32_=>_f64 (func (param i32) (result f64))) @@ -1104,17 +1104,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1904 diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index 2b38f50179..3c6c1436d7 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -3,14 +3,14 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) @@ -57,7 +57,6 @@ (data (i32.const 860) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 928) "\07\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\02\t\00\00\00\00\00\00\02\n\00\00\00\00\00\00\02\19\00\00\00\00\00\00\02\1a\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/array/Array#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index e28570b093..452b9ce3ad 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -1194,17 +1194,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1616 @@ -2851,11 +2854,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 @@ -2884,10 +2890,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -2915,20 +2921,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 @@ -4533,10 +4541,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop loop $while-continue|0 @@ -4601,10 +4609,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop loop $while-continue|07 @@ -4668,10 +4676,10 @@ i32.const 2 i32.shr_u local.tee $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $1 select - i32.eqz if i32.const -1 local.set $0 @@ -4720,10 +4728,10 @@ i32.const 2 i32.shr_u local.tee $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $1 select - i32.eqz if i32.const -1 local.set $0 diff --git a/tests/compiler/std/staticarray.untouched.wat b/tests/compiler/std/staticarray.untouched.wat index e5b5f5171d..d2ba5ed296 100644 --- a/tests/compiler/std/staticarray.untouched.wat +++ b/tests/compiler/std/staticarray.untouched.wat @@ -8,10 +8,10 @@ (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/staticarray/arr1 i32 (i32.const 32)) (global $std/staticarray/arr2 i32 (i32.const 256)) @@ -86,7 +86,6 @@ (data (i32.const 2012) ",\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10\00\00\00\02\00\00\00\05\00\00\00\t\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 2064) "\0c\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$\t\00\00\00\00\00\00 \00\00\00\00\00\00\00\04A\00\00\00\00\00\00\02\t\00\00\00\00\00\00\02\01\00\00\00\00\00\00\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00$\1a\00\00\00\00\00\00$\19\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/staticarray/StaticArray#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index 3511d4eab8..cce46cb702 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -6,8 +6,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $none_=>_i32 (func (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "string_casemapping" "toLowerCaseFromIndex" (func $std/string-casemapping/toLowerCaseFromIndex (param i32 i32) (result i32))) @@ -1497,17 +1497,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1424 @@ -3313,10 +3316,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -3344,20 +3347,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/string-casemapping.untouched.wat b/tests/compiler/std/string-casemapping.untouched.wat index 8bcea8fb01..cfb7e7640d 100644 --- a/tests/compiler/std/string-casemapping.untouched.wat +++ b/tests/compiler/std/string-casemapping.untouched.wat @@ -8,12 +8,12 @@ (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) - (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (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 "string_casemapping" "toLowerCaseFromIndex" (func $std/string-casemapping/toLowerCaseFromIndex (param i32 i32) (result i32))) (import "string_casemapping" "toUpperCaseFromIndex" (func $std/string-casemapping/toUpperCaseFromIndex (param i32 i32) (result i32))) @@ -217,7 +217,6 @@ (data (i32.const 19964) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00 \00e\00x\00p\00e\00c\00t\00U\00p\00p\00e\00r\00C\00o\00d\00e\00 \00=\00 \00\00\00\00\00\00\00") (data (i32.const 20032) "\04\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\a4\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index 80f0a35785..329dbafbc5 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -1071,17 +1071,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1488 @@ -2698,10 +2701,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -2729,20 +2732,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index c1cd7447e3..65f2c9be39 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -8,8 +8,8 @@ (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))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (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))) (global $std/string-encoding/str (mut i32) (i32.const 32)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -52,7 +52,6 @@ (data (i32.const 13948) "\cc\1c\00\00\00\00\00\00\00\00\00\00\01\00\00\00\ba\1c\00\00S\00e\00n\00t\00e\00n\00c\00e\00s\00 \00t\00h\00a\00t\00 \00c\00o\00n\00t\00a\00i\00n\00 \00a\00l\00l\00 \00l\00e\00t\00t\00e\00r\00s\00 \00c\00o\00m\00m\00o\00n\00l\00y\00 \00u\00s\00e\00d\00 \00i\00n\00 \00a\00 \00l\00a\00n\00g\00u\00a\00g\00e\00\n\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-\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\n\00\n\00M\00a\00r\00k\00u\00s\00 \00K\00u\00h\00n\00 \00<\00h\00t\00t\00p\00:\00/\00/\00w\00w\00w\00.\00c\00l\00.\00c\00a\00m\00.\00a\00c\00.\00u\00k\00/\00~\00m\00g\00k\002\005\00/\00>\00 \00-\00-\00 \002\000\001\002\00-\000\004\00-\001\001\00\n\00\n\00T\00h\00i\00s\00 \00i\00s\00 \00a\00n\00 \00e\00x\00a\00m\00p\00l\00e\00 \00o\00f\00 \00a\00 \00p\00l\00a\00i\00n\00-\00t\00e\00x\00t\00 \00f\00i\00l\00e\00 \00e\00n\00c\00o\00d\00e\00d\00 \00i\00n\00 \00U\00T\00F\00-\008\00.\00\n\00\n\00\n\00D\00a\00n\00i\00s\00h\00 \00(\00d\00a\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00Q\00u\00i\00z\00d\00e\00l\00t\00a\00g\00e\00r\00n\00e\00 \00s\00p\00i\00s\00t\00e\00 \00j\00o\00r\00d\00b\00\e6\00r\00 \00m\00e\00d\00 \00f\00l\00\f8\00d\00e\00,\00 \00m\00e\00n\00s\00 \00c\00i\00r\00k\00u\00s\00k\00l\00o\00v\00n\00e\00n\00\n\00 \00 \00W\00o\00l\00t\00h\00e\00r\00 \00s\00p\00i\00l\00l\00e\00d\00e\00 \00p\00\e5\00 \00x\00y\00l\00o\00f\00o\00n\00.\00\n\00 \00 \00(\00=\00 \00Q\00u\00i\00z\00 \00c\00o\00n\00t\00e\00s\00t\00a\00n\00t\00s\00 \00w\00e\00r\00e\00 \00e\00a\00t\00i\00n\00g\00 \00s\00t\00r\00a\00w\00b\00e\00r\00y\00 \00w\00i\00t\00h\00 \00c\00r\00e\00a\00m\00 \00w\00h\00i\00l\00e\00 \00W\00o\00l\00t\00h\00e\00r\00\n\00 \00 \00t\00h\00e\00 \00c\00i\00r\00c\00u\00s\00 \00c\00l\00o\00w\00n\00 \00p\00l\00a\00y\00e\00d\00 \00o\00n\00 \00x\00y\00l\00o\00p\00h\00o\00n\00e\00.\00)\00\n\00\n\00G\00e\00r\00m\00a\00n\00 \00(\00d\00e\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00F\00a\00l\00s\00c\00h\00e\00s\00 \00\dc\00b\00e\00n\00 \00v\00o\00n\00 \00X\00y\00l\00o\00p\00h\00o\00n\00m\00u\00s\00i\00k\00 \00q\00u\00\e4\00l\00t\00 \00j\00e\00d\00e\00n\00 \00g\00r\00\f6\00\df\00e\00r\00e\00n\00 \00Z\00w\00e\00r\00g\00\n\00 \00 \00(\00=\00 \00W\00r\00o\00n\00g\00f\00u\00l\00 \00p\00r\00a\00c\00t\00i\00c\00i\00n\00g\00 \00o\00f\00 \00x\00y\00l\00o\00p\00h\00o\00n\00e\00 \00m\00u\00s\00i\00c\00 \00t\00o\00r\00t\00u\00r\00e\00s\00 \00e\00v\00e\00r\00y\00 \00l\00a\00r\00g\00e\00r\00 \00d\00w\00a\00r\00f\00)\00\n\00\n\00 \00 \00Z\00w\00\f6\00l\00f\00 \00B\00o\00x\00k\00\e4\00m\00p\00f\00e\00r\00 \00j\00a\00g\00t\00e\00n\00 \00E\00v\00a\00 \00q\00u\00e\00r\00 \00\fc\00b\00e\00r\00 \00d\00e\00n\00 \00S\00y\00l\00t\00e\00r\00 \00D\00e\00i\00c\00h\00\n\00 \00 \00(\00=\00 \00T\00w\00e\00l\00v\00e\00 \00b\00o\00x\00i\00n\00g\00 \00f\00i\00g\00h\00t\00e\00r\00s\00 \00h\00u\00n\00t\00e\00d\00 \00E\00v\00a\00 \00a\00c\00r\00o\00s\00s\00 \00t\00h\00e\00 \00d\00i\00k\00e\00 \00o\00f\00 \00S\00y\00l\00t\00)\00\n\00\n\00 \00 \00H\00e\00i\00z\00\f6\00l\00r\00\fc\00c\00k\00s\00t\00o\00\df\00a\00b\00d\00\e4\00m\00p\00f\00u\00n\00g\00\n\00 \00 \00(\00=\00 \00f\00u\00e\00l\00 \00o\00i\00l\00 \00r\00e\00c\00o\00i\00l\00 \00a\00b\00s\00o\00r\00b\00e\00r\00)\00\n\00 \00 \00(\00j\00q\00v\00w\00x\00y\00 \00m\00i\00s\00s\00i\00n\00g\00,\00 \00b\00u\00t\00 \00a\00l\00l\00 \00n\00o\00n\00-\00A\00S\00C\00I\00I\00 \00l\00e\00t\00t\00e\00r\00s\00 \00i\00n\00 \00o\00n\00e\00 \00w\00o\00r\00d\00)\00\n\00\n\00G\00r\00e\00e\00k\00 \00(\00e\00l\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00\93\03\b1\03\b6\03\ad\03\b5\03\c2\03 \00\ba\03\b1\03v\1f \00\bc\03\c5\03\c1\03\c4\03\b9\03r\1f\c2\03 \00\b4\03r\1f\bd\03 \00\b8\03p\1f \00\b2\03\c1\03\f6\1f \00\c0\03\b9\03p\1f \00\c3\03\c4\03x\1f \00\c7\03\c1\03\c5\03\c3\03\b1\03\c6\03v\1f \00\be\03\ad\03\c6\03\c9\03\c4\03\bf\03\n\00 \00 \00(\00=\00 \00N\00o\00 \00m\00o\00r\00e\00 \00s\00h\00a\00l\00l\00 \00I\00 \00s\00e\00e\00 \00a\00c\00a\00c\00i\00a\00s\00 \00o\00r\00 \00m\00y\00r\00t\00l\00e\00s\00 \00i\00n\00 \00t\00h\00e\00 \00g\00o\00l\00d\00e\00n\00 \00c\00l\00e\00a\00r\00i\00n\00g\00)\00\n\00\n\00 \00 \00\9e\03\b5\03\c3\03\ba\03\b5\03\c0\03\ac\03\b6\03\c9\03 \00\c4\03t\1f\bd\03 \00\c8\03\c5\03\c7\03\bf\03\c6\03\b8\03\cc\03\c1\03\b1\03 \00\b2\03\b4\03\b5\03\bb\03\c5\03\b3\03\bc\03\af\03\b1\03\n\00 \00 \00(\00=\00 \00I\00 \00u\00n\00c\00o\00v\00e\00r\00 \00t\00h\00e\00 \00s\00o\00u\00l\00-\00d\00e\00s\00t\00r\00o\00y\00i\00n\00g\00 \00a\00b\00h\00o\00r\00r\00e\00n\00c\00e\00)\00\n\00\n\00E\00n\00g\00l\00i\00s\00h\00 \00(\00e\00n\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00T\00h\00e\00 \00q\00u\00i\00c\00k\00 \00b\00r\00o\00w\00n\00 \00f\00o\00x\00 \00j\00u\00m\00p\00s\00 \00o\00v\00e\00r\00 \00t\00h\00e\00 \00l\00a\00z\00y\00 \00d\00o\00g\00\n\00\n\00S\00p\00a\00n\00i\00s\00h\00 \00(\00e\00s\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00E\00l\00 \00p\00i\00n\00g\00\fc\00i\00n\00o\00 \00W\00e\00n\00c\00e\00s\00l\00a\00o\00 \00h\00i\00z\00o\00 \00k\00i\00l\00\f3\00m\00e\00t\00r\00o\00s\00 \00b\00a\00j\00o\00 \00e\00x\00h\00a\00u\00s\00t\00i\00v\00a\00 \00l\00l\00u\00v\00i\00a\00 \00y\00\n\00 \00 \00f\00r\00\ed\00o\00,\00 \00a\00\f1\00o\00r\00a\00b\00a\00 \00a\00 \00s\00u\00 \00q\00u\00e\00r\00i\00d\00o\00 \00c\00a\00c\00h\00o\00r\00r\00o\00.\00\n\00 \00 \00(\00C\00o\00n\00t\00a\00i\00n\00s\00 \00e\00v\00e\00r\00y\00 \00l\00e\00t\00t\00e\00r\00 \00a\00n\00d\00 \00e\00v\00e\00r\00y\00 \00a\00c\00c\00e\00n\00t\00,\00 \00b\00u\00t\00 \00n\00o\00t\00 \00e\00v\00e\00r\00y\00 \00c\00o\00m\00b\00i\00n\00a\00t\00i\00o\00n\00\n\00 \00 \00o\00f\00 \00v\00o\00w\00e\00l\00 \00+\00 \00a\00c\00u\00t\00e\00.\00)\00\n\00\n\00F\00r\00e\00n\00c\00h\00 \00(\00f\00r\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00P\00o\00r\00t\00e\00z\00 \00c\00e\00 \00v\00i\00e\00u\00x\00 \00w\00h\00i\00s\00k\00y\00 \00a\00u\00 \00j\00u\00g\00e\00 \00b\00l\00o\00n\00d\00 \00q\00u\00i\00 \00f\00u\00m\00e\00 \00s\00u\00r\00 \00s\00o\00n\00 \00\ee\00l\00e\00 \00i\00n\00t\00\e9\00r\00i\00e\00u\00r\00e\00,\00 \00\e0\00\n\00 \00 \00c\00\f4\00t\00\e9\00 \00d\00e\00 \00l\00\'\00a\00l\00c\00\f4\00v\00e\00 \00o\00v\00o\00\ef\00d\00e\00,\00 \00o\00\f9\00 \00l\00e\00s\00 \00b\00\fb\00c\00h\00e\00s\00 \00s\00e\00 \00c\00o\00n\00s\00u\00m\00e\00n\00t\00 \00d\00a\00n\00s\00 \00l\00\'\00\e2\00t\00r\00e\00,\00 \00c\00e\00\n\00 \00 \00q\00u\00i\00 \00l\00u\00i\00 \00p\00e\00r\00m\00e\00t\00 \00d\00e\00 \00p\00e\00n\00s\00e\00r\00 \00\e0\00 \00l\00a\00 \00c\00\e6\00n\00o\00g\00e\00n\00\e8\00s\00e\00 \00d\00e\00 \00l\00\'\00\ea\00t\00r\00e\00 \00d\00o\00n\00t\00 \00i\00l\00 \00e\00s\00t\00 \00q\00u\00e\00s\00t\00i\00o\00n\00\n\00 \00 \00d\00a\00n\00s\00 \00l\00a\00 \00c\00a\00u\00s\00e\00 \00a\00m\00b\00i\00g\00u\00\eb\00 \00e\00n\00t\00e\00n\00d\00u\00e\00 \00\e0\00 \00M\00o\00\ff\00,\00 \00d\00a\00n\00s\00 \00u\00n\00 \00c\00a\00p\00h\00a\00r\00n\00a\00\fc\00m\00 \00q\00u\00i\00,\00\n\00 \00 \00p\00e\00n\00s\00e\00-\00t\00-\00i\00l\00,\00 \00d\00i\00m\00i\00n\00u\00e\00 \00\e7\00\e0\00 \00e\00t\00 \00l\00\e0\00 \00l\00a\00 \00q\00u\00a\00l\00i\00t\00\e9\00 \00d\00e\00 \00s\00o\00n\00 \00S\01u\00v\00r\00e\00.\00\n\00\n\00 \00 \00l\00\'\00\ee\00l\00e\00 \00e\00x\00i\00g\00u\00\eb\00\n\00 \00 \00O\00\f9\00 \00l\00\'\00o\00b\00\e8\00s\00e\00 \00j\00u\00r\00y\00 \00m\00\fb\00r\00\n\00 \00 \00F\00\ea\00t\00e\00 \00l\00\'\00h\00a\00\ef\00 \00v\00o\00l\00a\00p\00\fc\00k\00,\00\n\00 \00 \00\c2\00n\00e\00 \00e\00x\00 \00a\00\e9\00q\00u\00o\00 \00a\00u\00 \00w\00h\00i\00s\00t\00,\00\n\00 \00 \00\d4\00t\00e\00z\00 \00c\00e\00 \00v\00S\01u\00 \00d\00\e9\00\e7\00u\00.\00\n\00\n\00 \00 \00L\00e\00 \00c\00S\01u\00r\00 \00d\00\e9\00\e7\00u\00 \00m\00a\00i\00s\00 \00l\00\'\00\e2\00m\00e\00 \00p\00l\00u\00t\00\f4\00t\00 \00n\00a\00\ef\00v\00e\00,\00 \00L\00o\00u\00\ff\00s\00 \00r\00\ea\00v\00a\00 \00d\00e\00 \00c\00r\00a\00p\00a\00\fc\00t\00e\00r\00 \00e\00n\00\n\00 \00 \00c\00a\00n\00o\00\eb\00 \00a\00u\00 \00d\00e\00l\00\e0\00 \00d\00e\00s\00 \00\ee\00l\00e\00s\00,\00 \00p\00r\00\e8\00s\00 \00d\00u\00 \00m\00\e4\00l\00s\00t\00r\00\f6\00m\00 \00o\00\f9\00 \00b\00r\00\fb\00l\00e\00n\00t\00 \00l\00e\00s\00 \00n\00o\00v\00\e6\00.\00\n\00\n\00I\00r\00i\00s\00h\00 \00G\00a\00e\00l\00i\00c\00 \00(\00g\00a\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00D\00\'\00f\00h\00u\00a\00s\00c\00a\00i\00l\00 \00\cd\00o\00s\00a\00,\00 \00\da\00r\00m\00h\00a\00c\00 \00n\00a\00 \00h\00\d3\00i\00g\00h\00e\00 \00B\00e\00a\00n\00n\00a\00i\00t\00h\00e\00,\00 \00p\00\f3\00r\00 \00\c9\00a\00v\00a\00 \00a\00g\00u\00s\00 \00\c1\00d\00h\00a\00i\00m\00h\00\n\00\n\00H\00u\00n\00g\00a\00r\00i\00a\00n\00 \00(\00h\00u\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00\c1\00r\00v\00\ed\00z\00t\00q\01r\00Q\01 \00t\00\fc\00k\00\f6\00r\00f\00\fa\00r\00\f3\00g\00\e9\00p\00\n\00 \00 \00(\00=\00 \00f\00l\00o\00o\00d\00-\00p\00r\00o\00o\00f\00 \00m\00i\00r\00r\00o\00r\00-\00d\00r\00i\00l\00l\00i\00n\00g\00 \00m\00a\00c\00h\00i\00n\00e\00,\00 \00o\00n\00l\00y\00 \00a\00l\00l\00 \00n\00o\00n\00-\00A\00S\00C\00I\00I\00 \00l\00e\00t\00t\00e\00r\00s\00)\00\n\00\n\00I\00c\00e\00l\00a\00n\00d\00i\00c\00 \00(\00i\00s\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00K\00\e6\00m\00i\00 \00n\00\fd\00 \00\f6\00x\00i\00 \00h\00\e9\00r\00 \00y\00k\00i\00s\00t\00 \00\fe\00j\00\f3\00f\00u\00m\00 \00n\00\fa\00 \00b\00\e6\00\f0\00i\00 \00v\00\ed\00l\00 \00o\00g\00 \00\e1\00d\00r\00e\00p\00a\00\n\00\n\00 \00 \00S\00\e6\00v\00\f6\00r\00 \00g\00r\00\e9\00t\00 \00\e1\00\f0\00a\00n\00 \00\fe\00v\00\ed\00 \00\fa\00l\00p\00a\00n\00 \00v\00a\00r\00 \00\f3\00n\00\fd\00t\00\n\00 \00 \00(\00s\00o\00m\00e\00 \00A\00S\00C\00I\00I\00 \00l\00e\00t\00t\00e\00r\00s\00 \00m\00i\00s\00s\00i\00n\00g\00)\00\n\00\n\00J\00a\00p\00a\00n\00e\00s\00e\00 \00(\00j\00p\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00H\00i\00r\00a\00g\00a\00n\00a\00:\00 \00(\00I\00r\00o\00h\00a\00)\00\n\00\n\00 \00 \00D0\8d0o0k0{0x0h0a0\8a0l0\8b0\920\n\00 \00 \00\8f0K0\880_0\8c0]0d0m0j0\890\800\n\00 \00 \00F0\900n0J0O0\840~0Q0u0S0H0f0\n\00 \00 \00B0U0M0\860\810\7f0W0\910r0\820[0Y0\n\00\n\00 \00 \00K\00a\00t\00a\00k\00a\00n\00a\00:\00\n\00\n\00 \00 \00\a40\ed0\cf0\cb0\db0\d80\c80 \00\c10\ea0\cc0\eb0\f20 \00\ef0\ab0\e80\bf0\ec0\bd0 \00\c40\cd0\ca0\e90\e00\n\00 \00 \00\a60\f00\ce0\aa0\af0\e40\de0 \00\b10\d50\b30\a80\c60 \00\a20\b50\ad0\e60\e10\df0\b70 \00\f10\d20\e20\bb0\b90\f30\n\00\n\00H\00e\00b\00r\00e\00w\00 \00(\00i\00w\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00?\00 \00\d3\05\d2\05 \00\e1\05\e7\05\e8\05\df\05 \00\e9\05\d8\05 \00\d1\05\d9\05\dd\05 \00\de\05\d0\05\d5\05\db\05\d6\05\d1\05 \00\d5\05\dc\05\e4\05\ea\05\e2\05 \00\de\05\e6\05\d0\05 \00\dc\05\d5\05 \00\d7\05\d1\05\e8\05\d4\05 \00\d0\05\d9\05\da\05 \00\d4\05\e7\05\dc\05\d9\05\d8\05\d4\05\n\00\n\00P\00o\00l\00i\00s\00h\00 \00(\00p\00l\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00P\00c\00h\00n\00\05\01\07\01 \00w\00 \00t\00\19\01 \00B\01\f3\00d\00z\01 \00j\00e\00|\01a\00 \00l\00u\00b\00 \00o\00[\01m\00 \00s\00k\00r\00z\00y\00D\01 \00f\00i\00g\00\n\00 \00 \00(\00=\00 \00T\00o\00 \00p\00u\00s\00h\00 \00a\00 \00h\00e\00d\00g\00e\00h\00o\00g\00 \00o\00r\00 \00e\00i\00g\00h\00t\00 \00b\00i\00n\00s\00 \00o\00f\00 \00f\00i\00g\00s\00 \00i\00n\00 \00t\00h\00i\00s\00 \00b\00o\00a\00t\00)\00\n\00\n\00R\00u\00s\00s\00i\00a\00n\00 \00(\00r\00u\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00\12\04 \00G\040\04I\040\04E\04 \00N\043\040\04 \006\048\04;\04 \001\04K\04 \00F\048\04B\04@\04C\04A\04?\00 \00\14\040\04,\00 \00=\04>\04 \00D\040\04;\04L\04H\048\042\04K\049\04 \00M\04:\047\045\04<\04?\04;\04O\04@\04!\00\n\00 \00 \00(\00=\00 \00W\00o\00u\00l\00d\00 \00a\00 \00c\00i\00t\00r\00u\00s\00 \00l\00i\00v\00e\00 \00i\00n\00 \00t\00h\00e\00 \00b\00u\00s\00h\00e\00s\00 \00o\00f\00 \00s\00o\00u\00t\00h\00?\00 \00Y\00e\00s\00,\00 \00b\00u\00t\00 \00o\00n\00l\00y\00 \00a\00 \00f\00a\00k\00e\00 \00o\00n\00e\00!\00)\00\n\00\n\00 \00 \00!\04J\045\04H\04L\04 \006\045\04 \005\04I\04Q\04 \00M\04B\048\04E\04 \00<\04O\043\04:\048\04E\04 \00D\04@\040\04=\04F\04C\047\04A\04:\048\04E\04 \001\04C\04;\04>\04:\04 \004\040\04 \002\04K\04?\045\049\04 \00G\040\04N\04\n\00 \00 \00(\00=\00 \00E\00a\00t\00 \00s\00o\00m\00e\00 \00m\00o\00r\00e\00 \00o\00f\00 \00t\00h\00e\00s\00e\00 \00f\00r\00e\00s\00h\00 \00F\00r\00e\00n\00c\00h\00 \00l\00o\00a\00f\00s\00 \00a\00n\00d\00 \00h\00a\00v\00e\00 \00s\00o\00m\00e\00 \00t\00e\00a\00)\00\n\00\n\00T\00h\00a\00i\00 \00(\00t\00h\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\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-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00]\00\n\00 \00 \00O\0e \00@\0e\1b\0eG\0e\19\0e!\0e\19\0e8\0e)\0e\"\0eL\0e*\0e8\0e\14\0e\1b\0e#\0e0\0e@\0e*\0e#\0e4\0e\10\0e@\0e%\0e4\0e(\0e\04\0e8\0e\13\0e\04\0eH\0e2\0e \00 \00\01\0e\'\0eH\0e2\0e\1a\0e#\0e#\0e\14\0e2\0e\1d\0e9\0e\07\0e*\0e1\0e\15\0e\'\0eL\0e@\0e\14\0e#\0e1\0e\08\0e\t\0e2\0e\19\0e\n\00 \00 \00\08\0e\07\0e\1d\0eH\0e2\0e\1f\0e1\0e\19\0e\1e\0e1\0e\12\0e\19\0e2\0e\'\0e4\0e\n\0e2\0e\01\0e2\0e#\0e \00 \00 \00 \00 \00 \00 \00 \00 \00 \00 \00-\0e\"\0eH\0e2\0e%\0eI\0e2\0e\07\0e\1c\0e%\0e2\0e\0d\0e$\0eE\0e@\0e\02\0eH\0e\19\0e\06\0eH\0e2\0e\1a\0e5\0e\11\0e2\0eC\0e\04\0e#\0e\n\00 \00 \00D\0e!\0eH\0e\16\0e7\0e-\0eB\0e\17\0e)\0eB\0e\01\0e#\0e\18\0eA\0e\n\0eH\0e\07\0e\0b\0e1\0e\14\0e.\0e6\0e\14\0e.\0e1\0e\14\0e\14\0eH\0e2\0e \00 \00 \00 \00 \00+\0e1\0e\14\0e-\0e \0e1\0e\"\0e@\0e+\0e!\0e7\0e-\0e\19\0e\01\0e5\0e,\0e2\0e-\0e1\0e\n\0e\0c\0e2\0e*\0e1\0e\"\0e\n\00 \00 \00\1b\0e\0f\0e4\0e\1a\0e1\0e\15\0e4\0e\1b\0e#\0e0\0e\1e\0e$\0e\15\0e4\0e\01\0e\0e\0e\01\0e3\0e+\0e\19\0e\14\0eC\0e\08\0e \00 \00 \00 \00 \00 \00 \00 \00\1e\0e9\0e\14\0e\08\0e2\0eC\0e+\0eI\0e\08\0eJ\0e0\0eF\0e \00\08\0eK\0e2\0eF\0e \00\19\0eH\0e2\0e\1f\0e1\0e\07\0e@\0e-\0e\"\0e \00/\0e\n\00\n\00 \00 \00[\00T\00h\00e\00 \00c\00o\00p\00y\00r\00i\00g\00h\00t\00 \00f\00o\00r\00 \00t\00h\00e\00 \00T\00h\00a\00i\00 \00e\00x\00a\00m\00p\00l\00e\00 \00i\00s\00 \00o\00w\00n\00e\00d\00 \00b\00y\00 \00T\00h\00e\00 \00C\00o\00m\00p\00u\00t\00e\00r\00\n\00 \00 \00A\00s\00s\00o\00c\00i\00a\00t\00i\00o\00n\00 \00o\00f\00 \00T\00h\00a\00i\00l\00a\00n\00d\00 \00u\00n\00d\00e\00r\00 \00t\00h\00e\00 \00R\00o\00y\00a\00l\00 \00P\00a\00t\00r\00o\00n\00a\00g\00e\00 \00o\00f\00 \00H\00i\00s\00 \00M\00a\00j\00e\00s\00t\00y\00 \00t\00h\00e\00\n\00 \00 \00K\00i\00n\00g\00.\00]\00\n\00\n\00T\00u\00r\00k\00i\00s\00h\00 \00(\00t\00r\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00P\00i\00j\00a\00m\00a\00l\001\01 \00h\00a\00s\00t\00a\00,\00 \00y\00a\00\1f\011\01z\00 \00_\01o\00f\00\f6\00r\00e\00 \00\e7\00a\00b\00u\00c\00a\00k\00 \00g\00\fc\00v\00e\00n\00d\00i\00.\00\n\00 \00 \00(\00=\00P\00a\00t\00i\00e\00n\00t\00 \00w\00i\00t\00h\00 \00p\00a\00j\00a\00m\00a\00s\00,\00 \00t\00r\00u\00s\00t\00e\00d\00 \00s\00w\00a\00r\00t\00h\00y\00 \00d\00r\00i\00v\00e\00r\00 \00q\00u\00i\00c\00k\00l\00y\00)\00\n\00\00\00") (data (i32.const 21328) "\03\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String.UTF16.byteLength (param $0 i32) (result i32) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 0d8ab54662..5c3b920443 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -10,14 +10,14 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) (type $none_=>_i64 (func (result i64))) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $i32_=>_f64 (func (param i32) (result f64))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string/str (mut i32) (i32.const 1056)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -949,19 +949,22 @@ i32.const 1 i32.shl i32.add - local.tee $1 - i32.const 7 - i32.and - local.get $2 - i32.const 7 - i32.and - i32.or - i32.const 1 + local.set $1 local.get $3 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $1 + i32.const 7 + i32.and + local.get $2 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $1 @@ -1032,10 +1035,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -2092,17 +2095,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1648 @@ -3808,11 +3814,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 @@ -5447,9 +5456,10 @@ i32.sub local.set $2 loop $for-loop|3 - i32.const 0 - local.get $13 i32.const 1 + local.get $13 + i32.eqz + i32.const 0 local.get $5 i32.const 46 i32.eq @@ -5458,7 +5468,6 @@ i32.const 10 i32.lt_u select - i32.eqz if block $for-break3 local.get $2 @@ -7922,8 +7931,8 @@ (local $1 i32) (local $2 f64) (local $3 i32) - (local $4 f32) - (local $5 i32) + (local $4 i32) + (local $5 f32) global.get $~lib/memory/__stack_pointer i32.const 44 i32.sub @@ -8050,17 +8059,19 @@ global.get $std/string/str local.tee $0 i32.store - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - if (result i32) + block $__inlined_func$~lib/string/String#charCodeAt (result i32) + i32.const -1 + local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + i32.eqz + br_if $__inlined_func$~lib/string/String#charCodeAt + drop local.get $0 i32.load16_u - else - i32.const -1 end i32.const 104 i32.ne @@ -8660,36 +8671,39 @@ local.get $1 i32.const 2208 i32.store offset=4 - i32.const 536870910 - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - local.tee $1 - local.get $1 - i32.const 536870910 - i32.gt_s - select - i32.const 2204 - i32.load - i32.const 1 - i32.shr_u - local.tee $1 - i32.sub - local.tee $3 - i32.const 0 - i32.lt_s - if (result i32) - i32.const 1 - else + block $__inlined_func$~lib/string/String#endsWith (result i32) + i32.const 0 + i32.const 536870910 local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + local.tee $3 local.get $3 + i32.const 536870910 + i32.gt_s + select + i32.const 2204 + i32.load + i32.const 1 + i32.shr_u + local.tee $3 + i32.sub + local.tee $4 + i32.const 0 + i32.lt_s + br_if $__inlined_func$~lib/string/String#endsWith + drop + local.get $0 + local.get $4 i32.const 2208 - local.get $1 + local.get $3 call $~lib/util/string/compareImpl + i32.eqz end + i32.eqz if i32.const 0 i32.const 1120 @@ -10681,8 +10695,8 @@ i32.const 0 call $~lib/util/string/strtol f32.demote_f64 - local.tee $4 - local.get $4 + local.tee $5 + local.get $5 f32.eq if i32.const 0 @@ -22154,7 +22168,7 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - i32.const 0 + i32.const 1 local.get $2 i32.const 20 i32.sub @@ -22164,6 +22178,7 @@ i32.const 1 i32.shl local.tee $4 + i32.eqz local.get $0 i32.const 20 i32.sub @@ -22179,7 +22194,6 @@ local.tee $3 i32.gt_u select - i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 @@ -22262,7 +22276,7 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - i32.const 0 + i32.const 1 local.get $2 i32.const 20 i32.sub @@ -22272,6 +22286,7 @@ i32.const 1 i32.shl local.tee $3 + i32.eqz local.get $0 i32.const 20 i32.sub @@ -22287,7 +22302,6 @@ local.tee $5 i32.gt_u select - i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 @@ -23029,10 +23043,10 @@ unreachable end local.get $2 - i32.const 0 + i32.eqz + i32.const 1 local.get $1 select - i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 @@ -23424,10 +23438,10 @@ i32.load offset=16 i32.const 1 i32.shr_u + i32.eqz else - i32.const 0 + i32.const 1 end - i32.eqz if global.get $~lib/memory/__stack_pointer local.get $4 diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 68b879d469..5d8b16e859 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -7,21 +7,21 @@ (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_=>_f64 (func (param i32) (result f64))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string/str (mut i32) (i32.const 32)) (global $std/string/nullStr (mut i32) (i32.const 0)) @@ -520,7 +520,6 @@ (data (i32.const 24780) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00b\00a\00r\00\00\00\00\00\00\00") (data (i32.const 24816) "\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\02\t\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "getString" (func $std/string/getString)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index d1be29d48a..7edb7d55f0 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -1150,17 +1150,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1472 @@ -1860,11 +1863,14 @@ i32.eqz i32.eq if - local.get $0 - local.get $1 local.get $2 - select - call $~lib/rt/itcms/Object#makeGray + if + local.get $0 + call $~lib/rt/itcms/Object#makeGray + else + local.get $1 + call $~lib/rt/itcms/Object#makeGray + end else global.get $~lib/rt/itcms/state i32.const 1 @@ -2086,10 +2092,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -2117,20 +2123,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 68ad1c1978..00353d632e 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4,8 +4,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) + (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))) @@ -78,7 +78,6 @@ (data (i32.const 1548) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)\00\00\00\00\00\00\00\00\00") (data (i32.const 1632) "\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\10\01\82\00\00\00\00\00\10A\02\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/symbol/Symbol (param $0 i32) (result i32) diff --git a/tests/compiler/std/trace.optimized.wat b/tests/compiler/std/trace.optimized.wat index 7c02ba2beb..96f1fc4f2d 100644 --- a/tests/compiler/std/trace.optimized.wat +++ b/tests/compiler/std/trace.optimized.wat @@ -1,7 +1,7 @@ (module - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17804)) diff --git a/tests/compiler/std/trace.untouched.wat b/tests/compiler/std/trace.untouched.wat index 117c22a724..70914731ca 100644 --- a/tests/compiler/std/trace.untouched.wat +++ b/tests/compiler/std/trace.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 396)) @@ -18,7 +18,6 @@ (data (i32.const 300) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00i\00n\00t\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 348) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00d\00b\00l\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~start diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index f87db6d9ce..a3191fd3b5 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -8,34 +8,34 @@ (type $i64_i32_i32_=>_i32 (func (param i64 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) + (type $i64_i64_=>_i32 (func (param i64 i64) (result i32))) (type $f32_i32_i32_=>_i32 (func (param f32 i32 i32) (result i32))) (type $f64_i32_i32_=>_i32 (func (param f64 i32 i32) (result i32))) - (type $i64_i64_=>_i32 (func (param i64 i64) (result i32))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i64_i64_i32_i32_=>_i64 (func (param i64 i64 i32 i32) (result i64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) + (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) + (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) - (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) - (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) + (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) + (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) - (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $none_=>_i32 (func (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1471,17 +1471,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1504 @@ -10650,10 +10653,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.0 local.get $2 i32.load offset=4 @@ -10701,10 +10704,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.01 local.get $2 i32.load offset=4 @@ -10755,10 +10758,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.04 local.get $2 i32.load offset=4 @@ -10809,10 +10812,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.07 local.get $2 i32.load offset=4 @@ -11765,10 +11768,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.041 local.get $4 i32.load offset=4 @@ -11819,10 +11822,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.044 local.get $4 i32.load offset=4 @@ -11871,10 +11874,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.047 local.get $4 i32.load offset=4 @@ -11925,10 +11928,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.050 local.get $4 i32.load offset=4 @@ -11979,10 +11982,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.053 local.get $4 i32.load offset=4 @@ -12033,10 +12036,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.056 local.get $4 i32.load offset=4 @@ -12260,10 +12263,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.0 local.get $2 i32.load offset=4 @@ -12311,10 +12314,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.01 local.get $2 i32.load offset=4 @@ -12365,10 +12368,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.04 local.get $2 i32.load offset=4 @@ -12419,10 +12422,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.07 local.get $2 i32.load offset=4 @@ -13375,10 +13378,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.041 local.get $4 i32.load offset=4 @@ -13429,10 +13432,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.044 local.get $4 i32.load offset=4 @@ -13481,10 +13484,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.047 local.get $4 i32.load offset=4 @@ -13535,10 +13538,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.050 local.get $4 i32.load offset=4 @@ -13589,10 +13592,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.053 local.get $4 i32.load offset=4 @@ -13643,10 +13646,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.056 local.get $4 i32.load offset=4 @@ -13868,10 +13871,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.0 local.get $2 i32.load offset=4 @@ -13919,10 +13922,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.01 local.get $2 i32.load offset=4 @@ -13973,10 +13976,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.04 local.get $2 i32.load offset=4 @@ -14027,10 +14030,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.07 local.get $2 i32.load offset=4 @@ -14984,10 +14987,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.041 local.get $4 i32.load offset=4 @@ -15038,10 +15041,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.044 local.get $4 i32.load offset=4 @@ -15090,10 +15093,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.047 local.get $4 i32.load offset=4 @@ -15144,10 +15147,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.050 local.get $4 i32.load offset=4 @@ -15198,10 +15201,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.053 local.get $4 i32.load offset=4 @@ -15252,10 +15255,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.056 local.get $4 i32.load offset=4 @@ -15477,10 +15480,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.0 local.get $2 i32.load offset=4 @@ -15528,10 +15531,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.01 local.get $2 i32.load offset=4 @@ -15582,10 +15585,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.04 local.get $2 i32.load offset=4 @@ -15636,10 +15639,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.07 local.get $2 i32.load offset=4 @@ -16592,10 +16595,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.041 local.get $4 i32.load offset=4 @@ -16646,10 +16649,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.044 local.get $4 i32.load offset=4 @@ -16698,10 +16701,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.047 local.get $4 i32.load offset=4 @@ -16752,10 +16755,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.050 local.get $4 i32.load offset=4 @@ -16806,10 +16809,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.053 local.get $4 i32.load offset=4 @@ -16860,10 +16863,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.056 local.get $4 i32.load offset=4 @@ -17086,10 +17089,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.0 local.get $2 i32.load offset=4 @@ -17137,10 +17140,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.01 local.get $2 i32.load offset=4 @@ -17191,10 +17194,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.04 local.get $2 i32.load offset=4 @@ -17245,10 +17248,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.07 local.get $2 i32.load offset=4 @@ -18205,10 +18208,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.041 local.get $4 i32.load offset=4 @@ -18259,10 +18262,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.044 local.get $4 i32.load offset=4 @@ -18311,10 +18314,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.047 local.get $4 i32.load offset=4 @@ -18365,10 +18368,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.050 local.get $4 i32.load offset=4 @@ -18419,10 +18422,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.053 local.get $4 i32.load offset=4 @@ -18473,10 +18476,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.056 local.get $4 i32.load offset=4 @@ -18699,10 +18702,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.0 local.get $2 i32.load offset=4 @@ -18750,10 +18753,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.01 local.get $2 i32.load offset=4 @@ -18804,10 +18807,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.04 local.get $2 i32.load offset=4 @@ -18858,10 +18861,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.07 local.get $2 i32.load offset=4 @@ -19818,10 +19821,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.041 local.get $4 i32.load offset=4 @@ -19872,10 +19875,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.044 local.get $4 i32.load offset=4 @@ -19924,10 +19927,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.047 local.get $4 i32.load offset=4 @@ -19978,10 +19981,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.050 local.get $4 i32.load offset=4 @@ -20032,10 +20035,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.053 local.get $4 i32.load offset=4 @@ -20086,10 +20089,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.056 local.get $4 i32.load offset=4 @@ -20312,10 +20315,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.0 local.get $2 i32.load offset=4 @@ -20364,10 +20367,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.01 local.get $2 i32.load offset=4 @@ -20418,10 +20421,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.04 local.get $2 i32.load offset=4 @@ -20472,10 +20475,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.07 local.get $2 i32.load offset=4 @@ -21433,10 +21436,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.041 local.get $4 i32.load offset=4 @@ -21487,10 +21490,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.044 local.get $4 i32.load offset=4 @@ -21539,10 +21542,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.047 local.get $4 i32.load offset=4 @@ -21593,10 +21596,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.050 local.get $4 i32.load offset=4 @@ -21647,10 +21650,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.053 local.get $4 i32.load offset=4 @@ -21701,10 +21704,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.056 local.get $4 i32.load offset=4 @@ -21927,10 +21930,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.0 local.get $2 i32.load offset=4 @@ -21979,10 +21982,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.01 local.get $2 i32.load offset=4 @@ -22033,10 +22036,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.04 local.get $2 i32.load offset=4 @@ -22087,10 +22090,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.07 local.get $2 i32.load offset=4 @@ -23049,10 +23052,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.041 local.get $4 i32.load offset=4 @@ -23103,10 +23106,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.044 local.get $4 i32.load offset=4 @@ -23155,10 +23158,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.047 local.get $4 i32.load offset=4 @@ -23209,10 +23212,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.050 local.get $4 i32.load offset=4 @@ -23263,10 +23266,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.053 local.get $4 i32.load offset=4 @@ -23317,10 +23320,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.const 0 + i32.eqz + i32.const 1 local.get $3 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.056 local.get $4 i32.load offset=4 @@ -23841,10 +23844,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -23872,20 +23875,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 @@ -54835,10 +54840,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.0 local.get $3 i32.load offset=4 @@ -54888,10 +54893,10 @@ i32.const 3 i32.shr_u local.tee $2 - i32.const 0 + i32.eqz + i32.const 1 local.get $2 select - i32.eqz br_if $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 drop local.get $3 @@ -54956,10 +54961,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.const 0 + i32.eqz + i32.const 1 local.get $4 select - i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.0 local.get $3 i32.load offset=4 @@ -55009,10 +55014,10 @@ i32.const 2 i32.shr_u local.tee $2 - i32.const 0 + i32.eqz + i32.const 1 local.get $2 select - i32.eqz br_if $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 drop local.get $3 diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index e137c9bc55..54283d324f 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -11,43 +11,43 @@ (type $f32_i32_i32_=>_i32 (func (param f32 i32 i32) (result i32))) (type $f64_i32_i32_=>_i32 (func (param f64 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i64_i64_i32_i32_=>_i64 (func (param i64 i64 i32 i32) (result i64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) + (type $i64_i64_i32_i32_=>_i64 (func (param i64 i64 i32 i32) (result i64))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64))) - (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) - (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) + (type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64))) + (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32))) - (type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64))) - (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) - (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32))) + (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) + (type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64))) + (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) + (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) diff --git a/tests/compiler/std/uri.optimized.wat b/tests/compiler/std/uri.optimized.wat index b37d772288..8f34376860 100644 --- a/tests/compiler/std/uri.optimized.wat +++ b/tests/compiler/std/uri.optimized.wat @@ -1163,17 +1163,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1520 @@ -2833,7 +2836,7 @@ local.get $1 i32.const 1 i32.shl - local.tee $9 + local.tee $8 i32.const 1 call $~lib/rt/itcms/__new local.set $3 @@ -2879,22 +2882,22 @@ local.get $6 i32.lt_u if - local.get $9 + local.get $8 local.get $7 local.get $6 local.get $5 i32.sub i32.const 1 i32.shl - local.tee $8 + local.tee $9 i32.add i32.lt_u if local.get $3 local.get $7 - local.get $8 + local.get $9 i32.add - local.tee $9 + local.tee $8 call $~lib/rt/itcms/__renew local.set $3 end @@ -2906,10 +2909,10 @@ i32.const 1 i32.shl i32.add - local.get $8 + local.get $9 call $~lib/memory/memory.copy local.get $7 - local.get $8 + local.get $9 i32.add local.set $7 local.get $1 @@ -2917,7 +2920,8 @@ i32.le_u br_if $while-break|0 end - local.get $9 + local.get $8 + local.get $7 i32.const 6 i32.const 24 local.get $4 @@ -3000,36 +3004,34 @@ i32.const 128 i32.lt_u select - local.get $7 - local.tee $5 i32.add - local.tee $7 + local.tee $5 i32.lt_u if local.get $3 - local.get $7 + local.get $5 i32.const 1 i32.shl - local.get $7 + local.get $5 local.get $1 i32.const 1 i32.gt_u select - local.tee $9 + local.tee $8 call $~lib/rt/itcms/__renew local.set $3 end local.get $4 i32.const 128 i32.lt_u - if (result i32) + if local.get $3 - local.get $5 + local.get $7 i32.add - local.tee $7 + local.tee $5 i32.const 37 i32.store16 - local.get $7 + local.get $5 local.get $4 i32.const 4 i32.shr_u @@ -3048,28 +3050,25 @@ i32.shl i32.or i32.store offset=2 - local.get $5 - i32.const 6 - i32.add else local.get $3 local.get $4 i32.const 2048 i32.lt_u - if (result i32) + if local.get $3 - local.get $5 + local.get $7 i32.add - local.tee $7 + local.tee $5 i32.const 37 i32.store16 - local.get $7 + local.get $5 local.get $4 i32.const 6 i32.shr_u i32.const 192 i32.or - local.tee $7 + local.tee $5 i32.const 4 i32.shr_u i32.const 15 @@ -3077,7 +3076,7 @@ i32.const 1676 i32.add i32.load8_u - local.get $7 + local.get $5 i32.const 15 i32.and i32.const 1676 @@ -3087,28 +3086,25 @@ i32.shl i32.or i32.store offset=2 - local.get $5 - i32.const 6 - i32.add else local.get $3 local.get $4 i32.const 65536 i32.lt_u - if (result i32) + if local.get $3 - local.get $5 + local.get $7 i32.add - local.tee $7 + local.tee $5 i32.const 37 i32.store16 - local.get $7 + local.get $5 local.get $4 i32.const 12 i32.shr_u i32.const 224 i32.or - local.tee $7 + local.tee $5 i32.const 4 i32.shr_u i32.const 15 @@ -3116,7 +3112,7 @@ i32.const 1676 i32.add i32.load8_u - local.get $7 + local.get $5 i32.const 15 i32.and i32.const 1676 @@ -3126,23 +3122,20 @@ i32.shl i32.or i32.store offset=2 - local.get $5 - i32.const 6 - i32.add else local.get $3 - local.get $5 + local.get $7 i32.add - local.tee $7 + local.tee $5 i32.const 37 i32.store16 - local.get $7 + local.get $5 local.get $4 i32.const 18 i32.shr_u i32.const 240 i32.or - local.tee $7 + local.tee $5 i32.const 4 i32.shr_u i32.const 15 @@ -3150,7 +3143,7 @@ i32.const 1676 i32.add i32.load8_u - local.get $7 + local.get $5 i32.const 15 i32.and i32.const 1676 @@ -3161,7 +3154,7 @@ i32.or i32.store offset=2 local.get $3 - local.get $5 + local.get $7 i32.const 6 i32.add local.tee $7 @@ -3193,10 +3186,10 @@ i32.shl i32.or i32.store offset=2 - local.get $7 - i32.const 6 - i32.add end + local.get $7 + i32.const 6 + i32.add local.tee $7 i32.add local.tee $5 @@ -3226,10 +3219,10 @@ i32.shl i32.or i32.store offset=2 - local.get $7 - i32.const 6 - i32.add end + local.get $7 + i32.const 6 + i32.add local.tee $7 i32.add local.tee $5 @@ -3257,10 +3250,10 @@ i32.shl i32.or i32.store offset=2 - local.get $7 - i32.const 6 - i32.add end + local.get $7 + i32.const 6 + i32.add local.set $7 local.get $6 i32.const 1 @@ -3271,7 +3264,7 @@ end end local.get $7 - local.get $9 + local.get $8 i32.lt_u if (result i32) local.get $3 @@ -3293,10 +3286,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -3324,20 +3317,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/uri.untouched.wat b/tests/compiler/std/uri.untouched.wat index 13d4eefcd9..232345eb36 100644 --- a/tests/compiler/std/uri.untouched.wat +++ b/tests/compiler/std/uri.untouched.wat @@ -2,8 +2,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 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))) @@ -98,7 +98,6 @@ (data (i32.const 3276) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00\f4\00\b8\00\ef\00\00\00\00\00\00\00") (data (i32.const 3312) "\03\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/super-inline.optimized.wat b/tests/compiler/super-inline.optimized.wat index b33c391db1..95a3451e19 100644 --- a/tests/compiler/super-inline.optimized.wat +++ b/tests/compiler/super-inline.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1056,17 +1056,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/super-inline.untouched.wat b/tests/compiler/super-inline.untouched.wat index 3cbdbc3100..3b5ff64840 100644 --- a/tests/compiler/super-inline.untouched.wat +++ b/tests/compiler/super-inline.untouched.wat @@ -6,8 +6,8 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,7 +38,6 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\03\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/switch.untouched.wat b/tests/compiler/switch.untouched.wat index 92329c9144..221844bba7 100644 --- a/tests/compiler/switch.untouched.wat +++ b/tests/compiler/switch.untouched.wat @@ -9,7 +9,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $switch/doSwitch (param $0 i32) (result i32) diff --git a/tests/compiler/tablebase.optimized.wat b/tests/compiler/tablebase.optimized.wat index c2f7a71575..480eabf448 100644 --- a/tests/compiler/tablebase.optimized.wat +++ b/tests/compiler/tablebase.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17500)) (memory $0 1) diff --git a/tests/compiler/tablebase.untouched.wat b/tests/compiler/tablebase.untouched.wat index 6b13412c68..890fcf6881 100644 --- a/tests/compiler/tablebase.untouched.wat +++ b/tests/compiler/tablebase.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $tablebase/staticFunction i32 (i32.const 32)) (global $~lib/ASC_TABLE_BASE i32 (i32.const 32)) diff --git a/tests/compiler/templateliteral.optimized.wat b/tests/compiler/templateliteral.optimized.wat index dbe75c87b0..c48b5f9fd1 100644 --- a/tests/compiler/templateliteral.optimized.wat +++ b/tests/compiler/templateliteral.optimized.wat @@ -1,15 +1,15 @@ (module (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) @@ -1207,17 +1207,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1520 @@ -3052,10 +3055,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -3083,20 +3086,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/templateliteral.untouched.wat b/tests/compiler/templateliteral.untouched.wat index 768a99f96e..959eae777c 100644 --- a/tests/compiler/templateliteral.untouched.wat +++ b/tests/compiler/templateliteral.untouched.wat @@ -7,15 +7,15 @@ (type $i32_=>_none (func (param 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))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $none_=>_i32 (func (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) @@ -96,7 +96,6 @@ (data (i32.const 4508) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00(\00A\00=\00r\00e\00f\00#\001\00,\00 \00B\00=\00r\00e\00f\00#\002\00)\00\00\00\00\00\00\00\00\00") (data (i32.const 4576) "\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\04A\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#get:color (param $0 i32) (result i32) diff --git a/tests/compiler/ternary.untouched.wat b/tests/compiler/ternary.untouched.wat index 1a6667332f..dc6ac01dee 100644 --- a/tests/compiler/ternary.untouched.wat +++ b/tests/compiler/ternary.untouched.wat @@ -7,7 +7,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "test" (func $ternary/test)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/throw.optimized.wat b/tests/compiler/throw.optimized.wat index f27d104813..e576f3b7fa 100644 --- a/tests/compiler/throw.optimized.wat +++ b/tests/compiler/throw.optimized.wat @@ -1016,17 +1016,20 @@ local.get $3 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $3 select if (result i32) - i32.const 1 - else local.get $0 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1632 diff --git a/tests/compiler/throw.untouched.wat b/tests/compiler/throw.untouched.wat index 6862ddcd6a..b79c13f283 100644 --- a/tests/compiler/throw.untouched.wat +++ b/tests/compiler/throw.untouched.wat @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 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 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) @@ -42,7 +42,6 @@ (data (i32.const 652) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00d\00o\00T\00h\00r\00o\00w\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 704) "\03\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) - (elem $0 (i32.const 1)) (export "doThrow" (func $throw/doThrow)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/typealias.untouched.wat b/tests/compiler/typealias.untouched.wat index 98ec167efb..b81b311ee2 100644 --- a/tests/compiler/typealias.untouched.wat +++ b/tests/compiler/typealias.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "alias" (func $typealias/alias)) (export "memory" (memory $0)) (func $typealias/alias (param $0 i32) (result i32) diff --git a/tests/compiler/typeof.optimized.wat b/tests/compiler/typeof.optimized.wat index 2887713ff9..95479a6eb4 100644 --- a/tests/compiler/typeof.optimized.wat +++ b/tests/compiler/typeof.optimized.wat @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -66,10 +66,10 @@ return end local.get $1 - i32.const 0 + i32.eqz + i32.const 1 local.get $0 select - i32.eqz if i32.const 0 return @@ -97,20 +97,22 @@ local.set $2 local.get $1 local.set $3 - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - select - i32.eqz + if (result i32) + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.eqz + else + i32.const 0 + end if loop $do-continue|0 local.get $2 @@ -1190,17 +1192,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1696 diff --git a/tests/compiler/typeof.untouched.wat b/tests/compiler/typeof.untouched.wat index ba3dca6777..7c98880320 100644 --- a/tests/compiler/typeof.untouched.wat +++ b/tests/compiler/typeof.untouched.wat @@ -5,10 +5,10 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (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))) (global $typeof/SomeNamespace.a i32 (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) diff --git a/tests/compiler/unary.untouched.wat b/tests/compiler/unary.untouched.wat index f8de28e6b3..0f905c5e44 100644 --- a/tests/compiler/unary.untouched.wat +++ b/tests/compiler/unary.untouched.wat @@ -9,7 +9,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:unary diff --git a/tests/compiler/unify-local-flags.untouched.wat b/tests/compiler/unify-local-flags.untouched.wat index 8bc877793a..93d9d07ba9 100644 --- a/tests/compiler/unify-local-flags.untouched.wat +++ b/tests/compiler/unify-local-flags.untouched.wat @@ -5,7 +5,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "testFor" (func $unify-local-flags/testFor)) (export "testWhile" (func $unify-local-flags/testWhile)) (export "testDo" (func $unify-local-flags/testDo)) diff --git a/tests/compiler/void.untouched.wat b/tests/compiler/void.untouched.wat index b4490b85a4..6175cc20ea 100644 --- a/tests/compiler/void.untouched.wat +++ b/tests/compiler/void.untouched.wat @@ -8,7 +8,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $void/anInt (result i32) diff --git a/tests/compiler/wasi/abort.optimized.wat b/tests/compiler/wasi/abort.optimized.wat index dbe733a2ea..64cca09d2e 100644 --- a/tests/compiler/wasi/abort.optimized.wat +++ b/tests/compiler/wasi/abort.optimized.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (memory $0 1) diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat index dc78a728d0..55df334f51 100644 --- a/tests/compiler/wasi/abort.untouched.wat +++ b/tests/compiler/wasi/abort.untouched.wat @@ -1,8 +1,8 @@ (module + (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) @@ -14,7 +14,6 @@ (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e\00\00\00\00\00\00\00") (data (i32.const 60) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00w\00a\00s\00i\00/\00a\00b\00o\00r\00t\00.\00t\00s\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "test" (func $wasi/abort/test)) (export "memory" (memory $0)) (export "_start" (func $~start)) diff --git a/tests/compiler/wasi/seed.optimized.wat b/tests/compiler/wasi/seed.optimized.wat index 767a39898e..a351db9511 100644 --- a/tests/compiler/wasi/seed.optimized.wat +++ b/tests/compiler/wasi/seed.optimized.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_=>_none (func (param i32))) (type $none_=>_f64 (func (result f64))) (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) diff --git a/tests/compiler/wasi/seed.untouched.wat b/tests/compiler/wasi/seed.untouched.wat index efda94a392..521c013bfc 100644 --- a/tests/compiler/wasi/seed.untouched.wat +++ b/tests/compiler/wasi/seed.untouched.wat @@ -1,14 +1,14 @@ (module - (type $none_=>_f64 (func (result f64))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $none_=>_f64 (func (result f64))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i64_=>_i64 (func (param i64) (result i64))) + (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i64_=>_none (func (param i64))) - (type $none_=>_none (func)) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i64_=>_i64 (func (param i64) (result i64))) (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) @@ -23,7 +23,6 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00\00\00\00\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "test" (func $wasi/seed/test)) (export "memory" (memory $0)) (export "_start" (func $~start)) diff --git a/tests/compiler/wasi/snapshot_preview1.untouched.wat b/tests/compiler/wasi/snapshot_preview1.untouched.wat index c954b2c789..2fb19232cf 100644 --- a/tests/compiler/wasi/snapshot_preview1.untouched.wat +++ b/tests/compiler/wasi/snapshot_preview1.untouched.wat @@ -10,7 +10,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:wasi/snapshot_preview1 diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index 8ce0f49a81..f2101c1dbe 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1,15 +1,15 @@ (module (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_none (func)) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_f64_f64_f64_f64_f64_=>_none (func (param i32 f64 f64 f64 f64 f64))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $i32_f64_f64_f64_f64_f64_=>_none (func (param i32 f64 f64 f64 f64 f64))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -3795,17 +3795,20 @@ local.get $7 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $7 select if (result i32) - i32.const 1 - else local.get $8 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1104 diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index 3cfe2f48b8..4acb47fd45 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -4,13 +4,13 @@ (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_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -35,7 +35,6 @@ (data (i32.const 1064) "\01\00\00\00\n\00\00\00d\00\00\00\e8\03\00\00\10\'\00\00\a0\86\01\00@B\0f\00\80\96\98\00\00\e1\f5\05\00\ca\9a;") (data (i32.const 1104) "0\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") (table $0 1 funcref) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/string/String.UTF8.byteLength (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index e0f1361365..0cc0a7f122 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,17 +1044,20 @@ local.get $0 i32.const 15 i32.and - i32.const 1 + i32.eqz + i32.const 0 local.get $0 select if (result i32) - i32.const 1 - else local.get $1 i32.load i32.const 1 i32.and + i32.eqz + else + i32.const 0 end + i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 573b565da0..65a46a3b0c 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -38,7 +38,6 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\04\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) - (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $while/testSimple From 9851d6cc445058ee6964cfe48f4546e915563afd Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Sat, 29 May 2021 10:57:27 -0400 Subject: [PATCH 02/19] fix: linting --- src/common.ts | 2 +- tests/compiler/nonnullable.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common.ts b/src/common.ts index 99b30402bc..9b8d4146f2 100644 --- a/src/common.ts +++ b/src/common.ts @@ -147,7 +147,7 @@ export namespace CommonNames { export const indexof = "indexof"; export const valueof = "valueof"; export const returnof = "returnof"; - export const notnullable = "NonNullable" + export const notnullable = "NonNullable"; // aliases export const null_ = "null"; export const true_ = "true"; diff --git a/tests/compiler/nonnullable.ts b/tests/compiler/nonnullable.ts index 384f526f5e..6470eed77e 100644 --- a/tests/compiler/nonnullable.ts +++ b/tests/compiler/nonnullable.ts @@ -1,17 +1,17 @@ -assert(nameof>() == nameof()) +assert(nameof>() == nameof()); -assert(nameof>() == nameof()) +assert(nameof>() == nameof()); function takesGeneric(t: T): void { if (!isNullable() || t != null){ - // @ts-ignore - if (isDefined(t.call)){ - t.call() - } + // @ts-ignore + if (isDefined(t.call)){ + t.call(); } + } } function callsGeneric(t: T): void { From f5a6c31a456c63fb4d4fbf9176011e3ed54cdea6 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Sat, 29 May 2021 11:18:32 -0400 Subject: [PATCH 03/19] Update src/resolver.ts Co-authored-by: Max Graey --- src/resolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolver.ts b/src/resolver.ts index bdc335b4e9..35de6f0df9 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -3342,7 +3342,7 @@ export class Resolver extends DiagnosticEmitter { return instance; } - private assertOneTypeArgument( + private ensureOneTypeArgument( /** The type to resolve. */ node: NamedTypeNode, /** How to proceed with eventual diagnostics. */ From fac3fec4c337540e3d238fd5b85fa3aa67c4b2e0 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Sat, 29 May 2021 11:36:18 -0400 Subject: [PATCH 04/19] fix: update deps locally and finish renaming refactor --- package-lock.json | 40 +- src/resolver.ts | 10 +- tests/compiler/ReturnType.untouched.wat | 1 + tests/compiler/abi.untouched.wat | 1 + tests/compiler/asc-constants.untouched.wat | 1 + tests/compiler/assert-nonnull.untouched.wat | 3 +- tests/compiler/assert.untouched.wat | 1 + tests/compiler/binary.untouched.wat | 5 +- tests/compiler/bool.untouched.wat | 1 + tests/compiler/builtins.optimized.wat | 26 +- tests/compiler/builtins.untouched.wat | 2 +- tests/compiler/call-inferred.untouched.wat | 3 +- tests/compiler/call-optional.optimized.wat | 2 +- tests/compiler/call-super.optimized.wat | 11 +- tests/compiler/call-super.untouched.wat | 3 +- tests/compiler/class-extends.optimized.wat | 2 +- tests/compiler/class-extends.untouched.wat | 5 +- tests/compiler/class-implements.optimized.wat | 11 +- tests/compiler/class-implements.untouched.wat | 3 +- .../compiler/class-overloading.optimized.wat | 37 +- .../compiler/class-overloading.untouched.wat | 3 +- .../class-static-function.optimized.wat | 2 +- .../class-static-function.untouched.wat | 2 +- tests/compiler/class.optimized.wat | 11 +- tests/compiler/class.untouched.wat | 5 +- tests/compiler/comma.optimized.wat | 2 +- tests/compiler/comma.untouched.wat | 1 + tests/compiler/const-folding.untouched.wat | 1 + tests/compiler/constructor.optimized.wat | 11 +- tests/compiler/constructor.untouched.wat | 3 +- tests/compiler/continue.untouched.wat | 1 + tests/compiler/converge.untouched.wat | 1 + tests/compiler/declare.untouched.wat | 1 + tests/compiler/do.optimized.wat | 11 +- tests/compiler/do.untouched.wat | 3 +- .../empty-exportruntime.optimized.wat | 11 +- .../empty-exportruntime.untouched.wat | 3 +- tests/compiler/empty-new.optimized.wat | 11 +- tests/compiler/empty-new.untouched.wat | 3 +- tests/compiler/empty.untouched.wat | 1 + tests/compiler/enum.untouched.wat | 1 + tests/compiler/export-default.untouched.wat | 1 + tests/compiler/export.untouched.wat | 1 + .../compiler/exportimport-table.optimized.wat | 2 +- .../compiler/exportimport-table.untouched.wat | 2 +- tests/compiler/exports-lazy.untouched.wat | 1 + tests/compiler/exports.optimized.wat | 11 +- tests/compiler/exports.untouched.wat | 3 +- .../exportstar-rereexport.optimized.wat | 13 +- .../exportstar-rereexport.untouched.wat | 3 +- tests/compiler/exportstar.untouched.wat | 1 + .../extends-baseaggregate.optimized.wat | 20 +- .../extends-baseaggregate.untouched.wat | 3 +- .../compiler/extends-recursive.optimized.wat | 11 +- .../compiler/extends-recursive.untouched.wat | 5 +- tests/compiler/external.untouched.wat | 1 + .../field-initialization.optimized.wat | 37 +- .../field-initialization.untouched.wat | 3 +- tests/compiler/for.optimized.wat | 11 +- tests/compiler/for.untouched.wat | 1 + tests/compiler/function-call.optimized.wat | 13 +- tests/compiler/function-types.optimized.wat | 2 +- tests/compiler/function-types.untouched.wat | 2 +- tests/compiler/getter-call.optimized.wat | 11 +- tests/compiler/getter-setter.optimized.wat | 2 +- tests/compiler/getter-setter.untouched.wat | 5 +- tests/compiler/heap.optimized.wat | 13 +- tests/compiler/heap.untouched.wat | 3 +- tests/compiler/if.untouched.wat | 1 + .../implicit-getter-setter.optimized.wat | 11 +- .../implicit-getter-setter.untouched.wat | 5 +- tests/compiler/import.untouched.wat | 1 + tests/compiler/indexof-valueof.untouched.wat | 1 + tests/compiler/infer-array.optimized.wat | 20 +- tests/compiler/infer-array.untouched.wat | 5 +- tests/compiler/infer-generic.optimized.wat | 13 +- tests/compiler/infer-generic.untouched.wat | 4 +- tests/compiler/infer-type.untouched.wat | 1 + .../inlining-blocklocals.optimized.wat | 2 +- .../inlining-blocklocals.untouched.wat | 1 + .../compiler/inlining-recursive.untouched.wat | 1 + tests/compiler/inlining.optimized.wat | 15 +- tests/compiler/instanceof-class.optimized.wat | 11 +- tests/compiler/instanceof-class.untouched.wat | 3 +- tests/compiler/instanceof.optimized.wat | 2 +- tests/compiler/instanceof.untouched.wat | 1 + tests/compiler/issues/1095.optimized.wat | 11 +- tests/compiler/issues/1095.untouched.wat | 3 +- tests/compiler/issues/1225.optimized.wat | 11 +- tests/compiler/issues/1225.untouched.wat | 1 + tests/compiler/issues/1699.optimized.wat | 20 +- tests/compiler/issues/1699.untouched.wat | 3 +- tests/compiler/issues/1714.untouched.wat | 1 + tests/compiler/issues/1751.untouched.wat | 1 + tests/compiler/limits.untouched.wat | 1 + tests/compiler/literals.untouched.wat | 1 + tests/compiler/logical.optimized.wat | 11 +- tests/compiler/logical.untouched.wat | 3 +- tests/compiler/loop-flow.optimized.wat | 2 +- tests/compiler/loop-flow.untouched.wat | 1 + tests/compiler/loop-wrap.untouched.wat | 1 + tests/compiler/managed-cast.optimized.wat | 11 +- tests/compiler/managed-cast.untouched.wat | 5 +- tests/compiler/many-locals.untouched.wat | 3 +- tests/compiler/memcpy.optimized.wat | 4 +- tests/compiler/memcpy.untouched.wat | 3 +- tests/compiler/memmove.optimized.wat | 4 +- tests/compiler/memmove.untouched.wat | 3 +- tests/compiler/memory.untouched.wat | 1 + tests/compiler/memorybase.untouched.wat | 1 + tests/compiler/memset.optimized.wat | 2 +- tests/compiler/memset.untouched.wat | 3 +- tests/compiler/merge.untouched.wat | 1 + .../named-export-default.untouched.wat | 1 + .../named-import-default.untouched.wat | 1 + tests/compiler/namespace.untouched.wat | 3 +- tests/compiler/new.optimized.wat | 11 +- tests/compiler/new.untouched.wat | 3 +- tests/compiler/nonnullable.optimized.wat | 39 +- tests/compiler/nonnullable.untouched.wat | 5 +- tests/compiler/number.optimized.wat | 35 +- tests/compiler/number.untouched.wat | 7 +- tests/compiler/object-literal.optimized.wat | 37 +- tests/compiler/object-literal.untouched.wat | 7 +- .../optional-typeparameters.optimized.wat | 11 +- .../optional-typeparameters.untouched.wat | 1 + tests/compiler/overflow.untouched.wat | 1 + .../portable-conversions.untouched.wat | 1 + tests/compiler/possibly-null.untouched.wat | 5 +- tests/compiler/recursive.untouched.wat | 1 + tests/compiler/reexport.optimized.wat | 11 +- tests/compiler/reexport.untouched.wat | 1 + tests/compiler/rereexport.optimized.wat | 13 +- tests/compiler/rereexport.untouched.wat | 3 +- tests/compiler/resolve-access.optimized.wat | 9 +- tests/compiler/resolve-access.untouched.wat | 9 +- tests/compiler/resolve-binary.optimized.wat | 39 +- tests/compiler/resolve-binary.untouched.wat | 11 +- .../resolve-elementaccess.optimized.wat | 47 +-- .../resolve-elementaccess.untouched.wat | 15 +- .../resolve-function-expression.optimized.wat | 18 +- .../resolve-function-expression.untouched.wat | 6 +- tests/compiler/resolve-nested.optimized.wat | 13 +- tests/compiler/resolve-nested.untouched.wat | 5 +- tests/compiler/resolve-new.optimized.wat | 11 +- tests/compiler/resolve-new.untouched.wat | 3 +- .../resolve-propertyaccess.optimized.wat | 37 +- .../resolve-propertyaccess.untouched.wat | 5 +- tests/compiler/resolve-ternary.optimized.wat | 35 +- tests/compiler/resolve-ternary.untouched.wat | 8 +- tests/compiler/resolve-unary.optimized.wat | 37 +- tests/compiler/resolve-unary.untouched.wat | 7 +- tests/compiler/retain-i32.untouched.wat | 3 +- tests/compiler/rt/finalize.optimized.wat | 11 +- tests/compiler/rt/finalize.untouched.wat | 3 +- tests/compiler/rt/ids.untouched.wat | 1 + tests/compiler/rt/instanceof.optimized.wat | 11 +- tests/compiler/rt/instanceof.untouched.wat | 3 +- .../runtime-incremental-export.optimized.wat | 11 +- .../runtime-incremental-export.untouched.wat | 3 +- .../rt/runtime-incremental.untouched.wat | 1 + .../rt/runtime-minimal-export.optimized.wat | 11 +- .../rt/runtime-minimal-export.untouched.wat | 1 + .../compiler/rt/runtime-minimal.untouched.wat | 1 + .../rt/runtime-stub-export.optimized.wat | 4 +- .../rt/runtime-stub-export.untouched.wat | 3 +- tests/compiler/rt/runtime-stub.untouched.wat | 1 + tests/compiler/scoped.untouched.wat | 1 + tests/compiler/static-this.untouched.wat | 3 +- tests/compiler/std/array-access.optimized.wat | 4 +- tests/compiler/std/array-access.untouched.wat | 5 +- .../compiler/std/array-literal.optimized.wat | 22 +- .../compiler/std/array-literal.untouched.wat | 1 + tests/compiler/std/array.optimized.wat | 86 ++-- tests/compiler/std/array.untouched.wat | 20 +- tests/compiler/std/arraybuffer.optimized.wat | 9 +- tests/compiler/std/arraybuffer.untouched.wat | 3 +- tests/compiler/std/dataview.optimized.wat | 15 +- tests/compiler/std/dataview.untouched.wat | 11 +- tests/compiler/std/date.optimized.wat | 57 ++- tests/compiler/std/date.untouched.wat | 15 +- tests/compiler/std/hash.optimized.wat | 2 +- tests/compiler/std/hash.untouched.wat | 3 +- tests/compiler/std/map.optimized.wat | 19 +- tests/compiler/std/map.untouched.wat | 21 +- tests/compiler/std/math.optimized.wat | 29 +- tests/compiler/std/math.untouched.wat | 29 +- tests/compiler/std/mod.optimized.wat | 4 +- tests/compiler/std/mod.untouched.wat | 9 +- tests/compiler/std/new.optimized.wat | 11 +- tests/compiler/std/new.untouched.wat | 5 +- tests/compiler/std/object.optimized.wat | 28 +- tests/compiler/std/object.untouched.wat | 5 +- .../std/operator-overloading.optimized.wat | 25 +- .../std/operator-overloading.untouched.wat | 1 + tests/compiler/std/pointer.optimized.wat | 2 +- tests/compiler/std/pointer.untouched.wat | 3 +- tests/compiler/std/polyfills.untouched.wat | 3 +- tests/compiler/std/set.optimized.wat | 17 +- tests/compiler/std/set.untouched.wat | 15 +- tests/compiler/std/simd.untouched.wat | 1 + tests/compiler/std/static-array.optimized.wat | 11 +- tests/compiler/std/static-array.untouched.wat | 5 +- tests/compiler/std/staticarray.optimized.wat | 64 ++- tests/compiler/std/staticarray.untouched.wat | 5 +- .../std/string-casemapping.optimized.wat | 37 +- .../std/string-casemapping.untouched.wat | 9 +- .../std/string-encoding.optimized.wat | 35 +- .../std/string-encoding.untouched.wat | 3 +- tests/compiler/std/string.optimized.wat | 160 ++++--- tests/compiler/std/string.untouched.wat | 15 +- tests/compiler/std/symbol.optimized.wat | 46 +- tests/compiler/std/symbol.untouched.wat | 3 +- tests/compiler/std/trace.optimized.wat | 2 +- tests/compiler/std/trace.untouched.wat | 3 +- tests/compiler/std/typedarray.optimized.wat | 397 +++++++++--------- tests/compiler/std/typedarray.untouched.wat | 40 +- tests/compiler/std/uri.optimized.wat | 135 +++--- tests/compiler/std/uri.untouched.wat | 3 +- tests/compiler/super-inline.optimized.wat | 11 +- tests/compiler/super-inline.untouched.wat | 3 +- tests/compiler/switch.untouched.wat | 1 + tests/compiler/tablebase.optimized.wat | 2 +- tests/compiler/tablebase.untouched.wat | 2 +- tests/compiler/templateliteral.optimized.wat | 39 +- tests/compiler/templateliteral.untouched.wat | 9 +- tests/compiler/ternary.untouched.wat | 1 + tests/compiler/throw.optimized.wat | 9 +- tests/compiler/throw.untouched.wat | 5 +- tests/compiler/typealias.untouched.wat | 1 + tests/compiler/typeof.optimized.wat | 39 +- tests/compiler/typeof.untouched.wat | 4 +- tests/compiler/unary.untouched.wat | 1 + .../compiler/unify-local-flags.untouched.wat | 1 + tests/compiler/void.untouched.wat | 1 + tests/compiler/wasi/abort.optimized.wat | 2 +- tests/compiler/wasi/abort.untouched.wat | 3 +- tests/compiler/wasi/seed.optimized.wat | 2 +- tests/compiler/wasi/seed.untouched.wat | 11 +- .../wasi/snapshot_preview1.untouched.wat | 1 + tests/compiler/wasi/trace.optimized.wat | 17 +- tests/compiler/wasi/trace.untouched.wat | 5 +- tests/compiler/while.optimized.wat | 11 +- tests/compiler/while.untouched.wat | 3 +- 244 files changed, 1370 insertions(+), 1498 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ef6778674..aca11ffc3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -712,6 +712,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -787,7 +788,8 @@ "node_modules/buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true }, "node_modules/callsites": { "version": "3.1.0", @@ -1813,7 +1815,8 @@ "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true }, "node_modules/merge-stream": { "version": "2.0.0", @@ -1888,12 +1891,14 @@ "node_modules/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true }, "node_modules/mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, "dependencies": { "minimist": "^1.2.5" }, @@ -2430,6 +2435,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2438,6 +2444,7 @@ "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -2647,6 +2654,7 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.2.0.tgz", "integrity": "sha512-ZNT+OEGfUNVMGkpIaDJJ44Zq3Yr0bkU/ugN1PHbU+/01Z7UV1fsELRiTx1KuQNvQ1A3pGh3y25iYF6jXgxV21A==", + "dev": true, "dependencies": { "arrify": "^1.0.0", "buffer-from": "^1.1.0", @@ -2668,6 +2676,7 @@ "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true, "engines": { "node": ">=0.3.1" } @@ -2941,6 +2950,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "dev": true, "engines": { "node": ">=4" } @@ -3482,7 +3492,8 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true }, "astral-regex": { "version": "2.0.0", @@ -3536,7 +3547,8 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true }, "callsites": { "version": "3.1.0", @@ -4325,7 +4337,8 @@ "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true }, "merge-stream": { "version": "2.0.0", @@ -4382,12 +4395,14 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, "requires": { "minimist": "^1.2.5" } @@ -4754,12 +4769,14 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true }, "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -4916,6 +4933,7 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.2.0.tgz", "integrity": "sha512-ZNT+OEGfUNVMGkpIaDJJ44Zq3Yr0bkU/ugN1PHbU+/01Z7UV1fsELRiTx1KuQNvQ1A3pGh3y25iYF6jXgxV21A==", + "dev": true, "requires": { "arrify": "^1.0.0", "buffer-from": "^1.1.0", @@ -4930,7 +4948,8 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true } } }, @@ -5119,7 +5138,8 @@ "yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=" + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "dev": true }, "yocto-queue": { "version": "0.1.0", diff --git a/src/resolver.ts b/src/resolver.ts index 35de6f0df9..1a75197714 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -439,7 +439,7 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode); if (!typeArgumentNode) return null; var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; @@ -474,7 +474,7 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode); if (!typeArgumentNode) return null; var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; @@ -517,7 +517,7 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode); if (!typeArgumentNode) return null; var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; @@ -545,7 +545,7 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventualy diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode); if (!typeArgumentNode) return null; var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; @@ -570,7 +570,7 @@ export class Resolver extends DiagnosticEmitter { /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT ): Type | null { - const typeArgumentNode = this.assertOneTypeArgument(node, reportMode); + const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode); if (!typeArgumentNode) return null; var typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode); if (!typeArgument) return null; diff --git a/tests/compiler/ReturnType.untouched.wat b/tests/compiler/ReturnType.untouched.wat index 7295676a6a..2b4b16b344 100644 --- a/tests/compiler/ReturnType.untouched.wat +++ b/tests/compiler/ReturnType.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:ReturnType diff --git a/tests/compiler/abi.untouched.wat b/tests/compiler/abi.untouched.wat index 9319c08c04..06e2ca21e8 100644 --- a/tests/compiler/abi.untouched.wat +++ b/tests/compiler/abi.untouched.wat @@ -11,6 +11,7 @@ (memory $0 1) (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00i\00.\00t\00s\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "exported" (func $abi/exported)) (export "exportedExported" (func $abi/exportedExported)) (export "exportedInternal" (func $abi/exportedInternal)) diff --git a/tests/compiler/asc-constants.untouched.wat b/tests/compiler/asc-constants.untouched.wat index 564d8f86e9..0fc4903e56 100644 --- a/tests/compiler/asc-constants.untouched.wat +++ b/tests/compiler/asc-constants.untouched.wat @@ -22,6 +22,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:asc-constants diff --git a/tests/compiler/assert-nonnull.untouched.wat b/tests/compiler/assert-nonnull.untouched.wat index b36eed7921..1f7d895881 100644 --- a/tests/compiler/assert-nonnull.untouched.wat +++ b/tests/compiler/assert-nonnull.untouched.wat @@ -2,8 +2,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 380)) @@ -16,6 +16,7 @@ (data (i32.const 204) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 252) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "testVar" (func $export:assert-nonnull/testVar)) (export "testObj" (func $export:assert-nonnull/testObj)) diff --git a/tests/compiler/assert.untouched.wat b/tests/compiler/assert.untouched.wat index e3cc57ce06..ed6a12d7d9 100644 --- a/tests/compiler/assert.untouched.wat +++ b/tests/compiler/assert.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:assert diff --git a/tests/compiler/binary.untouched.wat b/tests/compiler/binary.untouched.wat index a04f652302..ae76893ff6 100644 --- a/tests/compiler/binary.untouched.wat +++ b/tests/compiler/binary.untouched.wat @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) + (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (global $binary/b (mut i32) (i32.const 0)) (global $binary/i (mut i32) (i32.const 0)) @@ -19,6 +19,7 @@ (data (i32.const 6152) "\be\f3\f8y\eca\f6?\190\96[\c6\fe\de\bf=\88\afJ\edq\f5?\a4\fc\d42h\0b\db\bf\b0\10\f0\f09\95\f4?{\b7\1f\n\8bA\d7\bf\85\03\b8\b0\95\c9\f3?{\cfm\1a\e9\9d\d3\bf\a5d\88\0c\19\0d\f3?1\b6\f2\f3\9b\1d\d0\bf\a0\8e\0b{\"^\f2?\f0z;\1b\1d|\c9\bf?4\1aJJ\bb\f1?\9f<\af\93\e3\f9\c2\bf\ba\e5\8a\f0X#\f1?\\\8dx\bf\cb`\b9\bf\a7\00\99A?\95\f0?\ce_G\b6\9do\aa\bf\00\00\00\00\00\00\f0?\00\00\00\00\00\00\00\00\acG\9a\fd\8c`\ee?=\f5$\9f\ca8\b3?\a0j\02\1f\b3\a4\ec?\ba\918T\a9v\c4?\e6\fcjW6 \eb?\d2\e4\c4J\0b\84\ce?-\aa\a1c\d1\c2\e9?\1ce\c6\f0E\06\d4?\edAx\03\e6\86\e8?\f8\9f\1b,\9c\8e\d8?bHS\f5\dcg\e7?\cc{\b1N\a4\e0\dc?") (data (i32.const 6408) "\00\00\00\00\00\00\f0?t\85\15\d3\b0\d9\ef?\0f\89\f9lX\b5\ef?Q[\12\d0\01\93\ef?{Q}<\b8r\ef?\aa\b9h1\87T\ef?8bunz8\ef?\e1\de\1f\f5\9d\1e\ef?\15\b71\n\fe\06\ef?\cb\a9:7\a7\f1\ee?\"4\12L\a6\de\ee?-\89a`\08\ce\ee?\'*6\d5\da\bf\ee?\82O\9dV+\b4\ee?)TH\dd\07\ab\ee?\85U:\b0~\a4\ee?\cd;\7ff\9e\a0\ee?t_\ec\e8u\9f\ee?\87\01\ebs\14\a1\ee?\13\ceL\99\89\a5\ee?\db\a0*B\e5\ac\ee?\e5\c5\cd\b07\b7\ee?\90\f0\a3\82\91\c4\ee?]%>\b2\03\d5\ee?\ad\d3Z\99\9f\e8\ee?G^\fb\f2v\ff\ee?\9cR\85\dd\9b\19\ef?i\90\ef\dc 7\ef?\87\a4\fb\dc\18X\ef?_\9b{3\97|\ef?\da\90\a4\a2\af\a4\ef?@En[v\d0\ef?") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/math/ipow32 (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/bool.untouched.wat b/tests/compiler/bool.untouched.wat index 83b137716c..686fff0312 100644 --- a/tests/compiler/bool.untouched.wat +++ b/tests/compiler/bool.untouched.wat @@ -47,6 +47,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00b\00o\00o\00l\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:bool diff --git a/tests/compiler/builtins.optimized.wat b/tests/compiler/builtins.optimized.wat index f96d75edbb..dfee42b84d 100644 --- a/tests/compiler/builtins.optimized.wat +++ b/tests/compiler/builtins.optimized.wat @@ -87,10 +87,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -118,22 +118,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/builtins.untouched.wat b/tests/compiler/builtins.untouched.wat index 1cef95840e..80f25dedf6 100644 --- a/tests/compiler/builtins.untouched.wat +++ b/tests/compiler/builtins.untouched.wat @@ -4,8 +4,8 @@ (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 $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (global $builtins/b (mut i32) (i32.const 0)) diff --git a/tests/compiler/call-inferred.untouched.wat b/tests/compiler/call-inferred.untouched.wat index c1e3dcf85a..11ec525b28 100644 --- a/tests/compiler/call-inferred.untouched.wat +++ b/tests/compiler/call-inferred.untouched.wat @@ -1,8 +1,8 @@ (module (type $f32_=>_f32 (func (param f32) (result f32))) (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f64_=>_f64 (func (param f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) @@ -12,6 +12,7 @@ (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $call-inferred/foo (param $0 i32) (result i32) diff --git a/tests/compiler/call-optional.optimized.wat b/tests/compiler/call-optional.optimized.wat index c28e69c90f..4100d95a9b 100644 --- a/tests/compiler/call-optional.optimized.wat +++ b/tests/compiler/call-optional.optimized.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/call-super.optimized.wat b/tests/compiler/call-super.optimized.wat index 55c879f1dc..2b5b8c0141 100644 --- a/tests/compiler/call-super.optimized.wat +++ b/tests/compiler/call-super.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,20 +1044,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/call-super.untouched.wat b/tests/compiler/call-super.untouched.wat index 6befd92c6d..8a4cce9c44 100644 --- a/tests/compiler/call-super.untouched.wat +++ b/tests/compiler/call-super.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -37,6 +37,7 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\0d\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\04\00\00\00 \00\00\00\00\00\00\00 \00\00\00\06\00\00\00 \00\00\00\00\00\00\00 \00\00\00\08\00\00\00 \00\00\00\00\00\00\00 \00\00\00\n\00\00\00 \00\00\00\00\00\00\00 \00\00\00\0c\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/class-extends.optimized.wat b/tests/compiler/class-extends.optimized.wat index e8ebfd1dce..c847b7d897 100644 --- a/tests/compiler/class-extends.optimized.wat +++ b/tests/compiler/class-extends.optimized.wat @@ -1,6 +1,6 @@ (module - (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_none (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17408)) (memory $0 0) diff --git a/tests/compiler/class-extends.untouched.wat b/tests/compiler/class-extends.untouched.wat index 1a712a8ccf..7aaa540a05 100644 --- a/tests/compiler/class-extends.untouched.wat +++ b/tests/compiler/class-extends.untouched.wat @@ -1,14 +1,15 @@ (module - (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 8)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16392)) (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "test" (func $export:class-extends/test)) (func $class-extends/A#set:a (param $0 i32) (param $1 i32) diff --git a/tests/compiler/class-implements.optimized.wat b/tests/compiler/class-implements.optimized.wat index 6d035d1178..c985274597 100644 --- a/tests/compiler/class-implements.optimized.wat +++ b/tests/compiler/class-implements.optimized.wat @@ -3,8 +3,8 @@ (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1066,20 +1066,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/class-implements.untouched.wat b/tests/compiler/class-implements.untouched.wat index c800f325e9..b2fd1e69c1 100644 --- a/tests/compiler/class-implements.untouched.wat +++ b/tests/compiler/class-implements.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -41,6 +41,7 @@ (data (i32.const 412) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00c\00l\00a\00s\00s\00-\00i\00m\00p\00l\00e\00m\00e\00n\00t\00s\00.\00t\00s\00\00\00\00\00\00\00") (data (i32.const 480) "\07\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\00 \00\00\00\06\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "A" (global $class-implements/A)) (export "C" (global $class-implements/C)) (export "memory" (memory $0)) diff --git a/tests/compiler/class-overloading.optimized.wat b/tests/compiler/class-overloading.optimized.wat index c9ca5a0717..cebc44fb43 100644 --- a/tests/compiler/class-overloading.optimized.wat +++ b/tests/compiler/class-overloading.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1104,20 +1104,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1424 @@ -1461,10 +1458,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -1492,22 +1489,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/class-overloading.untouched.wat b/tests/compiler/class-overloading.untouched.wat index d9b04b79c2..7030572e97 100644 --- a/tests/compiler/class-overloading.untouched.wat +++ b/tests/compiler/class-overloading.untouched.wat @@ -6,8 +6,8 @@ (type $i32_i32_=>_i32 (func (param 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 (func (param i32 i32 i32) (result 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))) (global $class-overloading/which (mut i32) (i32.const 32)) @@ -53,6 +53,7 @@ (data (i32.const 700) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00n\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 768) "\11\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\03\00\00\00 \00\00\00\04\00\00\00 \00\00\00\04\00\00\00 \00\00\00\06\00\00\00 \00\00\00\07\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\t\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\0d\00\00\00 \00\00\00\10\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/class-static-function.optimized.wat b/tests/compiler/class-static-function.optimized.wat index bfcc86d19a..3f47129a82 100644 --- a/tests/compiler/class-static-function.optimized.wat +++ b/tests/compiler/class-static-function.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_i32 (func (result i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17532)) (memory $0 1) diff --git a/tests/compiler/class-static-function.untouched.wat b/tests/compiler/class-static-function.untouched.wat index a3e990ebad..1801c0100c 100644 --- a/tests/compiler/class-static-function.untouched.wat +++ b/tests/compiler/class-static-function.untouched.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 124)) diff --git a/tests/compiler/class.optimized.wat b/tests/compiler/class.optimized.wat index d4490db749..bc0b236d29 100644 --- a/tests/compiler/class.optimized.wat +++ b/tests/compiler/class.optimized.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1056,20 +1056,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/class.untouched.wat b/tests/compiler/class.untouched.wat index 2e5c230a4d..ac65a7b27a 100644 --- a/tests/compiler/class.untouched.wat +++ b/tests/compiler/class.untouched.wat @@ -6,10 +6,10 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $i32_f32_f32_=>_f32 (func (param i32 f32 f32) (result f32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_f32_f32_=>_f32 (func (param i32 f32 f32) (result f32))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $class/Animal.ONE (mut i32) (i32.const 1)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -41,6 +41,7 @@ (data (i32.const 460) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 512) "\06\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\00\00\02\t\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "testGenericInitializer" (func $class/testGenericInitializer)) (export "memory" (memory $0)) (export "test" (func $export:class/test)) diff --git a/tests/compiler/comma.optimized.wat b/tests/compiler/comma.optimized.wat index 7771df73a2..29a41112be 100644 --- a/tests/compiler/comma.optimized.wat +++ b/tests/compiler/comma.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $comma/a (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0)) diff --git a/tests/compiler/comma.untouched.wat b/tests/compiler/comma.untouched.wat index 0d51475231..df51ba253e 100644 --- a/tests/compiler/comma.untouched.wat +++ b/tests/compiler/comma.untouched.wat @@ -10,6 +10,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:comma diff --git a/tests/compiler/const-folding.untouched.wat b/tests/compiler/const-folding.untouched.wat index 08bab6bef5..7c4b547684 100644 --- a/tests/compiler/const-folding.untouched.wat +++ b/tests/compiler/const-folding.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "test" (func $const-folding/test)) (export "memory" (memory $0)) (func $const-folding/test (param $0 i64) (result i64) diff --git a/tests/compiler/constructor.optimized.wat b/tests/compiler/constructor.optimized.wat index 3253af0ec9..8aa24f1c6f 100644 --- a/tests/compiler/constructor.optimized.wat +++ b/tests/compiler/constructor.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1112,20 +1112,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/constructor.untouched.wat b/tests/compiler/constructor.untouched.wat index 789c4e77c3..b5949afb5d 100644 --- a/tests/compiler/constructor.untouched.wat +++ b/tests/compiler/constructor.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -47,6 +47,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\0d\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\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\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/continue.untouched.wat b/tests/compiler/continue.untouched.wat index d761e26421..30208a4fa3 100644 --- a/tests/compiler/continue.untouched.wat +++ b/tests/compiler/continue.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "testInherit" (func $continue/testInherit)) (export "memory" (memory $0)) (func $continue/testInherit (param $0 i32) diff --git a/tests/compiler/converge.untouched.wat b/tests/compiler/converge.untouched.wat index edbd3984ae..ef7546254f 100644 --- a/tests/compiler/converge.untouched.wat +++ b/tests/compiler/converge.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "test" (func $converge/test)) (export "memory" (memory $0)) (func $converge/test diff --git a/tests/compiler/declare.untouched.wat b/tests/compiler/declare.untouched.wat index 64ab9172a6..e2944babc5 100644 --- a/tests/compiler/declare.untouched.wat +++ b/tests/compiler/declare.untouched.wat @@ -12,6 +12,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:declare diff --git a/tests/compiler/do.optimized.wat b/tests/compiler/do.optimized.wat index 06c4fe0dd7..80996cf5c6 100644 --- a/tests/compiler/do.optimized.wat +++ b/tests/compiler/do.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,20 +1044,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/do.untouched.wat b/tests/compiler/do.untouched.wat index c46b54bd39..8f777ea54e 100644 --- a/tests/compiler/do.untouched.wat +++ b/tests/compiler/do.untouched.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result 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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -38,6 +38,7 @@ (data (i32.const 380) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 448) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $do/testSimple diff --git a/tests/compiler/empty-exportruntime.optimized.wat b/tests/compiler/empty-exportruntime.optimized.wat index 7fa1457bb2..f6d53b32c4 100644 --- a/tests/compiler/empty-exportruntime.optimized.wat +++ b/tests/compiler/empty-exportruntime.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1062,20 +1062,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/empty-exportruntime.untouched.wat b/tests/compiler/empty-exportruntime.untouched.wat index 44b8e896a9..ab3b34728b 100644 --- a/tests/compiler/empty-exportruntime.untouched.wat +++ b/tests/compiler/empty-exportruntime.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,6 +38,7 @@ (data (i32.const 476) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00O\00b\00j\00e\00c\00t\00 \00i\00s\00 \00n\00o\00t\00 \00p\00i\00n\00n\00e\00d\00\00\00\00\00") (data (i32.const 544) "\03\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) + (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/itcms/__new)) (export "__pin" (func $~lib/rt/itcms/__pin)) (export "__unpin" (func $~lib/rt/itcms/__unpin)) diff --git a/tests/compiler/empty-new.optimized.wat b/tests/compiler/empty-new.optimized.wat index 6536231e50..f26e0b4178 100644 --- a/tests/compiler/empty-new.optimized.wat +++ b/tests/compiler/empty-new.optimized.wat @@ -2,8 +2,8 @@ (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1040,20 +1040,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/empty-new.untouched.wat b/tests/compiler/empty-new.untouched.wat index 1c448c7157..01f6f1e0ac 100644 --- a/tests/compiler/empty-new.untouched.wat +++ b/tests/compiler/empty-new.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -36,6 +36,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\03\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/empty.untouched.wat b/tests/compiler/empty.untouched.wat index 700fa1f9a6..f4d95ad56d 100644 --- a/tests/compiler/empty.untouched.wat +++ b/tests/compiler/empty.untouched.wat @@ -4,5 +4,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/enum.untouched.wat b/tests/compiler/enum.untouched.wat index e829591565..5a2b7f189c 100644 --- a/tests/compiler/enum.untouched.wat +++ b/tests/compiler/enum.untouched.wat @@ -37,6 +37,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "Implicit.ZERO" (global $enum/Implicit.ZERO)) (export "Implicit.ONE" (global $enum/Implicit.ONE)) (export "Implicit.TWO" (global $enum/Implicit.TWO)) diff --git a/tests/compiler/export-default.untouched.wat b/tests/compiler/export-default.untouched.wat index 592f90a931..649647c6a1 100644 --- a/tests/compiler/export-default.untouched.wat +++ b/tests/compiler/export-default.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "theDefault" (func $export-default/theDefault)) (export "default" (func $export-default/theDefault)) (export "memory" (memory $0)) diff --git a/tests/compiler/export.untouched.wat b/tests/compiler/export.untouched.wat index 938d6b7541..75fdad29c7 100644 --- a/tests/compiler/export.untouched.wat +++ b/tests/compiler/export.untouched.wat @@ -9,6 +9,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "add" (func $export/add)) (export "sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) diff --git a/tests/compiler/exportimport-table.optimized.wat b/tests/compiler/exportimport-table.optimized.wat index fa1ffca691..d2ea0fc1a9 100644 --- a/tests/compiler/exportimport-table.optimized.wat +++ b/tests/compiler/exportimport-table.optimized.wat @@ -1,10 +1,10 @@ (module (type $none_=>_none (func)) (import "env" "table" (table $0 2 funcref)) - (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (memory $0 1) (data (i32.const 1036) "\1c") (data (i32.const 1048) "\03\00\00\00\08\00\00\00\01") + (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (export "memory" (memory $0)) (export "table" (table $0)) (func $start:exportimport-table~anonymous|0 diff --git a/tests/compiler/exportimport-table.untouched.wat b/tests/compiler/exportimport-table.untouched.wat index 05ce6bc9db..421b929e98 100644 --- a/tests/compiler/exportimport-table.untouched.wat +++ b/tests/compiler/exportimport-table.untouched.wat @@ -1,13 +1,13 @@ (module (type $none_=>_none (func)) (import "env" "table" (table $0 2 funcref)) - (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (global $exportimport-table/f (mut i32) (i32.const 32)) (global $~lib/memory/__data_end i32 (i32.const 44)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16428)) (global $~lib/memory/__heap_base i32 (i32.const 16428)) (memory $0 1) (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\08\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00") + (elem $0 (i32.const 1) $start:exportimport-table~anonymous|0) (export "memory" (memory $0)) (export "table" (table $0)) (start $~start) diff --git a/tests/compiler/exports-lazy.untouched.wat b/tests/compiler/exports-lazy.untouched.wat index e00bcae142..4a986f6f5a 100644 --- a/tests/compiler/exports-lazy.untouched.wat +++ b/tests/compiler/exports-lazy.untouched.wat @@ -8,6 +8,7 @@ (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0c\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00") (data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\03\00\00\00\10\00\00\00 \00\00\00 \00\00\00\0c\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "lazyGlobalUsed" (global $exports-lazy/lazyGlobalUsed)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/exports.optimized.wat b/tests/compiler/exports.optimized.wat index 397867cc2a..6be1e46aed 100644 --- a/tests/compiler/exports.optimized.wat +++ b/tests/compiler/exports.optimized.wat @@ -5,8 +5,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $exports/Animal.CAT i32 (i32.const 0)) (global $exports/Animal.DOG i32 (i32.const 1)) @@ -1094,20 +1094,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/exports.untouched.wat b/tests/compiler/exports.untouched.wat index 2cbadeb9c2..ba6f0c0360 100644 --- a/tests/compiler/exports.untouched.wat +++ b/tests/compiler/exports.untouched.wat @@ -4,8 +4,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -49,6 +49,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "add" (func $exports/add)) (export "subOpt" (func $exports/subOpt@varargs)) (export "math.sub" (func $exports/math.sub)) diff --git a/tests/compiler/exportstar-rereexport.optimized.wat b/tests/compiler/exportstar-rereexport.optimized.wat index 76a21d3980..d9c0ebacf3 100644 --- a/tests/compiler/exportstar-rereexport.optimized.wat +++ b/tests/compiler/exportstar-rereexport.optimized.wat @@ -1,11 +1,11 @@ (module (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -1095,20 +1095,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/exportstar-rereexport.untouched.wat b/tests/compiler/exportstar-rereexport.untouched.wat index 541d842408..a5edbf7713 100644 --- a/tests/compiler/exportstar-rereexport.untouched.wat +++ b/tests/compiler/exportstar-rereexport.untouched.wat @@ -6,8 +6,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -47,6 +47,7 @@ (data (i32.const 460) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00r\00e\00r\00e\00e\00x\00p\00o\00r\00t\00.\00t\00s\00\00\00") (data (i32.const 512) "\04\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) + (elem $0 (i32.const 1)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/compiler/exportstar.untouched.wat b/tests/compiler/exportstar.untouched.wat index 938d6b7541..75fdad29c7 100644 --- a/tests/compiler/exportstar.untouched.wat +++ b/tests/compiler/exportstar.untouched.wat @@ -9,6 +9,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "add" (func $export/add)) (export "sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) diff --git a/tests/compiler/extends-baseaggregate.optimized.wat b/tests/compiler/extends-baseaggregate.optimized.wat index 88d503da3a..7e02830631 100644 --- a/tests/compiler/extends-baseaggregate.optimized.wat +++ b/tests/compiler/extends-baseaggregate.optimized.wat @@ -1062,20 +1062,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1552 @@ -1775,14 +1772,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/extends-baseaggregate.untouched.wat b/tests/compiler/extends-baseaggregate.untouched.wat index 40892c936a..89042890f3 100644 --- a/tests/compiler/extends-baseaggregate.untouched.wat +++ b/tests/compiler/extends-baseaggregate.untouched.wat @@ -7,8 +7,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_f64_=>_none (func (param i32 f64))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $extends-baseaggregate/poolB i32 (i32.const 64)) (global $extends-baseaggregate/poolA i32 (i32.const 144)) @@ -45,6 +45,7 @@ (data (i32.const 620) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 672) "\t\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\02A\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/extends-recursive.optimized.wat b/tests/compiler/extends-recursive.optimized.wat index 1c4bb9f84a..b502ff0347 100644 --- a/tests/compiler/extends-recursive.optimized.wat +++ b/tests/compiler/extends-recursive.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1051,20 +1051,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/extends-recursive.untouched.wat b/tests/compiler/extends-recursive.untouched.wat index 818f5cd865..dabc4a9489 100644 --- a/tests/compiler/extends-recursive.untouched.wat +++ b/tests/compiler/extends-recursive.untouched.wat @@ -2,12 +2,12 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -37,6 +37,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\04\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "Child" (global $extends-recursive/Child)) (export "memory" (memory $0)) (export "Child#get:child" (func $export:extends-recursive/Parent#get:child)) diff --git a/tests/compiler/external.untouched.wat b/tests/compiler/external.untouched.wat index 20a24519ae..8931a5f95f 100644 --- a/tests/compiler/external.untouched.wat +++ b/tests/compiler/external.untouched.wat @@ -10,6 +10,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "foo" (func $external/foo)) (export "foo.bar" (func $external/foo.bar)) (export "two" (func $external/two)) diff --git a/tests/compiler/field-initialization.optimized.wat b/tests/compiler/field-initialization.optimized.wat index eaf089fa02..38af4021b4 100644 --- a/tests/compiler/field-initialization.optimized.wat +++ b/tests/compiler/field-initialization.optimized.wat @@ -5,8 +5,8 @@ (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1069,20 +1069,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 @@ -1810,10 +1807,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -1841,22 +1838,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/field-initialization.untouched.wat b/tests/compiler/field-initialization.untouched.wat index 3ea7f9b150..ccd54580ff 100644 --- a/tests/compiler/field-initialization.untouched.wat +++ b/tests/compiler/field-initialization.untouched.wat @@ -6,8 +6,8 @@ (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))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result 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))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -45,6 +45,7 @@ (data (i32.const 732) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00c\00c\00\00\00\00\00\00\00\00\00") (data (i32.const 768) "\19\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\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\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\14\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/for.optimized.wat b/tests/compiler/for.optimized.wat index 33bc640b24..d34636526e 100644 --- a/tests/compiler/for.optimized.wat +++ b/tests/compiler/for.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,20 +1044,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/for.untouched.wat b/tests/compiler/for.untouched.wat index 504a5402a2..2b0be62bd9 100644 --- a/tests/compiler/for.untouched.wat +++ b/tests/compiler/for.untouched.wat @@ -38,6 +38,7 @@ (data (i32.const 380) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 448) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $for/testInitExpression diff --git a/tests/compiler/function-call.optimized.wat b/tests/compiler/function-call.optimized.wat index 654b1295de..f1593b31c0 100644 --- a/tests/compiler/function-call.optimized.wat +++ b/tests/compiler/function-call.optimized.wat @@ -1,13 +1,13 @@ (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1082,20 +1082,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1616 diff --git a/tests/compiler/function-types.optimized.wat b/tests/compiler/function-types.optimized.wat index f37c90f66f..691bd94c4a 100644 --- a/tests/compiler/function-types.optimized.wat +++ b/tests/compiler/function-types.optimized.wat @@ -2,8 +2,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $function-types/i32Adder (mut i32) (i32.const 0)) (global $~argumentsLength (mut i32) (i32.const 0)) diff --git a/tests/compiler/function-types.untouched.wat b/tests/compiler/function-types.untouched.wat index b7e8e09cd2..68a8396c6f 100644 --- a/tests/compiler/function-types.untouched.wat +++ b/tests/compiler/function-types.untouched.wat @@ -1,8 +1,8 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_none (func)) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) diff --git a/tests/compiler/getter-call.optimized.wat b/tests/compiler/getter-call.optimized.wat index f6e5fd8584..f00688e1bd 100644 --- a/tests/compiler/getter-call.optimized.wat +++ b/tests/compiler/getter-call.optimized.wat @@ -3,8 +3,8 @@ (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1047,20 +1047,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/getter-setter.optimized.wat b/tests/compiler/getter-setter.optimized.wat index 79f2faf0bf..cc065dee2c 100644 --- a/tests/compiler/getter-setter.optimized.wat +++ b/tests/compiler/getter-setter.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/getter-setter.untouched.wat b/tests/compiler/getter-setter.untouched.wat index 39963933ec..7667899ca0 100644 --- a/tests/compiler/getter-setter.untouched.wat +++ b/tests/compiler/getter-setter.untouched.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_none (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 76)) @@ -11,6 +11,7 @@ (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $getter-setter/Foo.get:bar (result i32) diff --git a/tests/compiler/heap.optimized.wat b/tests/compiler/heap.optimized.wat index 0edcbfd3ed..0c41748546 100644 --- a/tests/compiler/heap.optimized.wat +++ b/tests/compiler/heap.optimized.wat @@ -1,12 +1,12 @@ (module - (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 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_=>_none (func (param i32 i32))) - (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) (global $heap/ptr (mut i32) (i32.const 0)) @@ -984,20 +984,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1056 diff --git a/tests/compiler/heap.untouched.wat b/tests/compiler/heap.untouched.wat index 94215c8e03..2673f79c6d 100644 --- a/tests/compiler/heap.untouched.wat +++ b/tests/compiler/heap.untouched.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 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_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -21,6 +21,7 @@ (data (i32.const 140) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 204) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "heap.alloc" (func $~lib/memory/heap.alloc)) (export "heap.realloc" (func $~lib/memory/heap.realloc)) (export "heap.free" (func $~lib/memory/heap.free)) diff --git a/tests/compiler/if.untouched.wat b/tests/compiler/if.untouched.wat index c1bf1dd30d..66c8766dda 100644 --- a/tests/compiler/if.untouched.wat +++ b/tests/compiler/if.untouched.wat @@ -10,6 +10,7 @@ (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00i\00f\00.\00t\00s\00\00\00") (data (i32.const 44) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00e\00r\00r\00o\00r\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "ifThenElse" (func $if/ifThenElse)) (export "ifThen" (func $if/ifThen)) (export "ifThenElseBlock" (func $if/ifThenElseBlock)) diff --git a/tests/compiler/implicit-getter-setter.optimized.wat b/tests/compiler/implicit-getter-setter.optimized.wat index b2eb0106a9..2ff6ade2b5 100644 --- a/tests/compiler/implicit-getter-setter.optimized.wat +++ b/tests/compiler/implicit-getter-setter.optimized.wat @@ -4,8 +4,8 @@ (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1057,20 +1057,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/implicit-getter-setter.untouched.wat b/tests/compiler/implicit-getter-setter.untouched.wat index c5437b355c..238e45538d 100644 --- a/tests/compiler/implicit-getter-setter.untouched.wat +++ b/tests/compiler/implicit-getter-setter.untouched.wat @@ -3,11 +3,11 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_none (func)) (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))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,6 +38,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "Basic" (global $implicit-getter-setter/Basic)) (export "Managed" (global $implicit-getter-setter/Managed)) (export "memory" (memory $0)) diff --git a/tests/compiler/import.untouched.wat b/tests/compiler/import.untouched.wat index 05f3b40d0e..83f253388e 100644 --- a/tests/compiler/import.untouched.wat +++ b/tests/compiler/import.untouched.wat @@ -9,6 +9,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $export/add (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/indexof-valueof.untouched.wat b/tests/compiler/indexof-valueof.untouched.wat index 3709c5ce16..914888e72d 100644 --- a/tests/compiler/indexof-valueof.untouched.wat +++ b/tests/compiler/indexof-valueof.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:indexof-valueof diff --git a/tests/compiler/infer-array.optimized.wat b/tests/compiler/infer-array.optimized.wat index 8c8b1a9164..64f3ef092d 100644 --- a/tests/compiler/infer-array.optimized.wat +++ b/tests/compiler/infer-array.optimized.wat @@ -1083,20 +1083,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1424 @@ -2549,14 +2546,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/infer-array.untouched.wat b/tests/compiler/infer-array.untouched.wat index 048d2cf2dd..58ec5bd189 100644 --- a/tests/compiler/infer-array.untouched.wat +++ b/tests/compiler/infer-array.untouched.wat @@ -8,9 +8,9 @@ (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 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -55,6 +55,7 @@ (data (i32.const 956) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 1088) "\0c\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\02\t\00\00\00\00\00\00\02\1a\00\00\00\00\00\00\02\01\00\00\00\00\00\00\02\19\00\00\00\00\00\00 \00\00\00\00\00\00\00\02a\00\00\00\00\00\00\02a\00\00\00\00\00\00\02\01\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/infer-generic.optimized.wat b/tests/compiler/infer-generic.optimized.wat index 8c27338c1c..0aa5029c5b 100644 --- a/tests/compiler/infer-generic.optimized.wat +++ b/tests/compiler/infer-generic.optimized.wat @@ -1,12 +1,12 @@ (module (type $none_=>_none (func)) + (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_f32_i32_i32_=>_i32 (func (param i32 f32 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $f32_=>_f32 (func (param f32) (result f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1069,20 +1069,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1568 diff --git a/tests/compiler/infer-generic.untouched.wat b/tests/compiler/infer-generic.untouched.wat index f3476f986b..79b87293f0 100644 --- a/tests/compiler/infer-generic.untouched.wat +++ b/tests/compiler/infer-generic.untouched.wat @@ -5,12 +5,12 @@ (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_f32_i32_i32_=>_i32 (func (param i32 f32 i32 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $f32_=>_f32 (func (param f32) (result f32))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $infer-generic/arr i32 (i32.const 128)) (global $~argumentsLength (mut i32) (i32.const 0)) diff --git a/tests/compiler/infer-type.untouched.wat b/tests/compiler/infer-type.untouched.wat index 398d9c9e4b..59c61e82fc 100644 --- a/tests/compiler/infer-type.untouched.wat +++ b/tests/compiler/infer-type.untouched.wat @@ -18,6 +18,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $infer-type/locals diff --git a/tests/compiler/inlining-blocklocals.optimized.wat b/tests/compiler/inlining-blocklocals.optimized.wat index 22b0b2d69e..3f736dff7d 100644 --- a/tests/compiler/inlining-blocklocals.optimized.wat +++ b/tests/compiler/inlining-blocklocals.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $inlining-blocklocals/b (mut i32) (i32.const 2)) (global $inlining-blocklocals/theCall_b (mut i32) (i32.const 0)) diff --git a/tests/compiler/inlining-blocklocals.untouched.wat b/tests/compiler/inlining-blocklocals.untouched.wat index 6056cd3d55..bf10d68e90 100644 --- a/tests/compiler/inlining-blocklocals.untouched.wat +++ b/tests/compiler/inlining-blocklocals.untouched.wat @@ -12,6 +12,7 @@ (memory $0 1) (data (i32.const 12) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00.\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00-\00b\00l\00o\00c\00k\00l\00o\00c\00a\00l\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $inlining-blocklocals/test diff --git a/tests/compiler/inlining-recursive.untouched.wat b/tests/compiler/inlining-recursive.untouched.wat index 9ef7fa3071..9293419782 100644 --- a/tests/compiler/inlining-recursive.untouched.wat +++ b/tests/compiler/inlining-recursive.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "foo" (func $inlining-recursive/foo)) (export "bar" (func $inlining-recursive/bar)) (export "baz" (func $inlining-recursive/baz)) diff --git a/tests/compiler/inlining.optimized.wat b/tests/compiler/inlining.optimized.wat index 4bef068634..3efc001b52 100644 --- a/tests/compiler/inlining.optimized.wat +++ b/tests/compiler/inlining.optimized.wat @@ -1,12 +1,12 @@ (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1056,20 +1056,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1472 diff --git a/tests/compiler/instanceof-class.optimized.wat b/tests/compiler/instanceof-class.optimized.wat index d6741d5830..0c7aae8a8e 100644 --- a/tests/compiler/instanceof-class.optimized.wat +++ b/tests/compiler/instanceof-class.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1058,20 +1058,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/instanceof-class.untouched.wat b/tests/compiler/instanceof-class.untouched.wat index e28a73e2c2..0d7ced0f57 100644 --- a/tests/compiler/instanceof-class.untouched.wat +++ b/tests/compiler/instanceof-class.untouched.wat @@ -6,8 +6,8 @@ (type $i32_i32_=>_i32 (func (param 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 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -39,6 +39,7 @@ (data (i32.const 412) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00-\00c\00l\00a\00s\00s\00.\00t\00s\00\00\00\00\00\00\00") (data (i32.const 480) "\07\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\04\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00 \00\00\00\05\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/instanceof.optimized.wat b/tests/compiler/instanceof.optimized.wat index edd8c5042f..ae2a8f756f 100644 --- a/tests/compiler/instanceof.optimized.wat +++ b/tests/compiler/instanceof.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $instanceof/an (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/instanceof.untouched.wat b/tests/compiler/instanceof.untouched.wat index 95decea0c1..49f7d42622 100644 --- a/tests/compiler/instanceof.untouched.wat +++ b/tests/compiler/instanceof.untouched.wat @@ -17,6 +17,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $instanceof/isI32 (param $0 i32) (result i32) diff --git a/tests/compiler/issues/1095.optimized.wat b/tests/compiler/issues/1095.optimized.wat index 49ea45e239..d234e0a29b 100644 --- a/tests/compiler/issues/1095.optimized.wat +++ b/tests/compiler/issues/1095.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1051,20 +1051,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/1095.untouched.wat b/tests/compiler/issues/1095.untouched.wat index 7abd437ea0..607298b673 100644 --- a/tests/compiler/issues/1095.untouched.wat +++ b/tests/compiler/issues/1095.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -39,6 +39,7 @@ (data (i32.const 508) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\000\009\005\00.\00t\00s\00") (data (i32.const 560) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/issues/1225.optimized.wat b/tests/compiler/issues/1225.optimized.wat index 782160a25f..b20c57acb5 100644 --- a/tests/compiler/issues/1225.optimized.wat +++ b/tests/compiler/issues/1225.optimized.wat @@ -3,8 +3,8 @@ (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1053,20 +1053,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/issues/1225.untouched.wat b/tests/compiler/issues/1225.untouched.wat index e6517cf44c..4823771c9e 100644 --- a/tests/compiler/issues/1225.untouched.wat +++ b/tests/compiler/issues/1225.untouched.wat @@ -38,6 +38,7 @@ (data (i32.const 412) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\002\002\005\00.\00t\00s\00") (data (i32.const 464) "\04\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) + (elem $0 (i32.const 1)) (export "normal" (func $issues/1225/normal)) (export "viaThis" (func $issues/1225/viaThis)) (export "memory" (memory $0)) diff --git a/tests/compiler/issues/1699.optimized.wat b/tests/compiler/issues/1699.optimized.wat index 8813a61e94..503f16a35c 100644 --- a/tests/compiler/issues/1699.optimized.wat +++ b/tests/compiler/issues/1699.optimized.wat @@ -1058,20 +1058,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1488 @@ -1771,14 +1768,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/issues/1699.untouched.wat b/tests/compiler/issues/1699.untouched.wat index 47b4298932..472d30f154 100644 --- a/tests/compiler/issues/1699.untouched.wat +++ b/tests/compiler/issues/1699.untouched.wat @@ -6,8 +6,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -40,6 +40,7 @@ (data (i32.const 636) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\006\009\009\00.\00t\00s\00") (data (i32.const 688) "\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\02A\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/issues/1714.untouched.wat b/tests/compiler/issues/1714.untouched.wat index f99e8183a5..ea38be61bd 100644 --- a/tests/compiler/issues/1714.untouched.wat +++ b/tests/compiler/issues/1714.untouched.wat @@ -10,6 +10,7 @@ (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00i\00s\00s\00u\00e\00s\00/\001\007\001\004\00.\00t\00s\00") (data (i32.const 60) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00i\003\002\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $issues/1714/a_i64_i32 (result i32) diff --git a/tests/compiler/issues/1751.untouched.wat b/tests/compiler/issues/1751.untouched.wat index 700fa1f9a6..f4d95ad56d 100644 --- a/tests/compiler/issues/1751.untouched.wat +++ b/tests/compiler/issues/1751.untouched.wat @@ -4,5 +4,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/limits.untouched.wat b/tests/compiler/limits.untouched.wat index b41fd91ade..871dfc3787 100644 --- a/tests/compiler/limits.untouched.wat +++ b/tests/compiler/limits.untouched.wat @@ -31,6 +31,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:limits diff --git a/tests/compiler/literals.untouched.wat b/tests/compiler/literals.untouched.wat index 72d9375de2..57ae32613d 100644 --- a/tests/compiler/literals.untouched.wat +++ b/tests/compiler/literals.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:literals diff --git a/tests/compiler/logical.optimized.wat b/tests/compiler/logical.optimized.wat index 7c21d3f995..281aaf02b4 100644 --- a/tests/compiler/logical.optimized.wat +++ b/tests/compiler/logical.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,20 +1044,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/logical.untouched.wat b/tests/compiler/logical.untouched.wat index b5cffe969a..f644b48940 100644 --- a/tests/compiler/logical.untouched.wat +++ b/tests/compiler/logical.untouched.wat @@ -7,8 +7,8 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i64_i32_=>_i32 (func (param i64 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))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $logical/i (mut i32) (i32.const 0)) (global $logical/I (mut i64) (i64.const 0)) @@ -42,6 +42,7 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $logical/testShortcutAnd (param $0 i64) (param $1 i32) (result i32) diff --git a/tests/compiler/loop-flow.optimized.wat b/tests/compiler/loop-flow.optimized.wat index ad06501000..91ceb5712c 100644 --- a/tests/compiler/loop-flow.optimized.wat +++ b/tests/compiler/loop-flow.optimized.wat @@ -1,8 +1,8 @@ (module (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 1036) ",") diff --git a/tests/compiler/loop-flow.untouched.wat b/tests/compiler/loop-flow.untouched.wat index 3d5b5916e0..d28c1bb319 100644 --- a/tests/compiler/loop-flow.untouched.wat +++ b/tests/compiler/loop-flow.untouched.wat @@ -11,6 +11,7 @@ (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00l\00o\00o\00p\00-\00f\00l\00o\00w\00.\00t\00s\00\00\00\00\00") (data (i32.const 60) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00t\00e\00r\00m\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "whileReturn" (func $loop-flow/whileReturn)) (export "whileThrow" (func $loop-flow/whileThrow)) (export "whileContinue" (func $loop-flow/whileContinue)) diff --git a/tests/compiler/loop-wrap.untouched.wat b/tests/compiler/loop-wrap.untouched.wat index 900273d284..43f9d007a9 100644 --- a/tests/compiler/loop-wrap.untouched.wat +++ b/tests/compiler/loop-wrap.untouched.wat @@ -6,6 +6,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "testAlwaysWrapped" (func $loop-wrap/testAlwaysWrapped)) (export "testFirstWrapped" (func $loop-wrap/testFirstWrapped)) (export "testSubsequentWrapped" (func $loop-wrap/testSubsequentWrapped)) diff --git a/tests/compiler/managed-cast.optimized.wat b/tests/compiler/managed-cast.optimized.wat index 1402b99423..4aa2a78181 100644 --- a/tests/compiler/managed-cast.optimized.wat +++ b/tests/compiler/managed-cast.optimized.wat @@ -4,8 +4,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1048,20 +1048,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/managed-cast.untouched.wat b/tests/compiler/managed-cast.untouched.wat index 4916b81681..a8345d8d4f 100644 --- a/tests/compiler/managed-cast.untouched.wat +++ b/tests/compiler/managed-cast.untouched.wat @@ -1,13 +1,13 @@ (module - (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_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 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -39,6 +39,7 @@ (data (i32.const 540) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\"\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00u\00p\00c\00a\00s\00t\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 608) "\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\04\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/many-locals.untouched.wat b/tests/compiler/many-locals.untouched.wat index 4788ffba0b..8a263436ce 100644 --- a/tests/compiler/many-locals.untouched.wat +++ b/tests/compiler/many-locals.untouched.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 60)) @@ -9,6 +9,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "testI32" (func $many-locals/testI32)) (export "testI8" (func $many-locals/testI8)) (export "memory" (memory $0)) diff --git a/tests/compiler/memcpy.optimized.wat b/tests/compiler/memcpy.optimized.wat index 70fd267858..36b4eb652f 100644 --- a/tests/compiler/memcpy.optimized.wat +++ b/tests/compiler/memcpy.optimized.wat @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memcpy/dest (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/memcpy.untouched.wat b/tests/compiler/memcpy.untouched.wat index b4301b54e5..ddd8ea225a 100644 --- a/tests/compiler/memcpy.untouched.wat +++ b/tests/compiler/memcpy.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memcpy/base i32 (i32.const 8)) (global $memcpy/dest (mut i32) (i32.const 0)) @@ -11,6 +11,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memcpy" (func $memcpy/memcpy)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/memmove.optimized.wat b/tests/compiler/memmove.optimized.wat index 5413cf6c29..21ae653cfb 100644 --- a/tests/compiler/memmove.optimized.wat +++ b/tests/compiler/memmove.optimized.wat @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memmove/dest (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/memmove.untouched.wat b/tests/compiler/memmove.untouched.wat index f011b0840a..bd8faf34f5 100644 --- a/tests/compiler/memmove.untouched.wat +++ b/tests/compiler/memmove.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memmove/base i32 (i32.const 8)) (global $memmove/dest (mut i32) (i32.const 0)) @@ -11,6 +11,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00m\00e\00m\00m\00o\00v\00e\00.\00t\00s\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $memmove/memmove (param $0 i32) (param $1 i32) (param $2 i32) (result i32) diff --git a/tests/compiler/memory.untouched.wat b/tests/compiler/memory.untouched.wat index d30d0ebbac..70d29f29dc 100644 --- a/tests/compiler/memory.untouched.wat +++ b/tests/compiler/memory.untouched.wat @@ -34,6 +34,7 @@ (data (i32.const 207) "\01") (data (i32.const 208) "\01") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $memory/test (result i32) diff --git a/tests/compiler/memorybase.untouched.wat b/tests/compiler/memorybase.untouched.wat index c948a68e5d..db18d4b952 100644 --- a/tests/compiler/memorybase.untouched.wat +++ b/tests/compiler/memorybase.untouched.wat @@ -8,6 +8,7 @@ (memory $0 1) (data (i32.const 1024) "\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:memorybase diff --git a/tests/compiler/memset.optimized.wat b/tests/compiler/memset.optimized.wat index 632c4af153..094e13b17d 100644 --- a/tests/compiler/memset.optimized.wat +++ b/tests/compiler/memset.optimized.wat @@ -1,7 +1,7 @@ (module - (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_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memset/dest (mut i32) (i32.const 0)) (memory $0 1) diff --git a/tests/compiler/memset.untouched.wat b/tests/compiler/memset.untouched.wat index f66d231f46..a3ff6086d9 100644 --- a/tests/compiler/memset.untouched.wat +++ b/tests/compiler/memset.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 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))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $memset/dest (mut i32) (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 60)) @@ -10,6 +10,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $memset/memset (param $0 i32) (param $1 i32) (param $2 i32) (result i32) diff --git a/tests/compiler/merge.untouched.wat b/tests/compiler/merge.untouched.wat index 1d0cb1c945..d837510f77 100644 --- a/tests/compiler/merge.untouched.wat +++ b/tests/compiler/merge.untouched.wat @@ -15,6 +15,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $merge/namespaceType.test diff --git a/tests/compiler/named-export-default.untouched.wat b/tests/compiler/named-export-default.untouched.wat index b0298f18be..e8141ba408 100644 --- a/tests/compiler/named-export-default.untouched.wat +++ b/tests/compiler/named-export-default.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "default" (func $named-export-default/get3)) (export "memory" (memory $0)) (func $named-export-default/get3 (result i32) diff --git a/tests/compiler/named-import-default.untouched.wat b/tests/compiler/named-import-default.untouched.wat index 9bac391fe1..15b4ea9176 100644 --- a/tests/compiler/named-import-default.untouched.wat +++ b/tests/compiler/named-import-default.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "getValue" (func $named-import-default/getValue)) (export "memory" (memory $0)) (func $named-export-default/get3 (result i32) diff --git a/tests/compiler/namespace.untouched.wat b/tests/compiler/namespace.untouched.wat index ca1f6681d3..58835e187f 100644 --- a/tests/compiler/namespace.untouched.wat +++ b/tests/compiler/namespace.untouched.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) + (type $none_=>_none (func)) (global $namespace/Outer.outerVar (mut i32) (i32.const 1)) (global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0)) (global $namespace/Outer.Inner.anotherVar (mut i32) (i32.const 0)) @@ -12,6 +12,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $namespace/Outer.Inner.aFunc (result i32) diff --git a/tests/compiler/new.optimized.wat b/tests/compiler/new.optimized.wat index 830eef54a0..ec7fb0c94a 100644 --- a/tests/compiler/new.optimized.wat +++ b/tests/compiler/new.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $new/ref (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1084,20 +1084,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/new.untouched.wat b/tests/compiler/new.untouched.wat index 2d1a4357d0..2b52be241c 100644 --- a/tests/compiler/new.untouched.wat +++ b/tests/compiler/new.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $new/ref (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -42,6 +42,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\07\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\00 \00\00\00\00\00\00\00 \00\00\00\04\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/nonnullable.optimized.wat b/tests/compiler/nonnullable.optimized.wat index 94e6c35ac0..3be57e4242 100644 --- a/tests/compiler/nonnullable.optimized.wat +++ b/tests/compiler/nonnullable.optimized.wat @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -53,10 +53,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -84,22 +84,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 @@ -1177,20 +1175,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1552 diff --git a/tests/compiler/nonnullable.untouched.wat b/tests/compiler/nonnullable.untouched.wat index b4f7d59485..ce2a7ca74a 100644 --- a/tests/compiler/nonnullable.untouched.wat +++ b/tests/compiler/nonnullable.untouched.wat @@ -5,10 +5,10 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 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 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -41,6 +41,7 @@ (data (i32.const 508) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 576) "\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\02A\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/number.optimized.wat b/tests/compiler/number.optimized.wat index 320c6999e4..7689283fff 100644 --- a/tests/compiler/number.optimized.wat +++ b/tests/compiler/number.optimized.wat @@ -1091,20 +1091,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1616 @@ -1878,10 +1875,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -1909,22 +1906,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/number.untouched.wat b/tests/compiler/number.untouched.wat index 7707d4d94d..659e2fc3fa 100644 --- a/tests/compiler/number.untouched.wat +++ b/tests/compiler/number.untouched.wat @@ -6,16 +6,16 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $f64_=>_i32 (func (param f64) (result i32))) - (type $f32_=>_i32 (func (param f32) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $number/a (mut i32) (i32.const 1)) @@ -85,6 +85,7 @@ (data (i32.const 3596) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00f\00a\00l\00s\00e\00\00\00") (data (i32.const 3632) "\03\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/util/number/decimalCount32 (param $0 i32) (result i32) diff --git a/tests/compiler/object-literal.optimized.wat b/tests/compiler/object-literal.optimized.wat index b8a3de7242..48e60473ad 100644 --- a/tests/compiler/object-literal.optimized.wat +++ b/tests/compiler/object-literal.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (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))) @@ -922,20 +922,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 @@ -1808,10 +1805,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -1839,22 +1836,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/object-literal.untouched.wat b/tests/compiler/object-literal.untouched.wat index 24350af97d..f54cd3df18 100644 --- a/tests/compiler/object-literal.untouched.wat +++ b/tests/compiler/object-literal.untouched.wat @@ -2,16 +2,16 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_f64_=>_none (func (param i32 f64))) - (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_f32_=>_none (func (param i32 f32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_f32_=>_none (func (param i32 f32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) @@ -47,6 +47,7 @@ (data (i32.const 652) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00b\00a\00z\00\00\00\00\00\00\00") (data (i32.const 688) "\07\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $object-literal/Managed#set:bar (param $0 i32) (param $1 i32) diff --git a/tests/compiler/optional-typeparameters.optimized.wat b/tests/compiler/optional-typeparameters.optimized.wat index 12579207ca..215d715993 100644 --- a/tests/compiler/optional-typeparameters.optimized.wat +++ b/tests/compiler/optional-typeparameters.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1056,20 +1056,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat index 08c41ebb34..39eb4ada0e 100644 --- a/tests/compiler/optional-typeparameters.untouched.wat +++ b/tests/compiler/optional-typeparameters.untouched.wat @@ -39,6 +39,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $optional-typeparameters/testConcrete (param $0 i32) (result i32) diff --git a/tests/compiler/overflow.untouched.wat b/tests/compiler/overflow.untouched.wat index b7d2046208..66b4056373 100644 --- a/tests/compiler/overflow.untouched.wat +++ b/tests/compiler/overflow.untouched.wat @@ -8,6 +8,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\16\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:overflow diff --git a/tests/compiler/portable-conversions.untouched.wat b/tests/compiler/portable-conversions.untouched.wat index 61c3488b3b..fda49f783b 100644 --- a/tests/compiler/portable-conversions.untouched.wat +++ b/tests/compiler/portable-conversions.untouched.wat @@ -12,6 +12,7 @@ (memory $0 1) (data (i32.const 12) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00.\00\00\00p\00o\00r\00t\00a\00b\00l\00e\00-\00c\00o\00n\00v\00e\00r\00s\00i\00o\00n\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:portable-conversions diff --git a/tests/compiler/possibly-null.untouched.wat b/tests/compiler/possibly-null.untouched.wat index aa17e4593a..831bb2c21e 100644 --- a/tests/compiler/possibly-null.untouched.wat +++ b/tests/compiler/possibly-null.untouched.wat @@ -1,15 +1,16 @@ (module (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 8)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16392)) (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "testTrue" (func $export:possibly-null/testTrue)) (export "testFalseElse" (func $export:possibly-null/testFalseElse)) diff --git a/tests/compiler/recursive.untouched.wat b/tests/compiler/recursive.untouched.wat index ea3410c17b..e435f21f18 100644 --- a/tests/compiler/recursive.untouched.wat +++ b/tests/compiler/recursive.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "fib" (func $recursive/fib)) (export "memory" (memory $0)) (func $recursive/fib (param $0 i32) (result i32) diff --git a/tests/compiler/reexport.optimized.wat b/tests/compiler/reexport.optimized.wat index 20a33d4c4d..d6cf608c9e 100644 --- a/tests/compiler/reexport.optimized.wat +++ b/tests/compiler/reexport.optimized.wat @@ -5,8 +5,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -1133,20 +1133,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/reexport.untouched.wat b/tests/compiler/reexport.untouched.wat index d1df27a40e..dfeefaf1a6 100644 --- a/tests/compiler/reexport.untouched.wat +++ b/tests/compiler/reexport.untouched.wat @@ -51,6 +51,7 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\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\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "add" (func $export/add)) (export "renamed_sub" (func $export/sub)) (export "renamed_mul" (func $export/mul)) diff --git a/tests/compiler/rereexport.optimized.wat b/tests/compiler/rereexport.optimized.wat index 333343394e..211ab5d6e7 100644 --- a/tests/compiler/rereexport.optimized.wat +++ b/tests/compiler/rereexport.optimized.wat @@ -1,11 +1,11 @@ (module (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) @@ -1095,20 +1095,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/rereexport.untouched.wat b/tests/compiler/rereexport.untouched.wat index 7533f5ae91..1bee66560a 100644 --- a/tests/compiler/rereexport.untouched.wat +++ b/tests/compiler/rereexport.untouched.wat @@ -6,8 +6,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $export/a i32 (i32.const 1)) (global $export/b i32 (i32.const 2)) @@ -47,6 +47,7 @@ (data (i32.const 460) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00r\00e\00r\00e\00e\00x\00p\00o\00r\00t\00.\00t\00s\00\00\00") (data (i32.const 512) "\04\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) + (elem $0 (i32.const 1)) (export "a" (global $export/a)) (export "renamed_a" (global $export/a)) (export "renamed_b" (global $export/b)) diff --git a/tests/compiler/resolve-access.optimized.wat b/tests/compiler/resolve-access.optimized.wat index 88f7ad3a8b..e4af9d5ab6 100644 --- a/tests/compiler/resolve-access.optimized.wat +++ b/tests/compiler/resolve-access.optimized.wat @@ -1069,20 +1069,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1424 diff --git a/tests/compiler/resolve-access.untouched.wat b/tests/compiler/resolve-access.untouched.wat index d984a0a2af..f91b27254c 100644 --- a/tests/compiler/resolve-access.untouched.wat +++ b/tests/compiler/resolve-access.untouched.wat @@ -7,14 +7,14 @@ (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -52,6 +52,7 @@ (data (i32.const 2172) "\\\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00H\00\00\000\001\002\003\004\005\006\007\008\009\00a\00b\00c\00d\00e\00f\00g\00h\00i\00j\00k\00l\00m\00n\00o\00p\00q\00r\00s\00t\00u\00v\00w\00x\00y\00z\00\00\00\00\00") (data (i32.const 2272) "\06\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\02\02\00\00\00\00\00\00\02\t\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "arrayAccess" (func $resolve-access/arrayAccess)) (export "fieldAccess" (func $resolve-access/fieldAccess)) (export "propertyAccess" (func $resolve-access/propertyAccess)) diff --git a/tests/compiler/resolve-binary.optimized.wat b/tests/compiler/resolve-binary.optimized.wat index b4fcca726f..346530940b 100644 --- a/tests/compiler/resolve-binary.optimized.wat +++ b/tests/compiler/resolve-binary.optimized.wat @@ -1,13 +1,13 @@ (module + (type $i32_i32_=>_i32 (func (param i32 i32) (result 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 $none_=>_i32 (func (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i64_i32_i64_i32_i64_=>_i32 (func (param i64 i32 i64 i32 i64) (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-binary/a (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -250,10 +250,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -281,22 +281,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 @@ -1390,20 +1388,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1776 diff --git a/tests/compiler/resolve-binary.untouched.wat b/tests/compiler/resolve-binary.untouched.wat index 7d3a95eb8e..5226bafe9d 100644 --- a/tests/compiler/resolve-binary.untouched.wat +++ b/tests/compiler/resolve-binary.untouched.wat @@ -6,17 +6,17 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 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_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $resolve-binary/a (mut i32) (i32.const 0)) @@ -95,6 +95,7 @@ (data (i32.const 10188) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00p\00o\00w\00\00\00\00\00\00\00") (data (i32.const 10224) "\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\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/number/Bool#toString (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/resolve-elementaccess.optimized.wat b/tests/compiler/resolve-elementaccess.optimized.wat index 7bd11c6571..f028db980e 100644 --- a/tests/compiler/resolve-elementaccess.optimized.wat +++ b/tests/compiler/resolve-elementaccess.optimized.wat @@ -5,14 +5,14 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $none_=>_i32 (func (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $f32_=>_i32 (func (param f32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1121,20 +1121,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1504 @@ -4105,10 +4102,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -4136,22 +4133,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-elementaccess.untouched.wat b/tests/compiler/resolve-elementaccess.untouched.wat index c6879a5eed..3760f257b0 100644 --- a/tests/compiler/resolve-elementaccess.untouched.wat +++ b/tests/compiler/resolve-elementaccess.untouched.wat @@ -7,17 +7,17 @@ (type $none_=>_none (func)) (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 $i32_i32_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f32_i32_=>_i32 (func (param f32 i32) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) + (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -78,6 +78,7 @@ (data (i32.const 3740) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\001\001\00\00\00\00\00\00\00\00\00") (data (i32.const 3776) "\06\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\01\19\00\00\02\00\00\00A\00\00\00\05\00\00\00A\00\00\00\02\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/resolve-function-expression.optimized.wat b/tests/compiler/resolve-function-expression.optimized.wat index f7b7df0d49..6b1d64e078 100644 --- a/tests/compiler/resolve-function-expression.optimized.wat +++ b/tests/compiler/resolve-function-expression.optimized.wat @@ -3,8 +3,8 @@ (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1084,20 +1084,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1792 @@ -2084,7 +2081,10 @@ br_if $__inlined_func$~lib/string/String.__eq drop i32.const 0 + i32.const 3408 + i32.const 0 local.get $1 + select i32.eqz br_if $__inlined_func$~lib/string/String.__eq drop @@ -2110,13 +2110,13 @@ local.tee $0 i32.const 7 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $2 local.tee $1 i32.const 4 i32.ge_u select + i32.eqz if loop $do-continue|0 local.get $0 diff --git a/tests/compiler/resolve-function-expression.untouched.wat b/tests/compiler/resolve-function-expression.untouched.wat index 99d36bada8..7174e25b13 100644 --- a/tests/compiler/resolve-function-expression.untouched.wat +++ b/tests/compiler/resolve-function-expression.untouched.wat @@ -6,12 +6,12 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~argumentsLength (mut i32) (i32.const 0)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) diff --git a/tests/compiler/resolve-nested.optimized.wat b/tests/compiler/resolve-nested.optimized.wat index 4a988d23b6..1b85176177 100644 --- a/tests/compiler/resolve-nested.optimized.wat +++ b/tests/compiler/resolve-nested.optimized.wat @@ -5,9 +5,9 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) - (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) + (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1053,20 +1053,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/resolve-nested.untouched.wat b/tests/compiler/resolve-nested.untouched.wat index 1820a44757..32ada90a5c 100644 --- a/tests/compiler/resolve-nested.untouched.wat +++ b/tests/compiler/resolve-nested.untouched.wat @@ -5,11 +5,11 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32))) (type $i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32))) + (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 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 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-nested/Outer.Inner.a (mut i32) (i32.const 0)) (global $resolve-nested/Outer.Inner.b (mut i32) (i32.const 0)) @@ -54,6 +54,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\06\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\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "Outer.InnerClass" (global $resolve-nested/Outer.InnerClass)) (export "Outer.Inner.EvenInnerClass" (global $resolve-nested/Outer.Inner.EvenInnerClass)) (export "memory" (memory $0)) diff --git a/tests/compiler/resolve-new.optimized.wat b/tests/compiler/resolve-new.optimized.wat index 502e4e81c3..d015ce8fa5 100644 --- a/tests/compiler/resolve-new.optimized.wat +++ b/tests/compiler/resolve-new.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1049,20 +1049,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/resolve-new.untouched.wat b/tests/compiler/resolve-new.untouched.wat index 32eda1ab6a..4e69d703fd 100644 --- a/tests/compiler/resolve-new.untouched.wat +++ b/tests/compiler/resolve-new.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -37,6 +37,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/resolve-propertyaccess.optimized.wat b/tests/compiler/resolve-propertyaccess.optimized.wat index e9cd3e6928..5c60253bf6 100644 --- a/tests/compiler/resolve-propertyaccess.optimized.wat +++ b/tests/compiler/resolve-propertyaccess.optimized.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1084,20 +1084,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1616 @@ -1767,10 +1764,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -1798,22 +1795,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-propertyaccess.untouched.wat b/tests/compiler/resolve-propertyaccess.untouched.wat index 9e67cfdb52..43c71aa342 100644 --- a/tests/compiler/resolve-propertyaccess.untouched.wat +++ b/tests/compiler/resolve-propertyaccess.untouched.wat @@ -7,11 +7,11 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-propertyaccess/Namespace.member i32 (i32.const 1)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -68,6 +68,7 @@ (data (i32.const 2620) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\008\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 2656) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/util/number/decimalCount32 (param $0 i32) (result i32) diff --git a/tests/compiler/resolve-ternary.optimized.wat b/tests/compiler/resolve-ternary.optimized.wat index 530e39c7a2..51fd751aea 100644 --- a/tests/compiler/resolve-ternary.optimized.wat +++ b/tests/compiler/resolve-ternary.optimized.wat @@ -1088,20 +1088,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1616 @@ -1875,10 +1872,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -1906,22 +1903,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-ternary.untouched.wat b/tests/compiler/resolve-ternary.untouched.wat index 1a756f89c8..8c7ab33c96 100644 --- a/tests/compiler/resolve-ternary.untouched.wat +++ b/tests/compiler/resolve-ternary.untouched.wat @@ -1,21 +1,21 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (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_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $resolve-ternary/b (mut i32) (i32.const 1)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) diff --git a/tests/compiler/resolve-unary.optimized.wat b/tests/compiler/resolve-unary.optimized.wat index ee80174999..3cb3074983 100644 --- a/tests/compiler/resolve-unary.optimized.wat +++ b/tests/compiler/resolve-unary.optimized.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1104,20 +1104,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1616 @@ -1787,10 +1784,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -1818,22 +1815,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/resolve-unary.untouched.wat b/tests/compiler/resolve-unary.untouched.wat index 18da1fab02..93609cf020 100644 --- a/tests/compiler/resolve-unary.untouched.wat +++ b/tests/compiler/resolve-unary.untouched.wat @@ -6,12 +6,12 @@ (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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -65,6 +65,7 @@ (data (i32.const 2668) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00i\00-\00-\00\00\00\00\00\00\00") (data (i32.const 2704) "\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\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/util/number/decimalCount32 (param $0 i32) (result i32) diff --git a/tests/compiler/retain-i32.untouched.wat b/tests/compiler/retain-i32.untouched.wat index d9f39ee703..9e07d285b9 100644 --- a/tests/compiler/retain-i32.untouched.wat +++ b/tests/compiler/retain-i32.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128)) @@ -21,6 +21,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00r\00e\00t\00a\00i\00n\00-\00i\003\002\00.\00t\00s\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $retain-i32/test (param $0 i32) (param $1 i32) diff --git a/tests/compiler/rt/finalize.optimized.wat b/tests/compiler/rt/finalize.optimized.wat index 2a8639e75a..8b15381f84 100644 --- a/tests/compiler/rt/finalize.optimized.wat +++ b/tests/compiler/rt/finalize.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $rt/finalize/expect (mut i32) (i32.const 0)) @@ -1062,20 +1062,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/rt/finalize.untouched.wat b/tests/compiler/rt/finalize.untouched.wat index 4bfff2000c..fa8d7a379b 100644 --- a/tests/compiler/rt/finalize.untouched.wat +++ b/tests/compiler/rt/finalize.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $rt/finalize/expect (mut i32) (i32.const 0)) (global $rt/finalize/ran (mut i32) (i32.const 0)) @@ -40,6 +40,7 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/rt/ids.untouched.wat b/tests/compiler/rt/ids.untouched.wat index dc9a07c925..e0aa4ac445 100644 --- a/tests/compiler/rt/ids.untouched.wat +++ b/tests/compiler/rt/ids.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:rt/ids diff --git a/tests/compiler/rt/instanceof.optimized.wat b/tests/compiler/rt/instanceof.optimized.wat index fb319b27de..2f088c4a51 100644 --- a/tests/compiler/rt/instanceof.optimized.wat +++ b/tests/compiler/rt/instanceof.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1087,20 +1087,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/rt/instanceof.untouched.wat b/tests/compiler/rt/instanceof.untouched.wat index 3556fc4609..b0dd9f536a 100644 --- a/tests/compiler/rt/instanceof.untouched.wat +++ b/tests/compiler/rt/instanceof.untouched.wat @@ -6,8 +6,8 @@ (type $i32_i32_=>_i32 (func (param 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 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -47,6 +47,7 @@ (data (i32.const 412) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00r\00t\00/\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 480) "\06\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\03\00\00\00 \00\00\00\04\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/rt/runtime-incremental-export.optimized.wat b/tests/compiler/rt/runtime-incremental-export.optimized.wat index 7fa1457bb2..f6d53b32c4 100644 --- a/tests/compiler/rt/runtime-incremental-export.optimized.wat +++ b/tests/compiler/rt/runtime-incremental-export.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1062,20 +1062,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/rt/runtime-incremental-export.untouched.wat b/tests/compiler/rt/runtime-incremental-export.untouched.wat index 44b8e896a9..ab3b34728b 100644 --- a/tests/compiler/rt/runtime-incremental-export.untouched.wat +++ b/tests/compiler/rt/runtime-incremental-export.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,6 +38,7 @@ (data (i32.const 476) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00O\00b\00j\00e\00c\00t\00 \00i\00s\00 \00n\00o\00t\00 \00p\00i\00n\00n\00e\00d\00\00\00\00\00") (data (i32.const 544) "\03\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) + (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/itcms/__new)) (export "__pin" (func $~lib/rt/itcms/__pin)) (export "__unpin" (func $~lib/rt/itcms/__unpin)) diff --git a/tests/compiler/rt/runtime-incremental.untouched.wat b/tests/compiler/rt/runtime-incremental.untouched.wat index 700fa1f9a6..f4d95ad56d 100644 --- a/tests/compiler/rt/runtime-incremental.untouched.wat +++ b/tests/compiler/rt/runtime-incremental.untouched.wat @@ -4,5 +4,6 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/rt/runtime-minimal-export.optimized.wat b/tests/compiler/rt/runtime-minimal-export.optimized.wat index 4a30a4aea5..3971c2f831 100644 --- a/tests/compiler/rt/runtime-minimal-export.optimized.wat +++ b/tests/compiler/rt/runtime-minimal-export.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -1336,20 +1336,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $3 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1184 diff --git a/tests/compiler/rt/runtime-minimal-export.untouched.wat b/tests/compiler/rt/runtime-minimal-export.untouched.wat index f69cc7b58e..4a4b8da36f 100644 --- a/tests/compiler/rt/runtime-minimal-export.untouched.wat +++ b/tests/compiler/rt/runtime-minimal-export.untouched.wat @@ -28,6 +28,7 @@ (data (i32.const 400) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 432) "\03\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) + (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/tcms/__new)) (export "__pin" (func $~lib/rt/tcms/__pin)) (export "__unpin" (func $~lib/rt/tcms/__unpin)) diff --git a/tests/compiler/rt/runtime-minimal.untouched.wat b/tests/compiler/rt/runtime-minimal.untouched.wat index bffe105a3d..00fc29c6cc 100644 --- a/tests/compiler/rt/runtime-minimal.untouched.wat +++ b/tests/compiler/rt/runtime-minimal.untouched.wat @@ -1,5 +1,6 @@ (module (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/rt/runtime-stub-export.optimized.wat b/tests/compiler/rt/runtime-stub-export.optimized.wat index 13f4d06bf4..7a9ee9f9ef 100644 --- a/tests/compiler/rt/runtime-stub-export.optimized.wat +++ b/tests/compiler/rt/runtime-stub-export.optimized.wat @@ -1,9 +1,9 @@ (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_=>_none (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) (global $~lib/rt/__rtti_base i32 (i32.const 1168)) diff --git a/tests/compiler/rt/runtime-stub-export.untouched.wat b/tests/compiler/rt/runtime-stub-export.untouched.wat index 0c8ca82e54..481f696f34 100644 --- a/tests/compiler/rt/runtime-stub-export.untouched.wat +++ b/tests/compiler/rt/runtime-stub-export.untouched.wat @@ -1,8 +1,8 @@ (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 $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -15,6 +15,7 @@ (data (i32.const 76) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00s\00t\00u\00b\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 144) "\03\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) + (elem $0 (i32.const 1)) (export "__new" (func $~lib/rt/stub/__new)) (export "__pin" (func $~lib/rt/stub/__pin)) (export "__unpin" (func $~lib/rt/stub/__unpin)) diff --git a/tests/compiler/rt/runtime-stub.untouched.wat b/tests/compiler/rt/runtime-stub.untouched.wat index bffe105a3d..00fc29c6cc 100644 --- a/tests/compiler/rt/runtime-stub.untouched.wat +++ b/tests/compiler/rt/runtime-stub.untouched.wat @@ -1,5 +1,6 @@ (module (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) ) diff --git a/tests/compiler/scoped.untouched.wat b/tests/compiler/scoped.untouched.wat index f87183185e..664f2e8fc3 100644 --- a/tests/compiler/scoped.untouched.wat +++ b/tests/compiler/scoped.untouched.wat @@ -9,6 +9,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $scoped/fn (param $0 i32) diff --git a/tests/compiler/static-this.untouched.wat b/tests/compiler/static-this.untouched.wat index 11d91212bf..2d695fd6a5 100644 --- a/tests/compiler/static-this.untouched.wat +++ b/tests/compiler/static-this.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $static-this/Foo.bar (mut i32) (i32.const 42)) (global $~lib/memory/__data_end i32 (i32.const 60)) @@ -10,6 +10,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00s\00t\00a\00t\00i\00c\00-\00t\00h\00i\00s\00.\00t\00s\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $static-this/Foo.getBar (result i32) diff --git a/tests/compiler/std/array-access.optimized.wat b/tests/compiler/std/array-access.optimized.wat index 8bcbee5535..ead727b809 100644 --- a/tests/compiler/std/array-access.optimized.wat +++ b/tests/compiler/std/array-access.optimized.wat @@ -61,13 +61,13 @@ local.tee $2 i32.const 7 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $1 local.tee $0 i32.const 4 i32.ge_u select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index 12bf8213b3..ded68ad72b 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -1,10 +1,10 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 284)) @@ -16,6 +16,7 @@ (data (i32.const 124) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 252) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "i32ArrayArrayElementAccess" (func $export:std/array-access/i32ArrayArrayElementAccess)) (export "stringArrayPropertyAccess" (func $export:std/array-access/stringArrayPropertyAccess)) diff --git a/tests/compiler/std/array-literal.optimized.wat b/tests/compiler/std/array-literal.optimized.wat index a13b011767..c4d0037a4b 100644 --- a/tests/compiler/std/array-literal.optimized.wat +++ b/tests/compiler/std/array-literal.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) @@ -1142,20 +1142,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1744 @@ -1852,14 +1849,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 1cad1167b7..5cbfefc3df 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -53,6 +53,7 @@ (data (i32.const 700) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 768) "\t\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00B\08\00\00\00\00\00\00\02\t\00\00\00\00\00\00 \00\00\00\00\00\00\00\02A\00\00\00\00\00\00 \00\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/array/Array#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index 20e15a7958..f9716db932 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -11,15 +11,15 @@ (type $none_=>_none (func)) (type $none_=>_f64 (func (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) - (type $i64_=>_none (func (param i64))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $none_=>_i32 (func (result i32))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i64_=>_none (func (param i64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (import "env" "seed" (func $~lib/builtins/seed (result f64))) @@ -1512,20 +1512,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1488 @@ -2445,14 +2442,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 @@ -5943,17 +5937,16 @@ (local $4 i32) (local $5 i32) (local $6 i32) - i32.const 1 local.get $1 - i32.eqz - i32.const 1 + i32.const 0 + i32.const 0 local.get $0 - i32.eqz local.get $0 local.get $1 i32.eq select select + i32.eqz if i32.const 0 return @@ -5991,6 +5984,14 @@ return end block $__inlined_func$~lib/util/string/compareImpl (result i32) + local.get $0 + i32.const 7 + i32.and + local.get $1 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $6 local.get $5 local.get $5 @@ -6000,18 +6001,8 @@ local.tee $3 i32.const 4 i32.ge_u - if (result i32) - local.get $0 - i32.const 7 - i32.and - local.get $1 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $0 @@ -6091,10 +6082,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -6119,23 +6110,20 @@ end block $__inlined_func$~lib/util/string/compareImpl (result i32) local.get $0 - local.set $3 + local.tee $3 + i32.const 7 + i32.and + local.get $1 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $2 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $3 - i32.const 7 - i32.and - local.get $1 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $3 diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 5e8a1ff554..4517210ada 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -9,25 +9,25 @@ (type $none_=>_none (func)) (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $none_=>_f64 (func (result f64))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i64_=>_i64 (func (param i64) (result i64))) (type $i64_=>_none (func (param i64))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) + (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $i64_=>_i64 (func (param i64) (result i64))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "Math" "random" (func $~lib/bindings/Math/random (result f64))) (import "env" "seed" (func $~lib/builtins/seed (result f64))) diff --git a/tests/compiler/std/arraybuffer.optimized.wat b/tests/compiler/std/arraybuffer.optimized.wat index 60156b3fd5..0826be898f 100644 --- a/tests/compiler/std/arraybuffer.optimized.wat +++ b/tests/compiler/std/arraybuffer.optimized.wat @@ -1059,20 +1059,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/std/arraybuffer.untouched.wat b/tests/compiler/std/arraybuffer.untouched.wat index 753029cb35..59208e9c67 100644 --- a/tests/compiler/std/arraybuffer.untouched.wat +++ b/tests/compiler/std/arraybuffer.untouched.wat @@ -2,8 +2,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_none (func)) (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_=>_i32 (func (param i32 i32 i32 i32) (result i32))) @@ -43,6 +43,7 @@ (data (i32.const 620) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 688) "\10\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\02\t\00\00\00\00\00\00A\08\00\00\02\00\00\00A\00\00\00\02\00\00\00A\00\00\00\02\00\00\00\81\08\00\00\02\00\00\00\81\00\00\00\02\00\00\00\01\t\00\00\02\00\00\00\01\01\00\00\02\00\00\00\01\n\00\00\02\00\00\00\01\02\00\00\02\00\00\00\01\19\00\00\02\00\00\00\01\1a\00\00\02\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index c1bc285939..22ff198433 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -5,14 +5,14 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) - (type $i32_f64_i32_=>_none (func (param i32 f64 i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) + (type $i32_f64_i32_=>_none (func (param i32 f64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1065,20 +1065,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1504 diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index 75add628d2..c2cb3f4fbb 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -3,19 +3,19 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $none_=>_none (func)) (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 $i32_i32_i32_=>_i64 (func (param i32 i32 i32) (result i64))) (type $i32_i32_i64_i32_=>_none (func (param i32 i32 i64 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_i32_=>_i64 (func (param i32 i32 i32) (result i64))) - (type $i32_i32_f32_i32_=>_none (func (param i32 i32 f32 i32))) - (type $i32_i32_f64_i32_=>_none (func (param i32 i32 f64 i32))) (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i64 (func (param i64) (result i64))) (type $i32_i32_i32_=>_f32 (func (param i32 i32 i32) (result f32))) + (type $i64_=>_i64 (func (param i64) (result i64))) (type $i32_i32_i32_=>_f64 (func (param i32 i32 i32) (result f64))) + (type $i32_i32_f32_i32_=>_none (func (param i32 i32 f32 i32))) + (type $i32_i32_f64_i32_=>_none (func (param i32 i32 f64 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -50,6 +50,7 @@ (data (i32.const 652) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00s\00t\00d\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 720) "\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\00A\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/date.optimized.wat b/tests/compiler/std/date.optimized.wat index 196385c5a2..c89a8613c8 100644 --- a/tests/compiler/std/date.optimized.wat +++ b/tests/compiler/std/date.optimized.wat @@ -6,12 +6,12 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i64_=>_none (func (param i32 i64))) (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) + (type $i64_=>_i32 (func (param i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/date/_day (mut i32) (i32.const 0)) (global $~lib/date/_month (mut i32) (i32.const 0)) @@ -1424,20 +1424,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1536 @@ -3539,22 +3536,19 @@ i32.const 1 i32.shl i32.add - local.set $1 + local.tee $1 + i32.const 7 + i32.and + local.get $2 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $3 i32.const 4 i32.ge_u - if (result i32) - local.get $1 - i32.const 7 - i32.and - local.get $2 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $1 @@ -3625,10 +3619,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -3765,14 +3759,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 @@ -9622,7 +9613,7 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - i32.const 1 + i32.const 0 i32.const 1868 i32.load i32.const 1 @@ -9630,7 +9621,6 @@ i32.const 1 i32.shl local.tee $3 - i32.eqz local.get $0 i32.const 20 i32.sub @@ -9646,6 +9636,7 @@ local.tee $2 i32.gt_u select + i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 diff --git a/tests/compiler/std/date.untouched.wat b/tests/compiler/std/date.untouched.wat index cf459b4d5e..877b20efb8 100644 --- a/tests/compiler/std/date.untouched.wat +++ b/tests/compiler/std/date.untouched.wat @@ -2,22 +2,22 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 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_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) + (type $i64_=>_i32 (func (param i64) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) + (type $i32_i64_=>_i64 (func (param i32 i64) (result i64))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) - (type $i32_i32_i32_i32_i32_i32_i32_=>_i64 (func (param i32 i32 i32 i32 i32 i32 i32) (result i64))) - (type $i32_i64_=>_i64 (func (param i32 i64) (result i64))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/date/_day (mut i32) (i32.const 0)) (global $~lib/date/_month (mut i32) (i32.const 0)) @@ -146,6 +146,7 @@ (data (i32.const 6396) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00-\002\007\001\008\002\001\00-\000\004\00-\002\000\00T\000\000\00:\000\000\00:\000\000\00.\000\000\001\00Z\00\00\00\00\00\00\00") (data (i32.const 6480) "\07\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\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00\02\t\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/date/daysSinceEpoch (param $0 i32) (param $1 i32) (param $2 i32) (result i32) diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 6fe5434804..72f358b8ca 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17788)) diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 911e6494c9..0f361c1678 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -1,9 +1,9 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 380)) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16764)) @@ -20,6 +20,7 @@ (data (i32.const 284) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 332) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 7d0fd43a4f..87a0ba14a8 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -4,19 +4,19 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) + (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) (type $i32_f64_=>_none (func (param i32 f64))) + (type $i32_f32_i32_=>_none (func (param i32 f32 i32))) (type $i32_f64_i32_=>_none (func (param i32 f64 i32))) - (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1073,20 +1073,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 4a43797f69..fc7e0b30b7 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -6,29 +6,29 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_f64_=>_none (func (param i32 f64))) - (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) + (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_f64_=>_none (func (param i32 f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i64_=>_i32 (func (param i32 i64 i64) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $none_=>_i32 (func (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (result i32))) (type $i32_f64_f64_=>_i32 (func (param i32 f64 f64) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -63,6 +63,7 @@ (data (i32.const 684) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 736) " \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\10\89\10\00\00\00\00\00B\08\00\00\00\00\00\00\02\t\00\00\00\00\00\00P\88\10\00\00\00\00\00\10\t\12\00\00\00\00\00\10\89\00\00\00\00\00\00B\00\00\00\00\00\00\00P\80\00\00\00\00\00\00\10\t\11\00\00\00\00\00\82\08\00\00\00\00\00\00\90\08\11\00\00\00\00\00\10\t\01\00\00\00\00\00\82\00\00\00\00\00\00\00\90\00\01\00\00\00\00\00\10\t\02\00\00\00\00\00\02\01\00\00\00\00\00\00\10\01\02\00\00\00\00\00\10\t\14\00\00\00\00\00\02\n\00\00\00\00\00\00\10\n\14\00\00\00\00\00\10\t\04\00\00\00\00\00\02\02\00\00\00\00\00\00\10\02\04\00\00\00\00\00\10\t2\00\00\00\00\00\02\19\00\00\00\00\00\00\10\192\00\00\00\00\00\10\t4\00\00\00\00\00\02\1a\00\00\00\00\00\00\10\1a4\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/math.optimized.wat b/tests/compiler/std/math.optimized.wat index 55559f5afd..343fd59f3d 100644 --- a/tests/compiler/std/math.optimized.wat +++ b/tests/compiler/std/math.optimized.wat @@ -5,22 +5,22 @@ (type $f32_=>_f32 (func (param f32) (result f32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $f64_f64_f64_f64_=>_i32 (func (param f64 f64 f64 f64) (result i32))) - (type $none_=>_none (func)) - (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $f32_f32_f32_f32_=>_i32 (func (param f32 f32 f32 f32) (result i32))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $none_=>_f64 (func (result f64))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) + (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) + (type $none_=>_none (func)) + (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $f32_i32_f32_=>_i32 (func (param f32 i32 f32) (result i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i64_=>_none (func (param i64))) + (type $f64_f64_i32_=>_f64 (func (param f64 f64 i32) (result f64))) (type $f64_=>_none (func (param f64))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i64_i64_i64_i64_i64_=>_none (func (param i64 i64 i64 i64 i64))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $f32_i32_f32_=>_i32 (func (param f32 i32 f32) (result i32))) (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) - (type $f64_f64_i32_=>_f64 (func (param f64 f64 i32) (result f64))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "Math" "E" (global $~lib/bindings/Math/E f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN10" (global $~lib/bindings/Math/LN10 f64)) @@ -6085,13 +6085,13 @@ local.get $5 f64.reinterpret_i64 local.tee $0 - i32.const 1 + i64.const 0 local.get $4 - i64.eqz local.get $11 i32.const 2047 i32.eq select + i64.eqz br_if $__inlined_func$~lib/math/NativeMath.hypot drop local.get $0 @@ -6245,15 +6245,14 @@ local.get $0 local.get $1 f32.add - i32.const 1 local.get $5 local.get $4 i32.sub i32.const 209715200 i32.ge_u i32.const 1 + i32.const 0 local.get $4 - i32.eqz local.get $5 i32.const 2139095040 i32.ge_u @@ -6392,12 +6391,12 @@ local.get $6 i64.const 32 i64.shl - i64.eqz - i32.const 0 + i64.const 1 local.get $4 i32.const 1072693248 i32.eq select + i64.eqz if f64.const 0 local.set $3 diff --git a/tests/compiler/std/math.untouched.wat b/tests/compiler/std/math.untouched.wat index 5b62b7264e..9919a8c6d9 100644 --- a/tests/compiler/std/math.untouched.wat +++ b/tests/compiler/std/math.untouched.wat @@ -1,33 +1,33 @@ (module (type $f64_=>_f64 (func (param f64) (result f64))) - (type $f32_f32_f32_i32_=>_i32 (func (param f32 f32 f32 i32) (result i32))) (type $f64_f64_f64_i32_=>_i32 (func (param f64 f64 f64 i32) (result i32))) + (type $f32_f32_f32_i32_=>_i32 (func (param f32 f32 f32 i32) (result i32))) (type $f32_=>_f32 (func (param f32) (result f32))) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $f32_f32_f32_f32_i32_=>_i32 (func (param f32 f32 f32 f32 i32) (result i32))) (type $f64_f64_f64_f64_i32_=>_i32 (func (param f64 f64 f64 f64 i32) (result i32))) + (type $f32_f32_f32_f32_i32_=>_i32 (func (param f32 f32 f32 f32 i32) (result i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) (type $none_=>_f64 (func (result f64))) - (type $none_=>_none (func)) (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i64_=>_none (func (param i64))) - (type $f64_=>_none (func (param f64))) + (type $none_=>_none (func)) + (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) + (type $f64_f64_f64_=>_f64 (func (param f64 f64 f64) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i64_i64_i64_i64_i64_i32_=>_i32 (func (param i64 i64 i64 i64 i64 i32) (result i32))) - (type $f32_i32_f32_f32_i32_=>_i32 (func (param f32 i32 f32 f32 i32) (result i32))) + (type $f32_i32_=>_f32 (func (param f32 i32) (result f32))) + (type $f32_f32_f32_=>_f32 (func (param f32 f32 f32) (result f32))) (type $f64_i32_f64_f64_i32_=>_i32 (func (param f64 i32 f64 f64 i32) (result i32))) + (type $f32_i32_f32_f32_i32_=>_i32 (func (param f32 i32 f32 f32 i32) (result i32))) (type $f64_i64_=>_i32 (func (param f64 i64) (result i32))) (type $i64_=>_i64 (func (param i64) (result i64))) - (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i64_=>_none (func (param i64))) (type $none_=>_f32 (func (result f32))) - (type $f32_i32_=>_f32 (func (param f32 i32) (result f32))) - (type $f32_f32_f32_=>_f32 (func (param f32 f32 f32) (result f32))) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $f64_f64_i32_=>_f64 (func (param f64 f64 i32) (result f64))) - (type $f64_f64_f64_=>_f64 (func (param f64 f64 f64) (result f64))) + (type $f64_=>_none (func (param f64))) + (type $i64_i64_i64_i64_i64_i32_=>_i32 (func (param i64 i64 i64 i64 i64 i32) (result i32))) + (type $i64_i64_=>_i64 (func (param i64 i64) (result i64))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "Math" "E" (global $~lib/bindings/Math/E f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN10" (global $~lib/bindings/Math/LN10 f64)) @@ -126,6 +126,7 @@ (data (i32.const 9248) "\00\00\00\00\00\a0\f6?\00\00\00\00\00\00\00\00\00\c8\b9\f2\82,\d6\bf\80V7($\b4\fa<\00\00\00\00\00\80\f6?\00\00\00\00\00\00\00\00\00\08X\bf\bd\d1\d5\bf \f7\e0\d8\08\a5\1c\bd\00\00\00\00\00`\f6?\00\00\00\00\00\00\00\00\00XE\17wv\d5\bfmP\b6\d5\a4b#\bd\00\00\00\00\00@\f6?\00\00\00\00\00\00\00\00\00\f8-\87\ad\1a\d5\bf\d5g\b0\9e\e4\84\e6\bc\00\00\00\00\00 \f6?\00\00\00\00\00\00\00\00\00xw\95_\be\d4\bf\e0>)\93i\1b\04\bd\00\00\00\00\00\00\f6?\00\00\00\00\00\00\00\00\00`\1c\c2\8ba\d4\bf\cc\84LH/\d8\13=\00\00\00\00\00\e0\f5?\00\00\00\00\00\00\00\00\00\a8\86\860\04\d4\bf:\0b\82\ed\f3B\dc<\00\00\00\00\00\c0\f5?\00\00\00\00\00\00\00\00\00HiUL\a6\d3\bf`\94Q\86\c6\b1 =\00\00\00\00\00\a0\f5?\00\00\00\00\00\00\00\00\00\80\98\9a\ddG\d3\bf\92\80\c5\d4MY%=\00\00\00\00\00\80\f5?\00\00\00\00\00\00\00\00\00 \e1\ba\e2\e8\d2\bf\d8+\b7\99\1e{&=\00\00\00\00\00`\f5?\00\00\00\00\00\00\00\00\00\88\de\13Z\89\d2\bf?\b0\cf\b6\14\ca\15=\00\00\00\00\00`\f5?\00\00\00\00\00\00\00\00\00\88\de\13Z\89\d2\bf?\b0\cf\b6\14\ca\15=\00\00\00\00\00@\f5?\00\00\00\00\00\00\00\00\00x\cf\fbA)\d2\bfv\daS($Z\16\bd\00\00\00\00\00 \f5?\00\00\00\00\00\00\00\00\00\98i\c1\98\c8\d1\bf\04T\e7h\bc\af\1f\bd\00\00\00\00\00\00\f5?\00\00\00\00\00\00\00\00\00\a8\ab\ab\\g\d1\bf\f0\a8\823\c6\1f\1f=\00\00\00\00\00\e0\f4?\00\00\00\00\00\00\00\00\00H\ae\f9\8b\05\d1\bffZ\05\fd\c4\a8&\bd\00\00\00\00\00\c0\f4?\00\00\00\00\00\00\00\00\00\90s\e2$\a3\d0\bf\0e\03\f4~\eek\0c\bd\00\00\00\00\00\a0\f4?\00\00\00\00\00\00\00\00\00\d0\b4\94%@\d0\bf\7f-\f4\9e\b86\f0\bc\00\00\00\00\00\a0\f4?\00\00\00\00\00\00\00\00\00\d0\b4\94%@\d0\bf\7f-\f4\9e\b86\f0\bc\00\00\00\00\00\80\f4?\00\00\00\00\00\00\00\00\00@^m\18\b9\cf\bf\87<\99\ab*W\0d=\00\00\00\00\00`\f4?\00\00\00\00\00\00\00\00\00`\dc\cb\ad\f0\ce\bf$\af\86\9c\b7&+=\00\00\00\00\00@\f4?\00\00\00\00\00\00\00\00\00\f0*n\07\'\ce\bf\10\ff?TO/\17\bd\00\00\00\00\00 \f4?\00\00\00\00\00\00\00\00\00\c0Ok!\\\cd\bf\1bh\ca\bb\91\ba!=\00\00\00\00\00\00\f4?\00\00\00\00\00\00\00\00\00\a0\9a\c7\f7\8f\cc\bf4\84\9fhOy\'=\00\00\00\00\00\00\f4?\00\00\00\00\00\00\00\00\00\a0\9a\c7\f7\8f\cc\bf4\84\9fhOy\'=\00\00\00\00\00\e0\f3?\00\00\00\00\00\00\00\00\00\90-t\86\c2\cb\bf\8f\b7\8b1\b0N\19=\00\00\00\00\00\c0\f3?\00\00\00\00\00\00\00\00\00\c0\80N\c9\f3\ca\bff\90\cd?cN\ba<\00\00\00\00\00\a0\f3?\00\00\00\00\00\00\00\00\00\b0\e2\1f\bc#\ca\bf\ea\c1F\dcd\8c%\bd\00\00\00\00\00\a0\f3?\00\00\00\00\00\00\00\00\00\b0\e2\1f\bc#\ca\bf\ea\c1F\dcd\8c%\bd\00\00\00\00\00\80\f3?\00\00\00\00\00\00\00\00\00P\f4\9cZR\c9\bf\e3\d4\c1\04\d9\d1*\bd\00\00\00\00\00`\f3?\00\00\00\00\00\00\00\00\00\d0 e\a0\7f\c8\bf\t\fa\db\7f\bf\bd+=\00\00\00\00\00@\f3?\00\00\00\00\00\00\00\00\00\e0\10\02\89\ab\c7\bfXJSr\90\db+=\00\00\00\00\00@\f3?\00\00\00\00\00\00\00\00\00\e0\10\02\89\ab\c7\bfXJSr\90\db+=\00\00\00\00\00 \f3?\00\00\00\00\00\00\00\00\00\d0\19\e7\0f\d6\c6\bff\e2\b2\a3j\e4\10\bd\00\00\00\00\00\00\f3?\00\00\00\00\00\00\00\00\00\90\a7p0\ff\c5\bf9P\10\9fC\9e\1e\bd\00\00\00\00\00\00\f3?\00\00\00\00\00\00\00\00\00\90\a7p0\ff\c5\bf9P\10\9fC\9e\1e\bd\00\00\00\00\00\e0\f2?\00\00\00\00\00\00\00\00\00\b0\a1\e3\e5&\c5\bf\8f[\07\90\8b\de \bd\00\00\00\00\00\c0\f2?\00\00\00\00\00\00\00\00\00\80\cbl+M\c4\bf\11\0e\bd\00\00\00\00\00\e0\ed?\00\00\00\00\00\00\00\00\00`F\d1;\97\b1?\9b\9e\0dV]2%\bd\00\00\00\00\00\a0\ed?\00\00\00\00\00\00\00\00\00\e0\d1\a7\f5\bd\b3?\d7N\db\a5^\c8,=\00\00\00\00\00`\ed?\00\00\00\00\00\00\00\00\00\a0\97MZ\e9\b5?\1e\1d]<\06i,\bd\00\00\00\00\00@\ed?\00\00\00\00\00\00\00\00\00\c0\ea\n\d3\00\b7?2\ed\9d\a9\8d\1e\ec<\00\00\00\00\00\00\ed?\00\00\00\00\00\00\00\00\00@Y]^3\b9?\daG\bd:\\\11#=\00\00\00\00\00\c0\ec?\00\00\00\00\00\00\00\00\00`\ad\8d\c8j\bb?\e5h\f7+\80\90\13\bd\00\00\00\00\00\a0\ec?\00\00\00\00\00\00\00\00\00@\bc\01X\88\bc?\d3\acZ\c6\d1F&=\00\00\00\00\00`\ec?\00\00\00\00\00\00\00\00\00 \n\839\c7\be?\e0E\e6\afh\c0-\bd\00\00\00\00\00@\ec?\00\00\00\00\00\00\00\00\00\e0\db9\91\e8\bf?\fd\n\a1O\d64%\bd\00\00\00\00\00\00\ec?\00\00\00\00\00\00\00\00\00\e0\'\82\8e\17\c1?\f2\07-\cex\ef!=\00\00\00\00\00\e0\eb?\00\00\00\00\00\00\00\00\00\f0#~+\aa\c1?4\998D\8e\a7,=\00\00\00\00\00\a0\eb?\00\00\00\00\00\00\00\00\00\80\86\0ca\d1\c2?\a1\b4\81\cbl\9d\03=\00\00\00\00\00\80\eb?\00\00\00\00\00\00\00\00\00\90\15\b0\fce\c3?\89rK#\a8/\c6<\00\00\00\00\00@\eb?\00\00\00\00\00\00\00\00\00\b03\83=\91\c4?x\b6\fdTy\83%=\00\00\00\00\00 \eb?\00\00\00\00\00\00\00\00\00\b0\a1\e4\e5\'\c5?\c7}i\e5\e83&=\00\00\00\00\00\e0\ea?\00\00\00\00\00\00\00\00\00\10\8c\beNW\c6?x.<,\8b\cf\19=\00\00\00\00\00\c0\ea?\00\00\00\00\00\00\00\00\00pu\8b\12\f0\c6?\e1!\9c\e5\8d\11%\bd\00\00\00\00\00\a0\ea?\00\00\00\00\00\00\00\00\00PD\85\8d\89\c7?\05C\91p\10f\1c\bd\00\00\00\00\00`\ea?\00\00\00\00\00\00\00\00\00\009\eb\af\be\c8?\d1,\e9\aaT=\07\bd\00\00\00\00\00@\ea?\00\00\00\00\00\00\00\00\00\00\f7\dcZZ\c9?o\ff\a0X(\f2\07=\00\00\00\00\00\00\ea?\00\00\00\00\00\00\00\00\00\e0\8a<\ed\93\ca?i!VPCr(\bd\00\00\00\00\00\e0\e9?\00\00\00\00\00\00\00\00\00\d0[W\d81\cb?\aa\e1\acN\8d5\0c\bd\00\00\00\00\00\c0\e9?\00\00\00\00\00\00\00\00\00\e0;8\87\d0\cb?\b6\12TY\c4K-\bd\00\00\00\00\00\a0\e9?\00\00\00\00\00\00\00\00\00\10\f0\c6\fbo\cc?\d2+\96\c5r\ec\f1\bc\00\00\00\00\00`\e9?\00\00\00\00\00\00\00\00\00\90\d4\b0=\b1\cd?5\b0\15\f7*\ff*\bd\00\00\00\00\00@\e9?\00\00\00\00\00\00\00\00\00\10\e7\ff\0eS\ce?0\f4A`\'\12\c2<\00\00\00\00\00 \e9?\00\00\00\00\00\00\00\00\00\00\dd\e4\ad\f5\ce?\11\8e\bbe\15!\ca\bc\00\00\00\00\00\00\e9?\00\00\00\00\00\00\00\00\00\b0\b3l\1c\99\cf?0\df\0c\ca\ec\cb\1b=\00\00\00\00\00\c0\e8?\00\00\00\00\00\00\00\00\00XM`8q\d0?\91N\ed\16\db\9c\f8<\00\00\00\00\00\a0\e8?\00\00\00\00\00\00\00\00\00`ag-\c4\d0?\e9\ea<\16\8b\18\'=\00\00\00\00\00\80\e8?\00\00\00\00\00\00\00\00\00\e8\'\82\8e\17\d1?\1c\f0\a5c\0e!,\bd\00\00\00\00\00`\e8?\00\00\00\00\00\00\00\00\00\f8\ac\cb\\k\d1?\81\16\a5\f7\cd\9a+=\00\00\00\00\00@\e8?\00\00\00\00\00\00\00\00\00hZc\99\bf\d1?\b7\bdGQ\ed\a6,=\00\00\00\00\00 \e8?\00\00\00\00\00\00\00\00\00\b8\0emE\14\d2?\ea\baF\ba\de\87\n=\00\00\00\00\00\e0\e7?\00\00\00\00\00\00\00\00\00\90\dc|\f0\be\d2?\f4\04PJ\fa\9c*=\00\00\00\00\00\c0\e7?\00\00\00\00\00\00\00\00\00`\d3\e1\f1\14\d3?\b8_none (func)) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) + (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f32_f32_f32_=>_i32 (func (param f32 f32 f32) (result i32))) - (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (import "mod" "mod" (func $std/mod/mod (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) diff --git a/tests/compiler/std/mod.untouched.wat b/tests/compiler/std/mod.untouched.wat index 08120fd376..382666044f 100644 --- a/tests/compiler/std/mod.untouched.wat +++ b/tests/compiler/std/mod.untouched.wat @@ -1,12 +1,12 @@ (module - (type $none_=>_none (func)) (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) - (type $f32_f32_f32_=>_i32 (func (param f32 f32 f32) (result i32))) + (type $none_=>_none (func)) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) + (type $f32_f32_f32_=>_i32 (func (param f32 f32 f32) (result i32))) (import "mod" "mod" (func $std/mod/mod (param f64 f64) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/mod/js i32 (i32.const 1)) @@ -16,6 +16,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00s\00t\00d\00/\00m\00o\00d\00.\00t\00s\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "mod" (func $std/mod/mod)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/std/new.optimized.wat b/tests/compiler/std/new.optimized.wat index 431198a500..564f94918e 100644 --- a/tests/compiler/std/new.optimized.wat +++ b/tests/compiler/std/new.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1049,20 +1049,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/new.untouched.wat b/tests/compiler/std/new.untouched.wat index 4f5c2ba371..2e146335e4 100644 --- a/tests/compiler/std/new.untouched.wat +++ b/tests/compiler/std/new.untouched.wat @@ -5,10 +5,10 @@ (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_=>_none (func (param i32 i32 i32 i32))) (type $i32_f32_=>_none (func (param i32 f32))) - (type $none_=>_i32 (func (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/new/AClass.aStaticField (mut i32) (i32.const 0)) @@ -40,6 +40,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $std/new/AClass#set:aField (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/object.optimized.wat b/tests/compiler/std/object.optimized.wat index e2aa506ddb..14c652d58d 100644 --- a/tests/compiler/std/object.optimized.wat +++ b/tests/compiler/std/object.optimized.wat @@ -1,7 +1,7 @@ (module - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17596)) (memory $0 1) @@ -29,10 +29,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -60,22 +60,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/object.untouched.wat b/tests/compiler/std/object.untouched.wat index d9b31e2443..f6c40ec4a8 100644 --- a/tests/compiler/std/object.untouched.wat +++ b/tests/compiler/std/object.untouched.wat @@ -1,11 +1,11 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $~lib/memory/__data_end i32 (i32.const 188)) @@ -18,6 +18,7 @@ (data (i32.const 124) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b\00\00\00\00\00\00\00\00\00") (data (i32.const 156) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/object/Object.is (param $0 f64) (param $1 f64) (result i32) diff --git a/tests/compiler/std/operator-overloading.optimized.wat b/tests/compiler/std/operator-overloading.optimized.wat index 0aa520f7b3..099c5f590d 100644 --- a/tests/compiler/std/operator-overloading.optimized.wat +++ b/tests/compiler/std/operator-overloading.optimized.wat @@ -4,8 +4,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1108,20 +1108,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 @@ -2364,11 +2361,9 @@ if (result i32) global.get $std/operator-overloading/f i32.load offset=4 - i32.eqz else - i32.const 0 + i32.const 1 end - i32.eqz if i32.const 0 i32.const 1456 @@ -3156,23 +3151,23 @@ local.get $0 i32.load if (result i32) - i32.const 0 + i32.const 1 else local.get $0 i32.load offset=4 - i32.eqz end + i32.eqz global.set $std/operator-overloading/bres + global.get $std/operator-overloading/bres global.get $std/operator-overloading/excl i32.load if (result i32) - i32.const 0 + i32.const 1 else global.get $std/operator-overloading/excl i32.load offset=4 - i32.eqz end - global.get $std/operator-overloading/bres + i32.eqz i32.ne if i32.const 0 diff --git a/tests/compiler/std/operator-overloading.untouched.wat b/tests/compiler/std/operator-overloading.untouched.wat index 80656982bd..8e9cf23cca 100644 --- a/tests/compiler/std/operator-overloading.untouched.wat +++ b/tests/compiler/std/operator-overloading.untouched.wat @@ -104,6 +104,7 @@ (data (i32.const 412) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00s\00t\00d\00/\00o\00p\00e\00r\00a\00t\00o\00r\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s\00\00\00\00\00\00\00") (data (i32.const 496) "\06\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\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/pointer.optimized.wat b/tests/compiler/std/pointer.optimized.wat index fdd2f6a6cb..f20ac84049 100644 --- a/tests/compiler/std/pointer.optimized.wat +++ b/tests/compiler/std/pointer.optimized.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_=>_none (func (param i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/pointer/one (mut i32) (i32.const 0)) (global $std/pointer/two (mut i32) (i32.const 0)) diff --git a/tests/compiler/std/pointer.untouched.wat b/tests/compiler/std/pointer.untouched.wat index c98e2f2605..aa23eef8ba 100644 --- a/tests/compiler/std/pointer.untouched.wat +++ b/tests/compiler/std/pointer.untouched.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/pointer/one (mut i32) (i32.const 0)) @@ -17,6 +17,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $std/pointer/Entry#set:key (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/polyfills.untouched.wat b/tests/compiler/std/polyfills.untouched.wat index 35ff491b8d..3cdafecc27 100644 --- a/tests/compiler/std/polyfills.untouched.wat +++ b/tests/compiler/std/polyfills.untouched.wat @@ -1,7 +1,7 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) (type $i64_=>_i64 (func (param i64) (result i64))) + (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 76)) @@ -10,6 +10,7 @@ (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00s\00t\00d\00/\00p\00o\00l\00y\00f\00i\00l\00l\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/polyfills/bswap (param $0 i32) (result i32) diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 990c5a8a91..2e71a2df2a 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -7,15 +7,15 @@ (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_f64_=>_none (func (param i32 f64))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) + (type $i32_f32_=>_none (func (param i32 f32))) + (type $i32_f64_=>_none (func (param i32 f64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -1066,20 +1066,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index c502a5c8e7..c87a7d036f 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -11,20 +11,20 @@ (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) - (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $i32_i64_=>_none (func (param i32 i64))) (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) + (type $i32_i64_=>_none (func (param i32 i64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_f64_=>_none (func (param i32 f64))) + (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) + (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $none_=>_i32 (func (result i32))) (type $f32_=>_i32 (func (param f32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) + (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) + (type $i32_f64_=>_none (func (param i32 f64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -58,6 +58,7 @@ (data (i32.const 572) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") (data (i32.const 624) "\17\00\00\00 \00\00\00\00\00\00\00 \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00H\08\00\00\00\00\00\00B\08\00\00\00\00\00\00H\00\00\00\00\00\00\00B\00\00\00\00\00\00\00\88\08\00\00\00\00\00\00\82\08\00\00\00\00\00\00\88\00\00\00\00\00\00\00\82\00\00\00\00\00\00\00\08\t\00\00\00\00\00\00\02\t\00\00\00\00\00\00\08\01\00\00\00\00\00\00\02\01\00\00\00\00\00\00\08\n\00\00\00\00\00\00\02\n\00\00\00\00\00\00\08\02\00\00\00\00\00\00\02\02\00\00\00\00\00\00\08\19\00\00\00\00\00\00\02\19\00\00\00\00\00\00\08\1a\00\00\00\00\00\00\02\1a\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/std/simd.untouched.wat b/tests/compiler/std/simd.untouched.wat index 82bf172278..196aa636d5 100644 --- a/tests/compiler/std/simd.untouched.wat +++ b/tests/compiler/std/simd.untouched.wat @@ -6,6 +6,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:std/simd diff --git a/tests/compiler/std/static-array.optimized.wat b/tests/compiler/std/static-array.optimized.wat index 320092808c..85e597f65d 100644 --- a/tests/compiler/std/static-array.optimized.wat +++ b/tests/compiler/std/static-array.optimized.wat @@ -5,8 +5,8 @@ (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_=>_i32 (func (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_=>_i64 (func (param i32) (result i64))) (type $i32_=>_f32 (func (param i32) (result f32))) (type $i32_=>_f64 (func (param i32) (result f64))) @@ -1104,20 +1104,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1904 diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index 3c6c1436d7..2b38f50179 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -3,14 +3,14 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) @@ -57,6 +57,7 @@ (data (i32.const 860) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 928) "\07\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\02\t\00\00\00\00\00\00\02\n\00\00\00\00\00\00\02\19\00\00\00\00\00\00\02\1a\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/array/Array#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/staticarray.optimized.wat b/tests/compiler/std/staticarray.optimized.wat index 452b9ce3ad..e28570b093 100644 --- a/tests/compiler/std/staticarray.optimized.wat +++ b/tests/compiler/std/staticarray.optimized.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -1194,20 +1194,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1616 @@ -2854,14 +2851,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 @@ -2890,10 +2884,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -2921,22 +2915,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 @@ -4541,10 +4533,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop loop $while-continue|0 @@ -4609,10 +4601,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $__inlined_func$~lib/staticarray/StaticArray#includes drop loop $while-continue|07 @@ -4676,10 +4668,10 @@ i32.const 2 i32.shr_u local.tee $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $1 select + i32.eqz if i32.const -1 local.set $0 @@ -4728,10 +4720,10 @@ i32.const 2 i32.shr_u local.tee $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $1 select + i32.eqz if i32.const -1 local.set $0 diff --git a/tests/compiler/std/staticarray.untouched.wat b/tests/compiler/std/staticarray.untouched.wat index d2ba5ed296..e5b5f5171d 100644 --- a/tests/compiler/std/staticarray.untouched.wat +++ b/tests/compiler/std/staticarray.untouched.wat @@ -8,10 +8,10 @@ (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) + (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/staticarray/arr1 i32 (i32.const 32)) (global $std/staticarray/arr2 i32 (i32.const 256)) @@ -86,6 +86,7 @@ (data (i32.const 2012) ",\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10\00\00\00\02\00\00\00\05\00\00\00\t\00\00\00\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 2064) "\0c\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$\t\00\00\00\00\00\00 \00\00\00\00\00\00\00\04A\00\00\00\00\00\00\02\t\00\00\00\00\00\00\02\01\00\00\00\00\00\00\04A\00\00\00\00\00\00\02A\00\00\00\00\00\00$\1a\00\00\00\00\00\00$\19\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/staticarray/StaticArray#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/string-casemapping.optimized.wat b/tests/compiler/std/string-casemapping.optimized.wat index cce46cb702..3511d4eab8 100644 --- a/tests/compiler/std/string-casemapping.optimized.wat +++ b/tests/compiler/std/string-casemapping.optimized.wat @@ -6,8 +6,8 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $none_=>_i32 (func (result i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $i64_=>_i32 (func (param i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "string_casemapping" "toLowerCaseFromIndex" (func $std/string-casemapping/toLowerCaseFromIndex (param i32 i32) (result i32))) @@ -1497,20 +1497,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1424 @@ -3316,10 +3313,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -3347,22 +3344,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/string-casemapping.untouched.wat b/tests/compiler/std/string-casemapping.untouched.wat index cfb7e7640d..8bcea8fb01 100644 --- a/tests/compiler/std/string-casemapping.untouched.wat +++ b/tests/compiler/std/string-casemapping.untouched.wat @@ -8,12 +8,12 @@ (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i64_=>_i32 (func (param i64) (result i32))) + (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "string_casemapping" "toLowerCaseFromIndex" (func $std/string-casemapping/toLowerCaseFromIndex (param i32 i32) (result i32))) (import "string_casemapping" "toUpperCaseFromIndex" (func $std/string-casemapping/toUpperCaseFromIndex (param i32 i32) (result i32))) @@ -217,6 +217,7 @@ (data (i32.const 19964) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00 \00e\00x\00p\00e\00c\00t\00U\00p\00p\00e\00r\00C\00o\00d\00e\00 \00=\00 \00\00\00\00\00\00\00") (data (i32.const 20032) "\04\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\a4\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/std/string-encoding.optimized.wat b/tests/compiler/std/string-encoding.optimized.wat index 329dbafbc5..80f0a35785 100644 --- a/tests/compiler/std/string-encoding.optimized.wat +++ b/tests/compiler/std/string-encoding.optimized.wat @@ -1071,20 +1071,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1488 @@ -2701,10 +2698,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -2732,22 +2729,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/string-encoding.untouched.wat b/tests/compiler/std/string-encoding.untouched.wat index 65f2c9be39..c1cd7447e3 100644 --- a/tests/compiler/std/string-encoding.untouched.wat +++ b/tests/compiler/std/string-encoding.untouched.wat @@ -8,8 +8,8 @@ (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 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string-encoding/str (mut i32) (i32.const 32)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -52,6 +52,7 @@ (data (i32.const 13948) "\cc\1c\00\00\00\00\00\00\00\00\00\00\01\00\00\00\ba\1c\00\00S\00e\00n\00t\00e\00n\00c\00e\00s\00 \00t\00h\00a\00t\00 \00c\00o\00n\00t\00a\00i\00n\00 \00a\00l\00l\00 \00l\00e\00t\00t\00e\00r\00s\00 \00c\00o\00m\00m\00o\00n\00l\00y\00 \00u\00s\00e\00d\00 \00i\00n\00 \00a\00 \00l\00a\00n\00g\00u\00a\00g\00e\00\n\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-\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\n\00\n\00M\00a\00r\00k\00u\00s\00 \00K\00u\00h\00n\00 \00<\00h\00t\00t\00p\00:\00/\00/\00w\00w\00w\00.\00c\00l\00.\00c\00a\00m\00.\00a\00c\00.\00u\00k\00/\00~\00m\00g\00k\002\005\00/\00>\00 \00-\00-\00 \002\000\001\002\00-\000\004\00-\001\001\00\n\00\n\00T\00h\00i\00s\00 \00i\00s\00 \00a\00n\00 \00e\00x\00a\00m\00p\00l\00e\00 \00o\00f\00 \00a\00 \00p\00l\00a\00i\00n\00-\00t\00e\00x\00t\00 \00f\00i\00l\00e\00 \00e\00n\00c\00o\00d\00e\00d\00 \00i\00n\00 \00U\00T\00F\00-\008\00.\00\n\00\n\00\n\00D\00a\00n\00i\00s\00h\00 \00(\00d\00a\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00Q\00u\00i\00z\00d\00e\00l\00t\00a\00g\00e\00r\00n\00e\00 \00s\00p\00i\00s\00t\00e\00 \00j\00o\00r\00d\00b\00\e6\00r\00 \00m\00e\00d\00 \00f\00l\00\f8\00d\00e\00,\00 \00m\00e\00n\00s\00 \00c\00i\00r\00k\00u\00s\00k\00l\00o\00v\00n\00e\00n\00\n\00 \00 \00W\00o\00l\00t\00h\00e\00r\00 \00s\00p\00i\00l\00l\00e\00d\00e\00 \00p\00\e5\00 \00x\00y\00l\00o\00f\00o\00n\00.\00\n\00 \00 \00(\00=\00 \00Q\00u\00i\00z\00 \00c\00o\00n\00t\00e\00s\00t\00a\00n\00t\00s\00 \00w\00e\00r\00e\00 \00e\00a\00t\00i\00n\00g\00 \00s\00t\00r\00a\00w\00b\00e\00r\00y\00 \00w\00i\00t\00h\00 \00c\00r\00e\00a\00m\00 \00w\00h\00i\00l\00e\00 \00W\00o\00l\00t\00h\00e\00r\00\n\00 \00 \00t\00h\00e\00 \00c\00i\00r\00c\00u\00s\00 \00c\00l\00o\00w\00n\00 \00p\00l\00a\00y\00e\00d\00 \00o\00n\00 \00x\00y\00l\00o\00p\00h\00o\00n\00e\00.\00)\00\n\00\n\00G\00e\00r\00m\00a\00n\00 \00(\00d\00e\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00F\00a\00l\00s\00c\00h\00e\00s\00 \00\dc\00b\00e\00n\00 \00v\00o\00n\00 \00X\00y\00l\00o\00p\00h\00o\00n\00m\00u\00s\00i\00k\00 \00q\00u\00\e4\00l\00t\00 \00j\00e\00d\00e\00n\00 \00g\00r\00\f6\00\df\00e\00r\00e\00n\00 \00Z\00w\00e\00r\00g\00\n\00 \00 \00(\00=\00 \00W\00r\00o\00n\00g\00f\00u\00l\00 \00p\00r\00a\00c\00t\00i\00c\00i\00n\00g\00 \00o\00f\00 \00x\00y\00l\00o\00p\00h\00o\00n\00e\00 \00m\00u\00s\00i\00c\00 \00t\00o\00r\00t\00u\00r\00e\00s\00 \00e\00v\00e\00r\00y\00 \00l\00a\00r\00g\00e\00r\00 \00d\00w\00a\00r\00f\00)\00\n\00\n\00 \00 \00Z\00w\00\f6\00l\00f\00 \00B\00o\00x\00k\00\e4\00m\00p\00f\00e\00r\00 \00j\00a\00g\00t\00e\00n\00 \00E\00v\00a\00 \00q\00u\00e\00r\00 \00\fc\00b\00e\00r\00 \00d\00e\00n\00 \00S\00y\00l\00t\00e\00r\00 \00D\00e\00i\00c\00h\00\n\00 \00 \00(\00=\00 \00T\00w\00e\00l\00v\00e\00 \00b\00o\00x\00i\00n\00g\00 \00f\00i\00g\00h\00t\00e\00r\00s\00 \00h\00u\00n\00t\00e\00d\00 \00E\00v\00a\00 \00a\00c\00r\00o\00s\00s\00 \00t\00h\00e\00 \00d\00i\00k\00e\00 \00o\00f\00 \00S\00y\00l\00t\00)\00\n\00\n\00 \00 \00H\00e\00i\00z\00\f6\00l\00r\00\fc\00c\00k\00s\00t\00o\00\df\00a\00b\00d\00\e4\00m\00p\00f\00u\00n\00g\00\n\00 \00 \00(\00=\00 \00f\00u\00e\00l\00 \00o\00i\00l\00 \00r\00e\00c\00o\00i\00l\00 \00a\00b\00s\00o\00r\00b\00e\00r\00)\00\n\00 \00 \00(\00j\00q\00v\00w\00x\00y\00 \00m\00i\00s\00s\00i\00n\00g\00,\00 \00b\00u\00t\00 \00a\00l\00l\00 \00n\00o\00n\00-\00A\00S\00C\00I\00I\00 \00l\00e\00t\00t\00e\00r\00s\00 \00i\00n\00 \00o\00n\00e\00 \00w\00o\00r\00d\00)\00\n\00\n\00G\00r\00e\00e\00k\00 \00(\00e\00l\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00\93\03\b1\03\b6\03\ad\03\b5\03\c2\03 \00\ba\03\b1\03v\1f \00\bc\03\c5\03\c1\03\c4\03\b9\03r\1f\c2\03 \00\b4\03r\1f\bd\03 \00\b8\03p\1f \00\b2\03\c1\03\f6\1f \00\c0\03\b9\03p\1f \00\c3\03\c4\03x\1f \00\c7\03\c1\03\c5\03\c3\03\b1\03\c6\03v\1f \00\be\03\ad\03\c6\03\c9\03\c4\03\bf\03\n\00 \00 \00(\00=\00 \00N\00o\00 \00m\00o\00r\00e\00 \00s\00h\00a\00l\00l\00 \00I\00 \00s\00e\00e\00 \00a\00c\00a\00c\00i\00a\00s\00 \00o\00r\00 \00m\00y\00r\00t\00l\00e\00s\00 \00i\00n\00 \00t\00h\00e\00 \00g\00o\00l\00d\00e\00n\00 \00c\00l\00e\00a\00r\00i\00n\00g\00)\00\n\00\n\00 \00 \00\9e\03\b5\03\c3\03\ba\03\b5\03\c0\03\ac\03\b6\03\c9\03 \00\c4\03t\1f\bd\03 \00\c8\03\c5\03\c7\03\bf\03\c6\03\b8\03\cc\03\c1\03\b1\03 \00\b2\03\b4\03\b5\03\bb\03\c5\03\b3\03\bc\03\af\03\b1\03\n\00 \00 \00(\00=\00 \00I\00 \00u\00n\00c\00o\00v\00e\00r\00 \00t\00h\00e\00 \00s\00o\00u\00l\00-\00d\00e\00s\00t\00r\00o\00y\00i\00n\00g\00 \00a\00b\00h\00o\00r\00r\00e\00n\00c\00e\00)\00\n\00\n\00E\00n\00g\00l\00i\00s\00h\00 \00(\00e\00n\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00T\00h\00e\00 \00q\00u\00i\00c\00k\00 \00b\00r\00o\00w\00n\00 \00f\00o\00x\00 \00j\00u\00m\00p\00s\00 \00o\00v\00e\00r\00 \00t\00h\00e\00 \00l\00a\00z\00y\00 \00d\00o\00g\00\n\00\n\00S\00p\00a\00n\00i\00s\00h\00 \00(\00e\00s\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00E\00l\00 \00p\00i\00n\00g\00\fc\00i\00n\00o\00 \00W\00e\00n\00c\00e\00s\00l\00a\00o\00 \00h\00i\00z\00o\00 \00k\00i\00l\00\f3\00m\00e\00t\00r\00o\00s\00 \00b\00a\00j\00o\00 \00e\00x\00h\00a\00u\00s\00t\00i\00v\00a\00 \00l\00l\00u\00v\00i\00a\00 \00y\00\n\00 \00 \00f\00r\00\ed\00o\00,\00 \00a\00\f1\00o\00r\00a\00b\00a\00 \00a\00 \00s\00u\00 \00q\00u\00e\00r\00i\00d\00o\00 \00c\00a\00c\00h\00o\00r\00r\00o\00.\00\n\00 \00 \00(\00C\00o\00n\00t\00a\00i\00n\00s\00 \00e\00v\00e\00r\00y\00 \00l\00e\00t\00t\00e\00r\00 \00a\00n\00d\00 \00e\00v\00e\00r\00y\00 \00a\00c\00c\00e\00n\00t\00,\00 \00b\00u\00t\00 \00n\00o\00t\00 \00e\00v\00e\00r\00y\00 \00c\00o\00m\00b\00i\00n\00a\00t\00i\00o\00n\00\n\00 \00 \00o\00f\00 \00v\00o\00w\00e\00l\00 \00+\00 \00a\00c\00u\00t\00e\00.\00)\00\n\00\n\00F\00r\00e\00n\00c\00h\00 \00(\00f\00r\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00P\00o\00r\00t\00e\00z\00 \00c\00e\00 \00v\00i\00e\00u\00x\00 \00w\00h\00i\00s\00k\00y\00 \00a\00u\00 \00j\00u\00g\00e\00 \00b\00l\00o\00n\00d\00 \00q\00u\00i\00 \00f\00u\00m\00e\00 \00s\00u\00r\00 \00s\00o\00n\00 \00\ee\00l\00e\00 \00i\00n\00t\00\e9\00r\00i\00e\00u\00r\00e\00,\00 \00\e0\00\n\00 \00 \00c\00\f4\00t\00\e9\00 \00d\00e\00 \00l\00\'\00a\00l\00c\00\f4\00v\00e\00 \00o\00v\00o\00\ef\00d\00e\00,\00 \00o\00\f9\00 \00l\00e\00s\00 \00b\00\fb\00c\00h\00e\00s\00 \00s\00e\00 \00c\00o\00n\00s\00u\00m\00e\00n\00t\00 \00d\00a\00n\00s\00 \00l\00\'\00\e2\00t\00r\00e\00,\00 \00c\00e\00\n\00 \00 \00q\00u\00i\00 \00l\00u\00i\00 \00p\00e\00r\00m\00e\00t\00 \00d\00e\00 \00p\00e\00n\00s\00e\00r\00 \00\e0\00 \00l\00a\00 \00c\00\e6\00n\00o\00g\00e\00n\00\e8\00s\00e\00 \00d\00e\00 \00l\00\'\00\ea\00t\00r\00e\00 \00d\00o\00n\00t\00 \00i\00l\00 \00e\00s\00t\00 \00q\00u\00e\00s\00t\00i\00o\00n\00\n\00 \00 \00d\00a\00n\00s\00 \00l\00a\00 \00c\00a\00u\00s\00e\00 \00a\00m\00b\00i\00g\00u\00\eb\00 \00e\00n\00t\00e\00n\00d\00u\00e\00 \00\e0\00 \00M\00o\00\ff\00,\00 \00d\00a\00n\00s\00 \00u\00n\00 \00c\00a\00p\00h\00a\00r\00n\00a\00\fc\00m\00 \00q\00u\00i\00,\00\n\00 \00 \00p\00e\00n\00s\00e\00-\00t\00-\00i\00l\00,\00 \00d\00i\00m\00i\00n\00u\00e\00 \00\e7\00\e0\00 \00e\00t\00 \00l\00\e0\00 \00l\00a\00 \00q\00u\00a\00l\00i\00t\00\e9\00 \00d\00e\00 \00s\00o\00n\00 \00S\01u\00v\00r\00e\00.\00\n\00\n\00 \00 \00l\00\'\00\ee\00l\00e\00 \00e\00x\00i\00g\00u\00\eb\00\n\00 \00 \00O\00\f9\00 \00l\00\'\00o\00b\00\e8\00s\00e\00 \00j\00u\00r\00y\00 \00m\00\fb\00r\00\n\00 \00 \00F\00\ea\00t\00e\00 \00l\00\'\00h\00a\00\ef\00 \00v\00o\00l\00a\00p\00\fc\00k\00,\00\n\00 \00 \00\c2\00n\00e\00 \00e\00x\00 \00a\00\e9\00q\00u\00o\00 \00a\00u\00 \00w\00h\00i\00s\00t\00,\00\n\00 \00 \00\d4\00t\00e\00z\00 \00c\00e\00 \00v\00S\01u\00 \00d\00\e9\00\e7\00u\00.\00\n\00\n\00 \00 \00L\00e\00 \00c\00S\01u\00r\00 \00d\00\e9\00\e7\00u\00 \00m\00a\00i\00s\00 \00l\00\'\00\e2\00m\00e\00 \00p\00l\00u\00t\00\f4\00t\00 \00n\00a\00\ef\00v\00e\00,\00 \00L\00o\00u\00\ff\00s\00 \00r\00\ea\00v\00a\00 \00d\00e\00 \00c\00r\00a\00p\00a\00\fc\00t\00e\00r\00 \00e\00n\00\n\00 \00 \00c\00a\00n\00o\00\eb\00 \00a\00u\00 \00d\00e\00l\00\e0\00 \00d\00e\00s\00 \00\ee\00l\00e\00s\00,\00 \00p\00r\00\e8\00s\00 \00d\00u\00 \00m\00\e4\00l\00s\00t\00r\00\f6\00m\00 \00o\00\f9\00 \00b\00r\00\fb\00l\00e\00n\00t\00 \00l\00e\00s\00 \00n\00o\00v\00\e6\00.\00\n\00\n\00I\00r\00i\00s\00h\00 \00G\00a\00e\00l\00i\00c\00 \00(\00g\00a\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00D\00\'\00f\00h\00u\00a\00s\00c\00a\00i\00l\00 \00\cd\00o\00s\00a\00,\00 \00\da\00r\00m\00h\00a\00c\00 \00n\00a\00 \00h\00\d3\00i\00g\00h\00e\00 \00B\00e\00a\00n\00n\00a\00i\00t\00h\00e\00,\00 \00p\00\f3\00r\00 \00\c9\00a\00v\00a\00 \00a\00g\00u\00s\00 \00\c1\00d\00h\00a\00i\00m\00h\00\n\00\n\00H\00u\00n\00g\00a\00r\00i\00a\00n\00 \00(\00h\00u\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00\c1\00r\00v\00\ed\00z\00t\00q\01r\00Q\01 \00t\00\fc\00k\00\f6\00r\00f\00\fa\00r\00\f3\00g\00\e9\00p\00\n\00 \00 \00(\00=\00 \00f\00l\00o\00o\00d\00-\00p\00r\00o\00o\00f\00 \00m\00i\00r\00r\00o\00r\00-\00d\00r\00i\00l\00l\00i\00n\00g\00 \00m\00a\00c\00h\00i\00n\00e\00,\00 \00o\00n\00l\00y\00 \00a\00l\00l\00 \00n\00o\00n\00-\00A\00S\00C\00I\00I\00 \00l\00e\00t\00t\00e\00r\00s\00)\00\n\00\n\00I\00c\00e\00l\00a\00n\00d\00i\00c\00 \00(\00i\00s\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00K\00\e6\00m\00i\00 \00n\00\fd\00 \00\f6\00x\00i\00 \00h\00\e9\00r\00 \00y\00k\00i\00s\00t\00 \00\fe\00j\00\f3\00f\00u\00m\00 \00n\00\fa\00 \00b\00\e6\00\f0\00i\00 \00v\00\ed\00l\00 \00o\00g\00 \00\e1\00d\00r\00e\00p\00a\00\n\00\n\00 \00 \00S\00\e6\00v\00\f6\00r\00 \00g\00r\00\e9\00t\00 \00\e1\00\f0\00a\00n\00 \00\fe\00v\00\ed\00 \00\fa\00l\00p\00a\00n\00 \00v\00a\00r\00 \00\f3\00n\00\fd\00t\00\n\00 \00 \00(\00s\00o\00m\00e\00 \00A\00S\00C\00I\00I\00 \00l\00e\00t\00t\00e\00r\00s\00 \00m\00i\00s\00s\00i\00n\00g\00)\00\n\00\n\00J\00a\00p\00a\00n\00e\00s\00e\00 \00(\00j\00p\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00H\00i\00r\00a\00g\00a\00n\00a\00:\00 \00(\00I\00r\00o\00h\00a\00)\00\n\00\n\00 \00 \00D0\8d0o0k0{0x0h0a0\8a0l0\8b0\920\n\00 \00 \00\8f0K0\880_0\8c0]0d0m0j0\890\800\n\00 \00 \00F0\900n0J0O0\840~0Q0u0S0H0f0\n\00 \00 \00B0U0M0\860\810\7f0W0\910r0\820[0Y0\n\00\n\00 \00 \00K\00a\00t\00a\00k\00a\00n\00a\00:\00\n\00\n\00 \00 \00\a40\ed0\cf0\cb0\db0\d80\c80 \00\c10\ea0\cc0\eb0\f20 \00\ef0\ab0\e80\bf0\ec0\bd0 \00\c40\cd0\ca0\e90\e00\n\00 \00 \00\a60\f00\ce0\aa0\af0\e40\de0 \00\b10\d50\b30\a80\c60 \00\a20\b50\ad0\e60\e10\df0\b70 \00\f10\d20\e20\bb0\b90\f30\n\00\n\00H\00e\00b\00r\00e\00w\00 \00(\00i\00w\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00?\00 \00\d3\05\d2\05 \00\e1\05\e7\05\e8\05\df\05 \00\e9\05\d8\05 \00\d1\05\d9\05\dd\05 \00\de\05\d0\05\d5\05\db\05\d6\05\d1\05 \00\d5\05\dc\05\e4\05\ea\05\e2\05 \00\de\05\e6\05\d0\05 \00\dc\05\d5\05 \00\d7\05\d1\05\e8\05\d4\05 \00\d0\05\d9\05\da\05 \00\d4\05\e7\05\dc\05\d9\05\d8\05\d4\05\n\00\n\00P\00o\00l\00i\00s\00h\00 \00(\00p\00l\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00P\00c\00h\00n\00\05\01\07\01 \00w\00 \00t\00\19\01 \00B\01\f3\00d\00z\01 \00j\00e\00|\01a\00 \00l\00u\00b\00 \00o\00[\01m\00 \00s\00k\00r\00z\00y\00D\01 \00f\00i\00g\00\n\00 \00 \00(\00=\00 \00T\00o\00 \00p\00u\00s\00h\00 \00a\00 \00h\00e\00d\00g\00e\00h\00o\00g\00 \00o\00r\00 \00e\00i\00g\00h\00t\00 \00b\00i\00n\00s\00 \00o\00f\00 \00f\00i\00g\00s\00 \00i\00n\00 \00t\00h\00i\00s\00 \00b\00o\00a\00t\00)\00\n\00\n\00R\00u\00s\00s\00i\00a\00n\00 \00(\00r\00u\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00\12\04 \00G\040\04I\040\04E\04 \00N\043\040\04 \006\048\04;\04 \001\04K\04 \00F\048\04B\04@\04C\04A\04?\00 \00\14\040\04,\00 \00=\04>\04 \00D\040\04;\04L\04H\048\042\04K\049\04 \00M\04:\047\045\04<\04?\04;\04O\04@\04!\00\n\00 \00 \00(\00=\00 \00W\00o\00u\00l\00d\00 \00a\00 \00c\00i\00t\00r\00u\00s\00 \00l\00i\00v\00e\00 \00i\00n\00 \00t\00h\00e\00 \00b\00u\00s\00h\00e\00s\00 \00o\00f\00 \00s\00o\00u\00t\00h\00?\00 \00Y\00e\00s\00,\00 \00b\00u\00t\00 \00o\00n\00l\00y\00 \00a\00 \00f\00a\00k\00e\00 \00o\00n\00e\00!\00)\00\n\00\n\00 \00 \00!\04J\045\04H\04L\04 \006\045\04 \005\04I\04Q\04 \00M\04B\048\04E\04 \00<\04O\043\04:\048\04E\04 \00D\04@\040\04=\04F\04C\047\04A\04:\048\04E\04 \001\04C\04;\04>\04:\04 \004\040\04 \002\04K\04?\045\049\04 \00G\040\04N\04\n\00 \00 \00(\00=\00 \00E\00a\00t\00 \00s\00o\00m\00e\00 \00m\00o\00r\00e\00 \00o\00f\00 \00t\00h\00e\00s\00e\00 \00f\00r\00e\00s\00h\00 \00F\00r\00e\00n\00c\00h\00 \00l\00o\00a\00f\00s\00 \00a\00n\00d\00 \00h\00a\00v\00e\00 \00s\00o\00m\00e\00 \00t\00e\00a\00)\00\n\00\n\00T\00h\00a\00i\00 \00(\00t\00h\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\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-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00]\00\n\00 \00 \00O\0e \00@\0e\1b\0eG\0e\19\0e!\0e\19\0e8\0e)\0e\"\0eL\0e*\0e8\0e\14\0e\1b\0e#\0e0\0e@\0e*\0e#\0e4\0e\10\0e@\0e%\0e4\0e(\0e\04\0e8\0e\13\0e\04\0eH\0e2\0e \00 \00\01\0e\'\0eH\0e2\0e\1a\0e#\0e#\0e\14\0e2\0e\1d\0e9\0e\07\0e*\0e1\0e\15\0e\'\0eL\0e@\0e\14\0e#\0e1\0e\08\0e\t\0e2\0e\19\0e\n\00 \00 \00\08\0e\07\0e\1d\0eH\0e2\0e\1f\0e1\0e\19\0e\1e\0e1\0e\12\0e\19\0e2\0e\'\0e4\0e\n\0e2\0e\01\0e2\0e#\0e \00 \00 \00 \00 \00 \00 \00 \00 \00 \00 \00-\0e\"\0eH\0e2\0e%\0eI\0e2\0e\07\0e\1c\0e%\0e2\0e\0d\0e$\0eE\0e@\0e\02\0eH\0e\19\0e\06\0eH\0e2\0e\1a\0e5\0e\11\0e2\0eC\0e\04\0e#\0e\n\00 \00 \00D\0e!\0eH\0e\16\0e7\0e-\0eB\0e\17\0e)\0eB\0e\01\0e#\0e\18\0eA\0e\n\0eH\0e\07\0e\0b\0e1\0e\14\0e.\0e6\0e\14\0e.\0e1\0e\14\0e\14\0eH\0e2\0e \00 \00 \00 \00 \00+\0e1\0e\14\0e-\0e \0e1\0e\"\0e@\0e+\0e!\0e7\0e-\0e\19\0e\01\0e5\0e,\0e2\0e-\0e1\0e\n\0e\0c\0e2\0e*\0e1\0e\"\0e\n\00 \00 \00\1b\0e\0f\0e4\0e\1a\0e1\0e\15\0e4\0e\1b\0e#\0e0\0e\1e\0e$\0e\15\0e4\0e\01\0e\0e\0e\01\0e3\0e+\0e\19\0e\14\0eC\0e\08\0e \00 \00 \00 \00 \00 \00 \00 \00\1e\0e9\0e\14\0e\08\0e2\0eC\0e+\0eI\0e\08\0eJ\0e0\0eF\0e \00\08\0eK\0e2\0eF\0e \00\19\0eH\0e2\0e\1f\0e1\0e\07\0e@\0e-\0e\"\0e \00/\0e\n\00\n\00 \00 \00[\00T\00h\00e\00 \00c\00o\00p\00y\00r\00i\00g\00h\00t\00 \00f\00o\00r\00 \00t\00h\00e\00 \00T\00h\00a\00i\00 \00e\00x\00a\00m\00p\00l\00e\00 \00i\00s\00 \00o\00w\00n\00e\00d\00 \00b\00y\00 \00T\00h\00e\00 \00C\00o\00m\00p\00u\00t\00e\00r\00\n\00 \00 \00A\00s\00s\00o\00c\00i\00a\00t\00i\00o\00n\00 \00o\00f\00 \00T\00h\00a\00i\00l\00a\00n\00d\00 \00u\00n\00d\00e\00r\00 \00t\00h\00e\00 \00R\00o\00y\00a\00l\00 \00P\00a\00t\00r\00o\00n\00a\00g\00e\00 \00o\00f\00 \00H\00i\00s\00 \00M\00a\00j\00e\00s\00t\00y\00 \00t\00h\00e\00\n\00 \00 \00K\00i\00n\00g\00.\00]\00\n\00\n\00T\00u\00r\00k\00i\00s\00h\00 \00(\00t\00r\00)\00\n\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00-\00\n\00\n\00 \00 \00P\00i\00j\00a\00m\00a\00l\001\01 \00h\00a\00s\00t\00a\00,\00 \00y\00a\00\1f\011\01z\00 \00_\01o\00f\00\f6\00r\00e\00 \00\e7\00a\00b\00u\00c\00a\00k\00 \00g\00\fc\00v\00e\00n\00d\00i\00.\00\n\00 \00 \00(\00=\00P\00a\00t\00i\00e\00n\00t\00 \00w\00i\00t\00h\00 \00p\00a\00j\00a\00m\00a\00s\00,\00 \00t\00r\00u\00s\00t\00e\00d\00 \00s\00w\00a\00r\00t\00h\00y\00 \00d\00r\00i\00v\00e\00r\00 \00q\00u\00i\00c\00k\00l\00y\00)\00\n\00\00\00") (data (i32.const 21328) "\03\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String.UTF16.byteLength (param $0 i32) (result i32) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 5c3b920443..0d8ab54662 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -10,14 +10,14 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f64_=>_i32 (func (param f64) (result i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) - (type $none_=>_i64 (func (result i64))) - (type $i32_=>_f64 (func (param i32) (result f64))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) + (type $none_=>_i64 (func (result i64))) (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) + (type $i32_=>_f64 (func (param i32) (result f64))) + (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string/str (mut i32) (i32.const 1056)) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -949,22 +949,19 @@ i32.const 1 i32.shl i32.add - local.set $1 + local.tee $1 + i32.const 7 + i32.and + local.get $2 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $3 i32.const 4 i32.ge_u - if (result i32) - local.get $1 - i32.const 7 - i32.and - local.get $2 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $1 @@ -1035,10 +1032,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -2095,20 +2092,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1648 @@ -3814,14 +3808,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 @@ -5456,10 +5447,9 @@ i32.sub local.set $2 loop $for-loop|3 - i32.const 1 - local.get $13 - i32.eqz i32.const 0 + local.get $13 + i32.const 1 local.get $5 i32.const 46 i32.eq @@ -5468,6 +5458,7 @@ i32.const 10 i32.lt_u select + i32.eqz if block $for-break3 local.get $2 @@ -7931,8 +7922,8 @@ (local $1 i32) (local $2 f64) (local $3 i32) - (local $4 i32) - (local $5 f32) + (local $4 f32) + (local $5 i32) global.get $~lib/memory/__stack_pointer i32.const 44 i32.sub @@ -8059,19 +8050,17 @@ global.get $std/string/str local.tee $0 i32.store - block $__inlined_func$~lib/string/String#charCodeAt (result i32) - i32.const -1 - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.eqz - br_if $__inlined_func$~lib/string/String#charCodeAt - drop + local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + if (result i32) local.get $0 i32.load16_u + else + i32.const -1 end i32.const 104 i32.ne @@ -8671,39 +8660,36 @@ local.get $1 i32.const 2208 i32.store offset=4 - block $__inlined_func$~lib/string/String#endsWith (result i32) - i32.const 0 - i32.const 536870910 - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - local.tee $3 - local.get $3 - i32.const 536870910 - i32.gt_s - select - i32.const 2204 - i32.load + i32.const 536870910 + local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + local.tee $1 + local.get $1 + i32.const 536870910 + i32.gt_s + select + i32.const 2204 + i32.load + i32.const 1 + i32.shr_u + local.tee $1 + i32.sub + local.tee $3 + i32.const 0 + i32.lt_s + if (result i32) i32.const 1 - i32.shr_u - local.tee $3 - i32.sub - local.tee $4 - i32.const 0 - i32.lt_s - br_if $__inlined_func$~lib/string/String#endsWith - drop + else local.get $0 - local.get $4 - i32.const 2208 local.get $3 + i32.const 2208 + local.get $1 call $~lib/util/string/compareImpl - i32.eqz end - i32.eqz if i32.const 0 i32.const 1120 @@ -10695,8 +10681,8 @@ i32.const 0 call $~lib/util/string/strtol f32.demote_f64 - local.tee $5 - local.get $5 + local.tee $4 + local.get $4 f32.eq if i32.const 0 @@ -22168,7 +22154,7 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - i32.const 1 + i32.const 0 local.get $2 i32.const 20 i32.sub @@ -22178,7 +22164,6 @@ i32.const 1 i32.shl local.tee $4 - i32.eqz local.get $0 i32.const 20 i32.sub @@ -22194,6 +22179,7 @@ local.tee $3 i32.gt_u select + i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 @@ -22276,7 +22262,7 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - i32.const 1 + i32.const 0 local.get $2 i32.const 20 i32.sub @@ -22286,7 +22272,6 @@ i32.const 1 i32.shl local.tee $3 - i32.eqz local.get $0 i32.const 20 i32.sub @@ -22302,6 +22287,7 @@ local.tee $5 i32.gt_u select + i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 @@ -23043,10 +23029,10 @@ unreachable end local.get $2 - i32.eqz - i32.const 1 + i32.const 0 local.get $1 select + i32.eqz if global.get $~lib/memory/__stack_pointer i32.const 4 @@ -23438,10 +23424,10 @@ i32.load offset=16 i32.const 1 i32.shr_u - i32.eqz else - i32.const 1 + i32.const 0 end + i32.eqz if global.get $~lib/memory/__stack_pointer local.get $4 diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index 5d8b16e859..68b879d469 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -7,21 +7,21 @@ (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_=>_f64 (func (param i32) (result f64))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i64_=>_i32 (func (param i64) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $f64_i32_=>_f64 (func (param f64 i32) (result f64))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $std/string/str (mut i32) (i32.const 32)) (global $std/string/nullStr (mut i32) (i32.const 0)) @@ -520,6 +520,7 @@ (data (i32.const 24780) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00b\00a\00r\00\00\00\00\00\00\00") (data (i32.const 24816) "\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\02\t\00\00\00\00\00\00\02A\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "getString" (func $std/string/getString)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 7edb7d55f0..d1be29d48a 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -1150,20 +1150,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1472 @@ -1863,14 +1860,11 @@ i32.eqz i32.eq if + local.get $0 + local.get $1 local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end + select + call $~lib/rt/itcms/Object#makeGray else global.get $~lib/rt/itcms/state i32.const 1 @@ -2092,10 +2086,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -2123,22 +2117,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 00353d632e..68ad1c1978 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4,8 +4,8 @@ (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_none (func)) (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))) @@ -78,6 +78,7 @@ (data (i32.const 1548) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\004\00\00\00S\00y\00m\00b\00o\00l\00(\00i\00s\00C\00o\00n\00c\00a\00t\00S\00p\00r\00e\00a\00d\00a\00b\00l\00e\00)\00\00\00\00\00\00\00\00\00") (data (i32.const 1632) "\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\10\01\82\00\00\00\00\00\10A\02\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/symbol/Symbol (param $0 i32) (result i32) diff --git a/tests/compiler/std/trace.optimized.wat b/tests/compiler/std/trace.optimized.wat index 96f1fc4f2d..7c02ba2beb 100644 --- a/tests/compiler/std/trace.optimized.wat +++ b/tests/compiler/std/trace.optimized.wat @@ -1,7 +1,7 @@ (module + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17804)) diff --git a/tests/compiler/std/trace.untouched.wat b/tests/compiler/std/trace.untouched.wat index 70914731ca..117c22a724 100644 --- a/tests/compiler/std/trace.untouched.wat +++ b/tests/compiler/std/trace.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__data_end i32 (i32.const 396)) @@ -18,6 +18,7 @@ (data (i32.const 300) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00i\00n\00t\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 348) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00f\00i\00v\00e\00_\00d\00b\00l\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~start diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index a3191fd3b5..f87db6d9ce 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -8,34 +8,34 @@ (type $i64_i32_i32_=>_i32 (func (param i64 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i64_i64_=>_i32 (func (param i64 i64) (result i32))) (type $f32_i32_i32_=>_i32 (func (param f32 i32 i32) (result i32))) (type $f64_i32_i32_=>_i32 (func (param f64 i32 i32) (result i32))) - (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) + (type $i64_i64_=>_i32 (func (param i64 i64) (result i32))) (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) + (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) (type $i64_i64_i32_i32_=>_i64 (func (param i64 i64 i32 i32) (result i64))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) - (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) - (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) + (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) + (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) - (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) - (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) + (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) + (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) + (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $none_=>_i32 (func (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1471,20 +1471,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1504 @@ -10653,10 +10650,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.0 local.get $2 i32.load offset=4 @@ -10704,10 +10701,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.01 local.get $2 i32.load offset=4 @@ -10758,10 +10755,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.04 local.get $2 i32.load offset=4 @@ -10812,10 +10809,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.07 local.get $2 i32.load offset=4 @@ -11768,10 +11765,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.041 local.get $4 i32.load offset=4 @@ -11822,10 +11819,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.044 local.get $4 i32.load offset=4 @@ -11874,10 +11871,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.047 local.get $4 i32.load offset=4 @@ -11928,10 +11925,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.050 local.get $4 i32.load offset=4 @@ -11982,10 +11979,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.053 local.get $4 i32.load offset=4 @@ -12036,10 +12033,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int16Array,i16>|inlined.056 local.get $4 i32.load offset=4 @@ -12263,10 +12260,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.0 local.get $2 i32.load offset=4 @@ -12314,10 +12311,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.01 local.get $2 i32.load offset=4 @@ -12368,10 +12365,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.04 local.get $2 i32.load offset=4 @@ -12422,10 +12419,10 @@ i32.const 1 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.07 local.get $2 i32.load offset=4 @@ -13378,10 +13375,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.041 local.get $4 i32.load offset=4 @@ -13432,10 +13429,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.044 local.get $4 i32.load offset=4 @@ -13484,10 +13481,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.047 local.get $4 i32.load offset=4 @@ -13538,10 +13535,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.050 local.get $4 i32.load offset=4 @@ -13592,10 +13589,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.053 local.get $4 i32.load offset=4 @@ -13646,10 +13643,10 @@ i32.const 1 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint16Array,u16>|inlined.056 local.get $4 i32.load offset=4 @@ -13871,10 +13868,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.0 local.get $2 i32.load offset=4 @@ -13922,10 +13919,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.01 local.get $2 i32.load offset=4 @@ -13976,10 +13973,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.04 local.get $2 i32.load offset=4 @@ -14030,10 +14027,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.07 local.get $2 i32.load offset=4 @@ -14987,10 +14984,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.041 local.get $4 i32.load offset=4 @@ -15041,10 +15038,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.044 local.get $4 i32.load offset=4 @@ -15093,10 +15090,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.047 local.get $4 i32.load offset=4 @@ -15147,10 +15144,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.050 local.get $4 i32.load offset=4 @@ -15201,10 +15198,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.053 local.get $4 i32.load offset=4 @@ -15255,10 +15252,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int32Array,i32>|inlined.056 local.get $4 i32.load offset=4 @@ -15480,10 +15477,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.0 local.get $2 i32.load offset=4 @@ -15531,10 +15528,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.01 local.get $2 i32.load offset=4 @@ -15585,10 +15582,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.04 local.get $2 i32.load offset=4 @@ -15639,10 +15636,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.07 local.get $2 i32.load offset=4 @@ -16595,10 +16592,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.041 local.get $4 i32.load offset=4 @@ -16649,10 +16646,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.044 local.get $4 i32.load offset=4 @@ -16701,10 +16698,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.047 local.get $4 i32.load offset=4 @@ -16755,10 +16752,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.050 local.get $4 i32.load offset=4 @@ -16809,10 +16806,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.053 local.get $4 i32.load offset=4 @@ -16863,10 +16860,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint32Array,u32>|inlined.056 local.get $4 i32.load offset=4 @@ -17089,10 +17086,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.0 local.get $2 i32.load offset=4 @@ -17140,10 +17137,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.01 local.get $2 i32.load offset=4 @@ -17194,10 +17191,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.04 local.get $2 i32.load offset=4 @@ -17248,10 +17245,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.07 local.get $2 i32.load offset=4 @@ -18208,10 +18205,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.041 local.get $4 i32.load offset=4 @@ -18262,10 +18259,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.044 local.get $4 i32.load offset=4 @@ -18314,10 +18311,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.047 local.get $4 i32.load offset=4 @@ -18368,10 +18365,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.050 local.get $4 i32.load offset=4 @@ -18422,10 +18419,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.053 local.get $4 i32.load offset=4 @@ -18476,10 +18473,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Int64Array,i64>|inlined.056 local.get $4 i32.load offset=4 @@ -18702,10 +18699,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.0 local.get $2 i32.load offset=4 @@ -18753,10 +18750,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.01 local.get $2 i32.load offset=4 @@ -18807,10 +18804,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.04 local.get $2 i32.load offset=4 @@ -18861,10 +18858,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.07 local.get $2 i32.load offset=4 @@ -19821,10 +19818,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.041 local.get $4 i32.load offset=4 @@ -19875,10 +19872,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.044 local.get $4 i32.load offset=4 @@ -19927,10 +19924,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.047 local.get $4 i32.load offset=4 @@ -19981,10 +19978,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.050 local.get $4 i32.load offset=4 @@ -20035,10 +20032,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.053 local.get $4 i32.load offset=4 @@ -20089,10 +20086,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Uint64Array,u64>|inlined.056 local.get $4 i32.load offset=4 @@ -20315,10 +20312,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.0 local.get $2 i32.load offset=4 @@ -20367,10 +20364,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.01 local.get $2 i32.load offset=4 @@ -20421,10 +20418,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.04 local.get $2 i32.load offset=4 @@ -20475,10 +20472,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.07 local.get $2 i32.load offset=4 @@ -21436,10 +21433,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.041 local.get $4 i32.load offset=4 @@ -21490,10 +21487,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.044 local.get $4 i32.load offset=4 @@ -21542,10 +21539,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.047 local.get $4 i32.load offset=4 @@ -21596,10 +21593,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.050 local.get $4 i32.load offset=4 @@ -21650,10 +21647,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.053 local.get $4 i32.load offset=4 @@ -21704,10 +21701,10 @@ i32.const 2 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.056 local.get $4 i32.load offset=4 @@ -21930,10 +21927,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.0 local.get $2 i32.load offset=4 @@ -21982,10 +21979,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.01 local.get $2 i32.load offset=4 @@ -22036,10 +22033,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.04 local.get $2 i32.load offset=4 @@ -22090,10 +22087,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.07 local.get $2 i32.load offset=4 @@ -23052,10 +23049,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.041 local.get $4 i32.load offset=4 @@ -23106,10 +23103,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.044 local.get $4 i32.load offset=4 @@ -23158,10 +23155,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.047 local.get $4 i32.load offset=4 @@ -23212,10 +23209,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.050 local.get $4 i32.load offset=4 @@ -23266,10 +23263,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.053 local.get $4 i32.load offset=4 @@ -23320,10 +23317,10 @@ i32.const 3 i32.shr_u local.tee $3 - i32.eqz - i32.const 1 + i32.const 0 local.get $3 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.056 local.get $4 i32.load offset=4 @@ -23844,10 +23841,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -23875,22 +23872,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 @@ -54840,10 +54835,10 @@ i32.const 3 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float64Array,f64>|inlined.0 local.get $3 i32.load offset=4 @@ -54893,10 +54888,10 @@ i32.const 3 i32.shr_u local.tee $2 - i32.eqz - i32.const 1 + i32.const 0 local.get $2 select + i32.eqz br_if $~lib/typedarray/INCLUDES<~lib/typedarray/Float64Array,f64>|inlined.0 drop local.get $3 @@ -54961,10 +54956,10 @@ i32.const 2 i32.shr_u local.tee $4 - i32.eqz - i32.const 1 + i32.const 0 local.get $4 select + i32.eqz br_if $~lib/typedarray/INDEX_OF<~lib/typedarray/Float32Array,f32>|inlined.0 local.get $3 i32.load offset=4 @@ -55014,10 +55009,10 @@ i32.const 2 i32.shr_u local.tee $2 - i32.eqz - i32.const 1 + i32.const 0 local.get $2 select + i32.eqz br_if $~lib/typedarray/INCLUDES<~lib/typedarray/Float32Array,f32>|inlined.0 drop local.get $3 diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 54283d324f..e137c9bc55 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -11,43 +11,43 @@ (type $f32_i32_i32_=>_i32 (func (param f32 i32 i32) (result i32))) (type $f64_i32_i32_=>_i32 (func (param f64 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i64_i64_i32_i32_=>_i64 (func (param i64 i64 i32 i32) (result i64))) + (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $f32_f32_=>_i32 (func (param f32 f32) (result i32))) - (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) - (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) - (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) + (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64))) - (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $f32_f32_i32_i32_=>_f32 (func (param f32 f32 i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $f64_f64_i32_i32_=>_f64 (func (param f64 f64 i32 i32) (result f64))) + (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) + (type $i64_i32_i32_=>_i64 (func (param i64 i32 i32) (result i64))) + (type $i64_i32_i32_=>_none (func (param i64 i32 i32))) + (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) + (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32))) + (type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64))) + (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) + (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) (type $f32_i32_i32_=>_none (func (param f32 i32 i32))) (type $f64_i32_i32_=>_none (func (param f64 i32 i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32))) - (type $f32_i32_i32_=>_f32 (func (param f32 i32 i32) (result f32))) - (type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64))) - (type $f64_i32_i32_=>_f64 (func (param f64 i32 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) + (type $none_=>_i32 (func (result i32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) + (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $f32_f32_=>_f32 (func (param f32 f32) (result f32))) - (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (import "env" "trace" (func $~lib/builtins/trace (param i32 i32 f64 f64 f64 f64 f64))) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) diff --git a/tests/compiler/std/uri.optimized.wat b/tests/compiler/std/uri.optimized.wat index 8f34376860..b37d772288 100644 --- a/tests/compiler/std/uri.optimized.wat +++ b/tests/compiler/std/uri.optimized.wat @@ -1163,20 +1163,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1520 @@ -2836,7 +2833,7 @@ local.get $1 i32.const 1 i32.shl - local.tee $8 + local.tee $9 i32.const 1 call $~lib/rt/itcms/__new local.set $3 @@ -2882,22 +2879,22 @@ local.get $6 i32.lt_u if - local.get $8 + local.get $9 local.get $7 local.get $6 local.get $5 i32.sub i32.const 1 i32.shl - local.tee $9 + local.tee $8 i32.add i32.lt_u if local.get $3 local.get $7 - local.get $9 + local.get $8 i32.add - local.tee $8 + local.tee $9 call $~lib/rt/itcms/__renew local.set $3 end @@ -2909,10 +2906,10 @@ i32.const 1 i32.shl i32.add - local.get $9 + local.get $8 call $~lib/memory/memory.copy local.get $7 - local.get $9 + local.get $8 i32.add local.set $7 local.get $1 @@ -2920,8 +2917,7 @@ i32.le_u br_if $while-break|0 end - local.get $8 - local.get $7 + local.get $9 i32.const 6 i32.const 24 local.get $4 @@ -3004,34 +3000,36 @@ i32.const 128 i32.lt_u select - i32.add + local.get $7 local.tee $5 + i32.add + local.tee $7 i32.lt_u if local.get $3 - local.get $5 + local.get $7 i32.const 1 i32.shl - local.get $5 + local.get $7 local.get $1 i32.const 1 i32.gt_u select - local.tee $8 + local.tee $9 call $~lib/rt/itcms/__renew local.set $3 end local.get $4 i32.const 128 i32.lt_u - if + if (result i32) local.get $3 - local.get $7 + local.get $5 i32.add - local.tee $5 + local.tee $7 i32.const 37 i32.store16 - local.get $5 + local.get $7 local.get $4 i32.const 4 i32.shr_u @@ -3050,25 +3048,28 @@ i32.shl i32.or i32.store offset=2 + local.get $5 + i32.const 6 + i32.add else local.get $3 local.get $4 i32.const 2048 i32.lt_u - if + if (result i32) local.get $3 - local.get $7 + local.get $5 i32.add - local.tee $5 + local.tee $7 i32.const 37 i32.store16 - local.get $5 + local.get $7 local.get $4 i32.const 6 i32.shr_u i32.const 192 i32.or - local.tee $5 + local.tee $7 i32.const 4 i32.shr_u i32.const 15 @@ -3076,7 +3077,7 @@ i32.const 1676 i32.add i32.load8_u - local.get $5 + local.get $7 i32.const 15 i32.and i32.const 1676 @@ -3086,25 +3087,28 @@ i32.shl i32.or i32.store offset=2 + local.get $5 + i32.const 6 + i32.add else local.get $3 local.get $4 i32.const 65536 i32.lt_u - if + if (result i32) local.get $3 - local.get $7 + local.get $5 i32.add - local.tee $5 + local.tee $7 i32.const 37 i32.store16 - local.get $5 + local.get $7 local.get $4 i32.const 12 i32.shr_u i32.const 224 i32.or - local.tee $5 + local.tee $7 i32.const 4 i32.shr_u i32.const 15 @@ -3112,7 +3116,7 @@ i32.const 1676 i32.add i32.load8_u - local.get $5 + local.get $7 i32.const 15 i32.and i32.const 1676 @@ -3122,20 +3126,23 @@ i32.shl i32.or i32.store offset=2 + local.get $5 + i32.const 6 + i32.add else local.get $3 - local.get $7 + local.get $5 i32.add - local.tee $5 + local.tee $7 i32.const 37 i32.store16 - local.get $5 + local.get $7 local.get $4 i32.const 18 i32.shr_u i32.const 240 i32.or - local.tee $5 + local.tee $7 i32.const 4 i32.shr_u i32.const 15 @@ -3143,7 +3150,7 @@ i32.const 1676 i32.add i32.load8_u - local.get $5 + local.get $7 i32.const 15 i32.and i32.const 1676 @@ -3154,7 +3161,7 @@ i32.or i32.store offset=2 local.get $3 - local.get $7 + local.get $5 i32.const 6 i32.add local.tee $7 @@ -3186,10 +3193,10 @@ i32.shl i32.or i32.store offset=2 + local.get $7 + i32.const 6 + i32.add end - local.get $7 - i32.const 6 - i32.add local.tee $7 i32.add local.tee $5 @@ -3219,10 +3226,10 @@ i32.shl i32.or i32.store offset=2 + local.get $7 + i32.const 6 + i32.add end - local.get $7 - i32.const 6 - i32.add local.tee $7 i32.add local.tee $5 @@ -3250,10 +3257,10 @@ i32.shl i32.or i32.store offset=2 + local.get $7 + i32.const 6 + i32.add end - local.get $7 - i32.const 6 - i32.add local.set $7 local.get $6 i32.const 1 @@ -3264,7 +3271,7 @@ end end local.get $7 - local.get $8 + local.get $9 i32.lt_u if (result i32) local.get $3 @@ -3286,10 +3293,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -3317,22 +3324,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/std/uri.untouched.wat b/tests/compiler/std/uri.untouched.wat index 232345eb36..13d4eefcd9 100644 --- a/tests/compiler/std/uri.untouched.wat +++ b/tests/compiler/std/uri.untouched.wat @@ -2,8 +2,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $none_=>_none (func)) (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))) @@ -98,6 +98,7 @@ (data (i32.const 3276) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00\f4\00\b8\00\ef\00\00\00\00\00\00\00") (data (i32.const 3312) "\03\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/string/String#get:length (param $0 i32) (result i32) diff --git a/tests/compiler/super-inline.optimized.wat b/tests/compiler/super-inline.optimized.wat index 95a3451e19..b33c391db1 100644 --- a/tests/compiler/super-inline.optimized.wat +++ b/tests/compiler/super-inline.optimized.wat @@ -3,8 +3,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1056,20 +1056,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1392 diff --git a/tests/compiler/super-inline.untouched.wat b/tests/compiler/super-inline.untouched.wat index 3b5ff64840..3cbdbc3100 100644 --- a/tests/compiler/super-inline.untouched.wat +++ b/tests/compiler/super-inline.untouched.wat @@ -6,8 +6,8 @@ (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_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -38,6 +38,7 @@ (data (i32.const 348) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 416) "\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\03\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) diff --git a/tests/compiler/switch.untouched.wat b/tests/compiler/switch.untouched.wat index 221844bba7..92329c9144 100644 --- a/tests/compiler/switch.untouched.wat +++ b/tests/compiler/switch.untouched.wat @@ -9,6 +9,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00s\00w\00i\00t\00c\00h\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $switch/doSwitch (param $0 i32) (result i32) diff --git a/tests/compiler/tablebase.optimized.wat b/tests/compiler/tablebase.optimized.wat index 480eabf448..c2f7a71575 100644 --- a/tests/compiler/tablebase.optimized.wat +++ b/tests/compiler/tablebase.optimized.wat @@ -1,6 +1,6 @@ (module - (type $none_=>_none (func)) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17500)) (memory $0 1) diff --git a/tests/compiler/tablebase.untouched.wat b/tests/compiler/tablebase.untouched.wat index 890fcf6881..6b13412c68 100644 --- a/tests/compiler/tablebase.untouched.wat +++ b/tests/compiler/tablebase.untouched.wat @@ -1,7 +1,7 @@ (module (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $tablebase/staticFunction i32 (i32.const 32)) (global $~lib/ASC_TABLE_BASE i32 (i32.const 32)) diff --git a/tests/compiler/templateliteral.optimized.wat b/tests/compiler/templateliteral.optimized.wat index c48b5f9fd1..dbe75c87b0 100644 --- a/tests/compiler/templateliteral.optimized.wat +++ b/tests/compiler/templateliteral.optimized.wat @@ -1,15 +1,15 @@ (module (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_none (func)) (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 $f64_=>_i32 (func (param f64) (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))) (type $i64_i32_i64_i32_i64_i32_=>_i32 (func (param i64 i32 i64 i32 i64 i32) (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))) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) @@ -1207,20 +1207,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1520 @@ -3055,10 +3052,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -3086,22 +3083,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 diff --git a/tests/compiler/templateliteral.untouched.wat b/tests/compiler/templateliteral.untouched.wat index 959eae777c..768a99f96e 100644 --- a/tests/compiler/templateliteral.untouched.wat +++ b/tests/compiler/templateliteral.untouched.wat @@ -7,15 +7,15 @@ (type $i32_=>_none (func (param 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 $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) + (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) + (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) @@ -96,6 +96,7 @@ (data (i32.const 4508) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00(\00A\00=\00r\00e\00f\00#\001\00,\00 \00B\00=\00r\00e\00f\00#\002\00)\00\00\00\00\00\00\00\00\00") (data (i32.const 4576) "\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\04A\00\00\00\00\00\00 \00\00\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/rt/itcms/Object#get:color (param $0 i32) (result i32) diff --git a/tests/compiler/ternary.untouched.wat b/tests/compiler/ternary.untouched.wat index dc6ac01dee..1a6667332f 100644 --- a/tests/compiler/ternary.untouched.wat +++ b/tests/compiler/ternary.untouched.wat @@ -7,6 +7,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "test" (func $ternary/test)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/throw.optimized.wat b/tests/compiler/throw.optimized.wat index e576f3b7fa..f27d104813 100644 --- a/tests/compiler/throw.optimized.wat +++ b/tests/compiler/throw.optimized.wat @@ -1016,20 +1016,17 @@ local.get $3 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $3 select if (result i32) + i32.const 1 + else local.get $0 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1632 diff --git a/tests/compiler/throw.untouched.wat b/tests/compiler/throw.untouched.wat index b79c13f283..6862ddcd6a 100644 --- a/tests/compiler/throw.untouched.wat +++ b/tests/compiler/throw.untouched.wat @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param 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))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) @@ -42,6 +42,7 @@ (data (i32.const 652) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00d\00o\00T\00h\00r\00o\00w\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 704) "\03\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) + (elem $0 (i32.const 1)) (export "doThrow" (func $throw/doThrow)) (export "memory" (memory $0)) (start $~start) diff --git a/tests/compiler/typealias.untouched.wat b/tests/compiler/typealias.untouched.wat index b81b311ee2..98ec167efb 100644 --- a/tests/compiler/typealias.untouched.wat +++ b/tests/compiler/typealias.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "alias" (func $typealias/alias)) (export "memory" (memory $0)) (func $typealias/alias (param $0 i32) (result i32) diff --git a/tests/compiler/typeof.optimized.wat b/tests/compiler/typeof.optimized.wat index 95479a6eb4..2887713ff9 100644 --- a/tests/compiler/typeof.optimized.wat +++ b/tests/compiler/typeof.optimized.wat @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $none_=>_i32 (func (result 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 $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) @@ -66,10 +66,10 @@ return end local.get $1 - i32.eqz - i32.const 1 + i32.const 0 local.get $0 select + i32.eqz if i32.const 0 return @@ -97,22 +97,20 @@ local.set $2 local.get $1 local.set $3 + local.get $2 + i32.const 7 + i32.and + local.get $3 + i32.const 7 + i32.and + i32.or + i32.const 1 local.get $4 local.tee $0 i32.const 4 i32.ge_u - if (result i32) - local.get $2 - i32.const 7 - i32.and - local.get $3 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end + select + i32.eqz if loop $do-continue|0 local.get $2 @@ -1192,20 +1190,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1696 diff --git a/tests/compiler/typeof.untouched.wat b/tests/compiler/typeof.untouched.wat index 7c98880320..ba3dca6777 100644 --- a/tests/compiler/typeof.untouched.wat +++ b/tests/compiler/typeof.untouched.wat @@ -5,10 +5,10 @@ (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 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 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $typeof/SomeNamespace.a i32 (i32.const 1)) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) diff --git a/tests/compiler/unary.untouched.wat b/tests/compiler/unary.untouched.wat index 0f905c5e44..f8de28e6b3 100644 --- a/tests/compiler/unary.untouched.wat +++ b/tests/compiler/unary.untouched.wat @@ -9,6 +9,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:unary diff --git a/tests/compiler/unify-local-flags.untouched.wat b/tests/compiler/unify-local-flags.untouched.wat index 93d9d07ba9..8bc877793a 100644 --- a/tests/compiler/unify-local-flags.untouched.wat +++ b/tests/compiler/unify-local-flags.untouched.wat @@ -5,6 +5,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "testFor" (func $unify-local-flags/testFor)) (export "testWhile" (func $unify-local-flags/testWhile)) (export "testDo" (func $unify-local-flags/testDo)) diff --git a/tests/compiler/void.untouched.wat b/tests/compiler/void.untouched.wat index 6175cc20ea..b4490b85a4 100644 --- a/tests/compiler/void.untouched.wat +++ b/tests/compiler/void.untouched.wat @@ -8,6 +8,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $void/anInt (result i32) diff --git a/tests/compiler/wasi/abort.optimized.wat b/tests/compiler/wasi/abort.optimized.wat index 64cca09d2e..dbe733a2ea 100644 --- a/tests/compiler/wasi/abort.optimized.wat +++ b/tests/compiler/wasi/abort.optimized.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (memory $0 1) diff --git a/tests/compiler/wasi/abort.untouched.wat b/tests/compiler/wasi/abort.untouched.wat index 55df334f51..dc78a728d0 100644 --- a/tests/compiler/wasi/abort.untouched.wat +++ b/tests/compiler/wasi/abort.untouched.wat @@ -1,8 +1,8 @@ (module - (type $none_=>_none (func)) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) @@ -14,6 +14,7 @@ (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\16\00\00\00t\00h\00e\00 \00m\00e\00s\00s\00a\00g\00e\00\00\00\00\00\00\00") (data (i32.const 60) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00w\00a\00s\00i\00/\00a\00b\00o\00r\00t\00.\00t\00s\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "test" (func $wasi/abort/test)) (export "memory" (memory $0)) (export "_start" (func $~start)) diff --git a/tests/compiler/wasi/seed.optimized.wat b/tests/compiler/wasi/seed.optimized.wat index a351db9511..767a39898e 100644 --- a/tests/compiler/wasi/seed.optimized.wat +++ b/tests/compiler/wasi/seed.optimized.wat @@ -1,8 +1,8 @@ (module (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) (type $none_=>_f64 (func (result f64))) (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) diff --git a/tests/compiler/wasi/seed.untouched.wat b/tests/compiler/wasi/seed.untouched.wat index 521c013bfc..efda94a392 100644 --- a/tests/compiler/wasi/seed.untouched.wat +++ b/tests/compiler/wasi/seed.untouched.wat @@ -1,14 +1,14 @@ (module - (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_f64 (func (result f64))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i64_=>_none (func (param i64))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i64_=>_i64 (func (param i64) (result i64))) + (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i64_=>_none (func (param i64))) + (type $none_=>_none (func)) (import "wasi_snapshot_preview1" "random_get" (func $~lib/bindings/wasi_snapshot_preview1/random_get (param i32 i32) (result i32))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) @@ -23,6 +23,7 @@ (memory $0 1) (data (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00~\00l\00i\00b\00/\00m\00a\00t\00h\00.\00t\00s\00\00\00\00\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "test" (func $wasi/seed/test)) (export "memory" (memory $0)) (export "_start" (func $~start)) diff --git a/tests/compiler/wasi/snapshot_preview1.untouched.wat b/tests/compiler/wasi/snapshot_preview1.untouched.wat index 2fb19232cf..c954b2c789 100644 --- a/tests/compiler/wasi/snapshot_preview1.untouched.wat +++ b/tests/compiler/wasi/snapshot_preview1.untouched.wat @@ -10,6 +10,7 @@ (global $~lib/memory/__heap_base i32 (i32.const 16392)) (memory $0 0) (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $start:wasi/snapshot_preview1 diff --git a/tests/compiler/wasi/trace.optimized.wat b/tests/compiler/wasi/trace.optimized.wat index f2101c1dbe..8ce0f49a81 100644 --- a/tests/compiler/wasi/trace.optimized.wat +++ b/tests/compiler/wasi/trace.optimized.wat @@ -1,15 +1,15 @@ (module (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $none_=>_none (func)) - (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $none_=>_none (func)) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) + (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_f64_f64_f64_f64_f64_=>_none (func (param i32 f64 f64 f64 f64 f64))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_f64_f64_f64_f64_f64_=>_none (func (param i32 f64 f64 f64 f64 f64))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -3795,20 +3795,17 @@ local.get $7 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $7 select if (result i32) + i32.const 1 + else local.get $8 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1104 diff --git a/tests/compiler/wasi/trace.untouched.wat b/tests/compiler/wasi/trace.untouched.wat index 4acb47fd45..3cfe2f48b8 100644 --- a/tests/compiler/wasi/trace.untouched.wat +++ b/tests/compiler/wasi/trace.untouched.wat @@ -4,13 +4,13 @@ (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_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_=>_none (func (param i32))) (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) + (type $i32_i32_f64_f64_f64_f64_f64_=>_none (func (param i32 i32 f64 f64 f64 f64 f64))) (import "wasi_snapshot_preview1" "fd_write" (func $~lib/bindings/wasi_snapshot_preview1/fd_write (param i32 i32 i32 i32) (result i32))) (import "wasi_snapshot_preview1" "proc_exit" (func $~lib/bindings/wasi_snapshot_preview1/proc_exit (param i32))) (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) @@ -35,6 +35,7 @@ (data (i32.const 1064) "\01\00\00\00\n\00\00\00d\00\00\00\e8\03\00\00\10\'\00\00\a0\86\01\00@B\0f\00\80\96\98\00\00\e1\f5\05\00\ca\9a;") (data (i32.const 1104) "0\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\008\000\009\001\000\001\001\001\002\001\003\001\004\001\005\001\006\001\007\001\008\001\009\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\008\002\009\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\008\003\009\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\008\004\009\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\008\005\009\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\008\006\009\007\000\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\008\007\009\008\000\008\001\008\002\008\003\008\004\008\005\008\006\008\007\008\008\008\009\009\000\009\001\009\002\009\003\009\004\009\005\009\006\009\007\009\008\009\009\00") (table $0 1 funcref) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (export "_start" (func $~start)) (func $~lib/string/String.UTF8.byteLength (param $0 i32) (param $1 i32) (result i32) diff --git a/tests/compiler/while.optimized.wat b/tests/compiler/while.optimized.wat index 0cc0a7f122..e0f1361365 100644 --- a/tests/compiler/while.optimized.wat +++ b/tests/compiler/while.optimized.wat @@ -3,8 +3,8 @@ (type $none_=>_i32 (func (result i32))) (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_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) @@ -1044,20 +1044,17 @@ local.get $0 i32.const 15 i32.and - i32.eqz - i32.const 0 + i32.const 1 local.get $0 select if (result i32) + i32.const 1 + else local.get $1 i32.load i32.const 1 i32.and - i32.eqz - else - i32.const 0 end - i32.eqz if i32.const 0 i32.const 1440 diff --git a/tests/compiler/while.untouched.wat b/tests/compiler/while.untouched.wat index 65a46a3b0c..573b565da0 100644 --- a/tests/compiler/while.untouched.wat +++ b/tests/compiler/while.untouched.wat @@ -3,8 +3,8 @@ (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $none_=>_i32 (func (result 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 $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) @@ -38,6 +38,7 @@ (data (i32.const 396) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 464) "\04\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) + (elem $0 (i32.const 1)) (export "memory" (memory $0)) (start $~start) (func $while/testSimple From 9810f2fdd81e8b2f5749bb352233f7ac29ebb280 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 1 Jun 2021 11:19:23 -0400 Subject: [PATCH 05/19] nit: simplify test --- tests/compiler/nonnullable.optimized.wat | 1604 +------------ tests/compiler/nonnullable.ts | 28 +- tests/compiler/nonnullable.untouched.wat | 2634 +--------------------- 3 files changed, 131 insertions(+), 4135 deletions(-) diff --git a/tests/compiler/nonnullable.optimized.wat b/tests/compiler/nonnullable.optimized.wat index 3be57e4242..67c129759a 100644 --- a/tests/compiler/nonnullable.optimized.wat +++ b/tests/compiler/nonnullable.optimized.wat @@ -1,44 +1,18 @@ (module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_i32 (func (result i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) + (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $nonnullable/y (mut i32) (i32.const 0)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 18028)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17612)) (memory $0 1) (data (i32.const 1036) "\1c") (data (i32.const 1048) "\01\00\00\00\06\00\00\00u\003\002") (data (i32.const 1068) ",") - (data (i32.const 1080) "\01\00\00\00\1c\00\00\00n\00o\00n\00n\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s") - (data (i32.const 1116) "L") - (data (i32.const 1128) "\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>") - (data (i32.const 1196) "<") - (data (i32.const 1208) "\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 1260) "<") - (data (i32.const 1272) "\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s") - (data (i32.const 1388) "<") - (data (i32.const 1400) "\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") - (data (i32.const 1452) ",") - (data (i32.const 1464) "\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") - (data (i32.const 1532) "<") - (data (i32.const 1544) "\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 1600) "\05\00\00\00 \00\00\00\00\00\00\00 ") - (data (i32.const 1628) "\02A\00\00\00\00\00\00 ") + (data (i32.const 1080) "\01\00\00\00\1c\00\00\00N\00o\00n\00N\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s") + (data (i32.const 1116) "\1c") + (data (i32.const 1128) "\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g") + (data (i32.const 1148) "L") + (data (i32.const 1160) "\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>") (export "memory" (memory $0)) (start $~start) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) @@ -160,1550 +134,86 @@ end i32.eqz ) - (func $~lib/rt/itcms/visitRoots + (func $~start (local $0 i32) - (local $1 i32) - global.get $nonnullable/y - local.tee $0 - if - local.get $0 - call $~lib/rt/itcms/__visit - end - i32.const 1408 - call $~lib/rt/itcms/__visit - i32.const 1216 - call $~lib/rt/itcms/__visit - global.get $~lib/rt/itcms/pinSpace - local.tee $1 - i32.load offset=4 - i32.const -4 - i32.and - local.set $0 - loop $while-continue|0 - local.get $0 - local.get $1 - i32.ne - if - local.get $0 - i32.load offset=4 - i32.const 3 - i32.and - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 1280 - i32.const 159 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 20 - i32.add - call $~lib/rt/__visit_members - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - local.set $0 - br $while-continue|0 - end - end - ) - (func $~lib/rt/itcms/__visit (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.eqz - if - return - end - global.get $~lib/rt/itcms/white - local.get $0 - i32.const 20 + global.get $~lib/memory/__stack_pointer + i32.const 8 i32.sub - local.tee $0 - i32.load offset=4 - i32.const 3 - i32.and - i32.eq + global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 1228 + i32.lt_s if - local.get $0 - global.get $~lib/rt/itcms/iter - i32.eq - if - local.get $0 - i32.load offset=8 - local.tee $1 - i32.eqz - if - i32.const 0 - i32.const 1280 - i32.const 147 - i32.const 30 - call $~lib/builtins/abort - unreachable - end - local.get $1 - global.set $~lib/rt/itcms/iter - end - block $__inlined_func$~lib/rt/itcms/Object#unlink - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - local.tee $2 - i32.eqz - if - i32.const 0 - local.get $0 - i32.const 18028 - i32.lt_u - local.get $0 - i32.load offset=8 - select - i32.eqz - if - i32.const 0 - i32.const 1280 - i32.const 127 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - br $__inlined_func$~lib/rt/itcms/Object#unlink - end - local.get $0 - i32.load offset=8 - local.tee $1 - i32.eqz - if - i32.const 0 - i32.const 1280 - i32.const 131 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.store offset=8 - local.get $1 - local.get $2 - local.get $1 - i32.load offset=4 - i32.const 3 - i32.and - i32.or - i32.store offset=4 - end - global.get $~lib/rt/itcms/toSpace - local.set $1 - local.get $0 - i32.load offset=12 - local.tee $2 + i32.const 17632 + i32.const 17680 i32.const 1 - i32.le_u - if (result i32) - i32.const 1 - else - local.get $2 - i32.const 1600 - i32.load - i32.gt_u - if - i32.const 1408 - i32.const 1472 - i32.const 22 - i32.const 28 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 3 - i32.shl - i32.const 1604 - i32.add - i32.load - i32.const 32 - i32.and - end - if (result i32) - global.get $~lib/rt/itcms/white - i32.eqz - else - i32.const 2 - end - local.set $3 - local.get $1 - i32.load offset=8 - local.set $2 - local.get $0 - local.get $1 - local.get $3 - i32.or - i32.store offset=4 - local.get $0 - local.get $2 - i32.store offset=8 - local.get $2 - local.get $0 - local.get $2 - i32.load offset=4 - i32.const 3 - i32.and - i32.or - i32.store offset=4 - local.get $1 - local.get $0 - i32.store offset=8 - global.get $~lib/rt/itcms/visitCount i32.const 1 - i32.add - global.set $~lib/rt/itcms/visitCount - end - ) - (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 1552 - i32.const 268 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const -4 - i32.and - local.tee $2 - i32.const 12 - i32.lt_u - if - i32.const 0 - i32.const 1552 - i32.const 270 - 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 - i32.const 31 - local.get $2 - i32.const 1073741820 - local.get $2 - i32.const 1073741820 - i32.lt_u - select - local.tee $2 - i32.clz - i32.sub - local.set $3 - local.get $2 - local.get $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 $3 - end - local.get $2 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $3 - i32.const 23 - i32.lt_u - select - i32.eqz - if - i32.const 0 - i32.const 1552 - i32.const 284 - i32.const 14 call $~lib/builtins/abort unreachable end - local.get $1 - i32.load offset=8 - local.set $4 - local.get $1 - i32.load offset=4 - local.tee $5 - if - local.get $5 - local.get $4 - i32.store offset=8 - end - local.get $4 - if - local.get $4 - local.get $5 - i32.store offset=4 - end - local.get $1 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i64.const 0 + i64.store local.get $0 - local.get $2 - local.get $3 - 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 $3 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - local.get $4 - i32.store offset=96 - local.get $4 - i32.eqz - if - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - local.tee $4 - i32.load offset=4 - i32.const -2 - local.get $2 - i32.rotl - i32.and - local.set $1 - local.get $4 - local.get $1 - i32.store offset=4 - local.get $1 - i32.eqz - if - local.get $0 - local.get $0 - i32.load - i32.const -2 - local.get $3 - i32.rotl - 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.get $1 + i32.const 1056 + i32.store + local.get $0 + i32.const 1056 + i32.store offset=4 + i32.const 1056 + i32.const 1056 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 1552 - i32.const 201 - i32.const 14 + i32.const 1088 + i32.const 5 + i32.const 1 call $~lib/builtins/abort unreachable end - local.get $1 - i32.load - local.tee $3 - i32.const 1 - i32.and + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 1136 + i32.store + local.get $0 + i32.const 1136 + i32.store offset=4 + i32.const 1136 + i32.const 1136 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 1552 - i32.const 203 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 4 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.tee $2 - i32.const 1 - i32.and - if - local.get $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $3 - i32.const 4 - i32.add - local.get $2 - i32.const -4 - i32.and - i32.add - local.tee $3 - i32.store - local.get $1 - i32.const 4 - i32.add - local.get $1 - i32.load - i32.const -4 - i32.and - i32.add - local.tee $4 - i32.load - local.set $2 - end - local.get $3 - i32.const 2 - i32.and - if - local.get $1 - i32.const 4 - i32.sub - i32.load - local.tee $1 - i32.load - local.tee $6 + i32.const 1088 + i32.const 6 i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 1552 - i32.const 221 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $6 - i32.const 4 - i32.add - local.get $3 - i32.const -4 - i32.and - i32.add - local.tee $3 - i32.store - end - local.get $4 - local.get $2 - i32.const 2 - i32.or - i32.store - local.get $3 - i32.const -4 - i32.and - local.tee $3 - i32.const 12 - i32.lt_u - if - i32.const 0 - i32.const 1552 - i32.const 233 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $3 - local.get $1 - i32.const 4 - i32.add - i32.add - local.get $4 - i32.ne - if - i32.const 0 - i32.const 1552 - i32.const 234 - i32.const 14 call $~lib/builtins/abort unreachable end - local.get $4 - i32.const 4 - i32.sub - local.get $1 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 1168 i32.store - local.get $3 - i32.const 256 - i32.lt_u - if (result i32) - local.get $3 - i32.const 4 - i32.shr_u - else - i32.const 31 - local.get $3 - i32.const 1073741820 - local.get $3 - i32.const 1073741820 - i32.lt_u - select - local.tee $3 - i32.clz - i32.sub - local.tee $4 - i32.const 7 - i32.sub - local.set $5 - local.get $3 - local.get $4 - i32.const 4 - i32.sub - i32.shr_u - i32.const 16 - i32.xor - end - local.tee $3 - i32.const 16 - i32.lt_u - i32.const 0 - local.get $5 - i32.const 23 - i32.lt_u - select + local.get $0 + i32.const 1168 + i32.store offset=4 + i32.const 1168 + i32.const 1168 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 1552 - i32.const 251 - i32.const 14 + i32.const 1088 + i32.const 7 + i32.const 1 call $~lib/builtins/abort unreachable end - local.get $0 - local.get $3 - local.get $5 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.add - i32.load offset=96 - local.set $4 - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - local.get $4 - i32.store offset=8 - local.get $4 - if - local.get $4 - local.get $1 - i32.store offset=4 - end - local.get $0 - local.get $3 - local.get $5 - 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 $5 - i32.shl - i32.or - i32.store - local.get $0 - local.get $5 - i32.const 2 - i32.shl + global.get $~lib/memory/__stack_pointer + i32.const 8 i32.add - local.tee $0 - local.get $0 - i32.load offset=4 - i32.const 1 - local.get $3 - 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 $1 - local.get $2 - i32.gt_u - if - i32.const 0 - i32.const 1552 - i32.const 377 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 19 - i32.add - i32.const -16 - i32.and - i32.const 4 - i32.sub - local.set $1 - local.get $2 - i32.const -16 - i32.and - local.get $0 - i32.load offset=1568 - local.tee $2 - if - local.get $1 - local.get $2 - i32.const 4 - i32.add - i32.lt_u - if - i32.const 0 - i32.const 1552 - i32.const 384 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.get $1 - i32.const 16 - i32.sub - i32.eq - if - local.get $2 - 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 1552 - i32.const 397 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - end - local.get $1 - i32.sub - local.tee $2 - i32.const 20 - i32.lt_u - if - return - end - local.get $1 - local.get $4 - i32.const 2 - i32.and - local.get $2 - i32.const 8 - i32.sub - local.tee $2 - i32.const 1 - i32.or - i32.or - i32.store - local.get $1 - i32.const 0 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.store offset=8 - local.get $2 - local.get $1 - i32.const 4 - i32.add - i32.add - 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/initialize - (local $0 i32) - (local $1 i32) - memory.size - local.tee $0 - i32.const 1 - i32.lt_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 18032 - i32.const 0 - i32.store - i32.const 19600 - 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 18032 - i32.add - i32.const 0 - i32.store offset=4 - i32.const 0 - local.set $0 - loop $for-loop|1 - local.get $0 - i32.const 16 - i32.lt_u - if - local.get $0 - local.get $1 - i32.const 4 - i32.shl - i32.add - i32.const 2 - i32.shl - i32.const 18032 - i32.add - i32.const 0 - i32.store offset=96 - local.get $0 - i32.const 1 - i32.add - local.set $0 - 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 18032 - i32.const 19604 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - i32.const 18032 - global.set $~lib/rt/tlsf/ROOT - ) - (func $~lib/rt/itcms/step (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - block $folding-inner0 - block $break|0 - block $case2|0 - block $case1|0 - block $case0|0 - global.get $~lib/rt/itcms/state - br_table $case0|0 $case1|0 $case2|0 $break|0 - end - i32.const 1 - global.set $~lib/rt/itcms/state - i32.const 0 - global.set $~lib/rt/itcms/visitCount - call $~lib/rt/itcms/visitRoots - global.get $~lib/rt/itcms/toSpace - global.set $~lib/rt/itcms/iter - br $folding-inner0 - end - global.get $~lib/rt/itcms/white - i32.eqz - local.set $1 - global.get $~lib/rt/itcms/iter - i32.load offset=4 - i32.const -4 - i32.and - local.set $0 - loop $while-continue|1 - local.get $0 - global.get $~lib/rt/itcms/toSpace - i32.ne - if - local.get $0 - global.set $~lib/rt/itcms/iter - local.get $1 - local.get $0 - i32.load offset=4 - i32.const 3 - i32.and - i32.ne - if - local.get $0 - local.get $1 - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - i32.or - i32.store offset=4 - i32.const 0 - global.set $~lib/rt/itcms/visitCount - local.get $0 - i32.const 20 - i32.add - call $~lib/rt/__visit_members - br $folding-inner0 - end - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - local.set $0 - br $while-continue|1 - end - end - i32.const 0 - global.set $~lib/rt/itcms/visitCount - call $~lib/rt/itcms/visitRoots - global.get $~lib/rt/itcms/toSpace - global.get $~lib/rt/itcms/iter - i32.load offset=4 - i32.const -4 - i32.and - i32.eq - if - global.get $~lib/memory/__stack_pointer - local.set $0 - loop $while-continue|0 - local.get $0 - i32.const 18028 - i32.lt_u - if - local.get $0 - i32.load - call $~lib/rt/itcms/__visit - local.get $0 - i32.const 4 - i32.add - local.set $0 - br $while-continue|0 - end - end - global.get $~lib/rt/itcms/iter - i32.load offset=4 - i32.const -4 - i32.and - local.set $0 - loop $while-continue|2 - local.get $0 - global.get $~lib/rt/itcms/toSpace - i32.ne - if - local.get $1 - local.get $0 - i32.load offset=4 - i32.const 3 - i32.and - i32.ne - if - local.get $0 - local.get $1 - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - i32.or - i32.store offset=4 - local.get $0 - i32.const 20 - i32.add - call $~lib/rt/__visit_members - end - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - local.set $0 - br $while-continue|2 - end - end - global.get $~lib/rt/itcms/fromSpace - local.set $0 - global.get $~lib/rt/itcms/toSpace - global.set $~lib/rt/itcms/fromSpace - local.get $0 - global.set $~lib/rt/itcms/toSpace - local.get $1 - global.set $~lib/rt/itcms/white - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - global.set $~lib/rt/itcms/iter - i32.const 2 - global.set $~lib/rt/itcms/state - end - br $folding-inner0 - end - global.get $~lib/rt/itcms/iter - local.tee $0 - global.get $~lib/rt/itcms/toSpace - i32.ne - if - local.get $0 - i32.load offset=4 - i32.const -4 - i32.and - global.set $~lib/rt/itcms/iter - global.get $~lib/rt/itcms/white - i32.eqz - local.get $0 - i32.load offset=4 - i32.const 3 - i32.and - i32.ne - if - i32.const 0 - i32.const 1280 - i32.const 228 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.const 18028 - i32.lt_u - if - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - else - global.get $~lib/rt/itcms/total - local.get $0 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.sub - global.set $~lib/rt/itcms/total - local.get $0 - i32.const 4 - i32.add - local.tee $0 - i32.const 18028 - i32.ge_u - if - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - i32.const 4 - i32.sub - local.set $1 - local.get $0 - i32.const 15 - i32.and - i32.const 1 - local.get $0 - select - if (result i32) - i32.const 1 - else - local.get $1 - i32.load - i32.const 1 - i32.and - end - if - i32.const 0 - i32.const 1552 - i32.const 559 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.tee $0 - i32.load - i32.const 1 - i32.or - local.set $1 - local.get $0 - local.get $1 - i32.store - local.get $0 - call $~lib/rt/tlsf/insertBlock - end - end - i32.const 10 - return - end - global.get $~lib/rt/itcms/toSpace - local.tee $0 - local.get $0 - i32.store offset=4 - global.get $~lib/rt/itcms/toSpace - local.tee $0 - local.get $0 - i32.store offset=8 - i32.const 0 - global.set $~lib/rt/itcms/state - end - i32.const 0 - return - end - global.get $~lib/rt/itcms/visitCount - ) - (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 1552 - i32.const 343 - 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/itcms/__new (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.ge_u - if - block $__inlined_func$~lib/rt/itcms/interrupt - i32.const 2048 - local.set $0 - loop $do-continue|0 - local.get $0 - call $~lib/rt/itcms/step - i32.sub - local.set $0 - global.get $~lib/rt/itcms/state - i32.eqz - if - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i64.const 200 - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - br $__inlined_func$~lib/rt/itcms/interrupt - end - local.get $0 - i32.const 0 - i32.gt_s - br_if $do-continue|0 - end - global.get $~lib/rt/itcms/total - local.tee $0 - local.get $0 - global.get $~lib/rt/itcms/threshold - i32.sub - i32.const 1024 - i32.lt_u - i32.const 10 - i32.shl - i32.add - global.set $~lib/rt/itcms/threshold - end - end - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.tee $1 - call $~lib/rt/tlsf/searchBlock - local.tee $0 - i32.eqz - if - i32.const 4 - memory.size - local.tee $0 - i32.const 16 - i32.shl - i32.const 4 - i32.sub - local.get $1 - i32.load offset=1568 - i32.ne - i32.shl - i32.const 65563 - i32.add - i32.const -65536 - i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $0 - local.get $2 - local.get $0 - local.get $2 - i32.gt_s - select - memory.grow - i32.const 0 - i32.lt_s - if - local.get $2 - memory.grow - i32.const 0 - i32.lt_s - if - unreachable - end - end - local.get $1 - local.get $0 - i32.const 16 - i32.shl - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - local.get $1 - call $~lib/rt/tlsf/searchBlock - local.tee $0 - i32.eqz - if - i32.const 0 - i32.const 1552 - i32.const 496 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - end - local.get $0 - i32.load - i32.const -4 - i32.and - i32.const 28 - i32.lt_u - if - i32.const 0 - i32.const 1552 - i32.const 498 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.get $0 - call $~lib/rt/tlsf/removeBlock - local.get $0 - i32.load - local.tee $2 - i32.const -4 - i32.and - i32.const 28 - i32.sub - local.tee $3 - i32.const 16 - i32.ge_u - if - local.get $0 - local.get $2 - i32.const 2 - i32.and - i32.const 28 - i32.or - i32.store - local.get $0 - i32.const 32 - i32.add - local.tee $2 - local.get $3 - i32.const 4 - i32.sub - i32.const 1 - i32.or - i32.store - local.get $1 - local.get $2 - call $~lib/rt/tlsf/insertBlock - else - local.get $0 - local.get $2 - i32.const -2 - i32.and - i32.store - local.get $0 - i32.const 4 - i32.add - local.tee $1 - local.get $0 - i32.load - i32.const -4 - i32.and - i32.add - local.get $1 - local.get $0 - i32.load - i32.const -4 - i32.and - i32.add - i32.load - i32.const -3 - i32.and - i32.store - end - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - global.get $~lib/rt/itcms/fromSpace - local.tee $2 - i32.load offset=8 - local.set $1 - local.get $0 - local.get $2 - global.get $~lib/rt/itcms/white - i32.or - i32.store offset=4 - local.get $0 - local.get $1 - i32.store offset=8 - local.get $1 - local.get $0 - local.get $1 - i32.load offset=4 - i32.const 3 - i32.and - i32.or - i32.store offset=4 - local.get $2 - local.get $0 - i32.store offset=8 - global.get $~lib/rt/itcms/total - local.get $0 - i32.load - i32.const -4 - i32.and - i32.const 4 - i32.add - i32.add - global.set $~lib/rt/itcms/total - local.get $0 - i32.const 20 - i32.add - ) - (func $~lib/rt/__visit_members (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - block $invalid - block $nonnullable/Tee - block $~lib/array/Array<~lib/string/String> - block $~lib/arraybuffer/ArrayBufferView - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $~lib/array/Array<~lib/string/String> $nonnullable/Tee $invalid - end - return - end - return - end - local.get $0 - i32.load - local.tee $0 - if - local.get $0 - call $~lib/rt/itcms/__visit - end - return - end - local.get $0 - i32.load offset=4 - local.tee $1 - local.get $0 - i32.load offset=12 - i32.const 2 - i32.shl - i32.add - local.set $2 - loop $while-continue|0 - local.get $1 - local.get $2 - i32.lt_u - if - local.get $1 - i32.load - local.tee $3 - if - local.get $3 - call $~lib/rt/itcms/__visit - end - local.get $1 - i32.const 4 - i32.add - local.set $1 - br $while-continue|0 - end - end - local.get $0 - i32.load - call $~lib/rt/itcms/__visit - return - end - return - end - unreachable - ) - (func $~start - (local $0 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 1644 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i64.const 0 - i64.store - local.get $0 - i32.const 1056 - i32.store - local.get $0 - i32.const 1056 - i32.store offset=4 - i32.const 1056 - i32.const 1056 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 1088 - i32.const 4 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 1136 - i32.store - local.get $0 - i32.const 1136 - i32.store offset=4 - i32.const 1136 - i32.const 1136 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 1088 - i32.const 6 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - memory.size - i32.const 16 - i32.shl - i32.const 18028 - i32.sub - i32.const 1 - i32.shr_u - global.set $~lib/rt/itcms/threshold - i32.const 1332 - i32.const 1328 - i32.store - i32.const 1336 - i32.const 1328 - i32.store - i32.const 1328 - global.set $~lib/rt/itcms/pinSpace - i32.const 1364 - i32.const 1360 - i32.store - i32.const 1368 - i32.const 1360 - i32.store - i32.const 1360 - global.set $~lib/rt/itcms/toSpace - i32.const 1508 - i32.const 1504 - i32.store - i32.const 1512 - i32.const 1504 - i32.store - i32.const 1504 - global.set $~lib/rt/itcms/fromSpace - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 1644 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.store - local.get $0 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - global.set $nonnullable/y - global.get $~lib/memory/__stack_pointer - local.tee $0 - global.get $nonnullable/y - i32.store - local.get $0 - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - return - end - i32.const 18048 - i32.const 18096 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable ) ) diff --git a/tests/compiler/nonnullable.ts b/tests/compiler/nonnullable.ts index 6470eed77e..4e9ee8cded 100644 --- a/tests/compiler/nonnullable.ts +++ b/tests/compiler/nonnullable.ts @@ -1,31 +1,13 @@ +type nullableString = string | null;; assert(nameof>() == nameof()); - +assert(nameof>() == nameof()); assert(nameof>() == nameof()); -function takesGeneric(t: T): void { - if (!isNullable() || t != null){ - // @ts-ignore - if (isDefined(t.call)){ - t.call(); - } - } -} - -function callsGeneric(t: T): void { - if (t != null) { - takesGeneric>(t); // Would be nice to have a `notNull` here - } +function assertNonNull(): void { + assert(!isNullable(), "T cannot be null"); } -class Tee { - call(): void { - let x: i8 = 0; - } -} - -let y: Tee | null = new Tee(); - -callsGeneric(y); \ No newline at end of file +assertNonNull>(); diff --git a/tests/compiler/nonnullable.untouched.wat b/tests/compiler/nonnullable.untouched.wat index ce2a7ca74a..5b9bbf2eaf 100644 --- a/tests/compiler/nonnullable.untouched.wat +++ b/tests/compiler/nonnullable.untouched.wat @@ -1,45 +1,19 @@ (module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_i32 (func (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/fromSpace (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 $nonnullable/y (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 576)) - (global $~lib/memory/__data_end i32 (i32.const 620)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17004)) - (global $~lib/memory/__heap_base i32 (i32.const 17004)) + (global $~lib/memory/__data_end i32 (i32.const 204)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16588)) + (global $~lib/memory/__heap_base i32 (i32.const 16588)) (memory $0 1) (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00u\003\002\00\00\00\00\00\00\00") - (data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00n\00o\00n\00n\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s\00") - (data (i32.const 92) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 172) "<\00\00\00\00\00\00\00\00\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\00\00\00\00") - (data (i32.const 236) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 304) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 336) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 364) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00") - (data (i32.const 428) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00") - (data (i32.const 480) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 508) "<\00\00\00\00\00\00\00\00\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 576) "\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\02A\00\00\00\00\00\00 \00\00\00\00\00\00\00") + (data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00N\00o\00n\00N\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s\00") + (data (i32.const 92) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g\00") + (data (i32.const 124) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) (elem $0 (i32.const 1)) (export "memory" (memory $0)) @@ -201,2577 +175,107 @@ call $~lib/util/string/compareImpl i32.eqz ) - (func $~lib/rt/itcms/Object#set:nextWithColor (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/rt/itcms/Object#set:prev (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=8 - ) - (func $~lib/rt/itcms/initLazy (param $0 i32) (result i32) - local.get $0 - local.get $0 - call $~lib/rt/itcms/Object#set:nextWithColor - local.get $0 - local.get $0 - call $~lib/rt/itcms/Object#set:prev - local.get $0 - ) - (func $~lib/rt/itcms/Object#get:next (param $0 i32) (result i32) - local.get $0 - i32.load offset=4 - i32.const 3 - i32.const -1 - i32.xor - i32.and - ) - (func $~lib/rt/itcms/Object#get:color (param $0 i32) (result i32) - local.get $0 - i32.load offset=4 - i32.const 3 - i32.and - ) - (func $~lib/rt/itcms/visitRoots (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - call $~lib/rt/__visit_globals - global.get $~lib/rt/itcms/pinSpace - local.set $1 - local.get $1 - call $~lib/rt/itcms/Object#get:next - local.set $2 - loop $while-continue|0 - local.get $2 - local.get $1 - i32.ne - local.set $3 - local.get $3 - if - i32.const 1 - drop - local.get $2 - call $~lib/rt/itcms/Object#get:color - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 256 - i32.const 159 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.const 20 - i32.add - local.get $0 - call $~lib/rt/__visit_members - local.get $2 - call $~lib/rt/itcms/Object#get:next - local.set $2 - br $while-continue|0 - end - end - ) - (func $~lib/rt/itcms/Object#set:color (param $0 i32) (param $1 i32) - local.get $0 - local.get $0 - i32.load offset=4 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $1 - i32.or - call $~lib/rt/itcms/Object#set:nextWithColor + (func $NonNullable/assertNonNull<~lib/string/String> + i32.const 0 + i32.eqz + drop ) - (func $~lib/rt/itcms/Object#set:next (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - local.get $0 - i32.load offset=4 - i32.const 3 - i32.and - i32.or - call $~lib/rt/itcms/Object#set:nextWithColor + (func $~start + call $start:NonNullable ) - (func $~lib/rt/itcms/Object#unlink (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - call $~lib/rt/itcms/Object#get:next - local.set $1 - local.get $1 - i32.const 0 - i32.eq + (func $~stack_check + global.get $~lib/memory/__stack_pointer + global.get $~lib/memory/__data_end + i32.lt_s if + i32.const 16608 + i32.const 16656 + i32.const 1 i32.const 1 - drop - local.get $0 - i32.load offset=8 - i32.const 0 - i32.eq - if (result i32) - local.get $0 - global.get $~lib/memory/__heap_base - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 256 - i32.const 127 - i32.const 18 - call $~lib/builtins/abort - unreachable - end - return - end - local.get $0 - i32.load offset=8 - local.set $2 - i32.const 1 - drop - local.get $2 - i32.eqz - if - i32.const 0 - i32.const 256 - i32.const 131 - i32.const 16 call $~lib/builtins/abort unreachable end - local.get $1 - local.get $2 - call $~lib/rt/itcms/Object#set:prev - local.get $2 - local.get $1 - call $~lib/rt/itcms/Object#set:next ) - (func $~lib/rt/__typeinfo (param $0 i32) (result i32) - (local $1 i32) - global.get $~lib/rt/__rtti_base - local.set $1 - local.get $0 - local.get $1 - i32.load - i32.gt_u - if - i32.const 384 - i32.const 448 - i32.const 22 - i32.const 28 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 4 - i32.add - local.get $0 + (func $start:NonNullable + (local $0 i32) + global.get $~lib/memory/__stack_pointer i32.const 8 - i32.mul - i32.add - i32.load - ) - (func $~lib/rt/itcms/Object#get:isPointerfree (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.load offset=12 - local.set $1 - local.get $1 - i32.const 1 - i32.le_u - if (result i32) - i32.const 1 - else - local.get $1 - call $~lib/rt/__typeinfo - i32.const 32 - i32.and - i32.const 0 - i32.ne - end - ) - (func $~lib/rt/itcms/Object#linkTo (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - local.get $1 - i32.load offset=8 - local.set $3 - local.get $0 - local.get $1 - local.get $2 - i32.or - call $~lib/rt/itcms/Object#set:nextWithColor - local.get $0 - local.get $3 - call $~lib/rt/itcms/Object#set:prev - local.get $3 - local.get $0 - call $~lib/rt/itcms/Object#set:next - local.get $1 - local.get $0 - call $~lib/rt/itcms/Object#set:prev - ) - (func $~lib/rt/itcms/Object#makeGray (param $0 i32) - (local $1 i32) - local.get $0 - global.get $~lib/rt/itcms/iter - i32.eq - if - local.get $0 - i32.load offset=8 - local.tee $1 - i32.eqz - if (result i32) - i32.const 0 - i32.const 256 - i32.const 147 - i32.const 30 - call $~lib/builtins/abort - unreachable - else - local.get $1 - end - global.set $~lib/rt/itcms/iter - end + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + i32.const 32 + local.set $0 + global.get $~lib/memory/__stack_pointer local.get $0 - call $~lib/rt/itcms/Object#unlink + i32.store local.get $0 - global.get $~lib/rt/itcms/toSpace + i32.const 32 + local.set $0 + global.get $~lib/memory/__stack_pointer local.get $0 - call $~lib/rt/itcms/Object#get:isPointerfree - if (result i32) - global.get $~lib/rt/itcms/white - i32.eqz - else - i32.const 2 - end - call $~lib/rt/itcms/Object#linkTo - ) - (func $~lib/rt/itcms/__visit (param $0 i32) (param $1 i32) - (local $2 i32) + i32.store offset=4 local.get $0 + call $~lib/string/String.__eq i32.eqz if - return - end - local.get $0 - i32.const 20 - i32.sub - local.set $2 - i32.const 0 - drop - local.get $2 - call $~lib/rt/itcms/Object#get:color - global.get $~lib/rt/itcms/white - i32.eq - if - local.get $2 - call $~lib/rt/itcms/Object#makeGray - global.get $~lib/rt/itcms/visitCount + i32.const 0 + i32.const 64 + i32.const 5 i32.const 1 - i32.add - global.set $~lib/rt/itcms/visitCount + call $~lib/builtins/abort + unreachable end - ) - (func $~lib/rt/itcms/visitStack (param $0 i32) - (local $1 i32) - (local $2 i32) + i32.const 112 + local.set $0 global.get $~lib/memory/__stack_pointer - local.set $1 - loop $while-continue|0 - local.get $1 - global.get $~lib/memory/__heap_base - i32.lt_u - local.set $2 - local.get $2 - if - local.get $1 - i32.load - local.get $0 - call $~lib/rt/itcms/__visit - local.get $1 - i32.const 4 - i32.add - local.set $1 - br $while-continue|0 - end - end - ) - (func $~lib/rt/itcms/Object#get:size (param $0 i32) (result i32) - i32.const 4 - local.get $0 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - ) - (func $~lib/rt/tlsf/Root#set:flMap (param $0 i32) (param $1 i32) local.get $0 - local.get $1 i32.store - ) - (func $~lib/rt/common/BLOCK#set:mmInfo (param $0 i32) (param $1 i32) local.get $0 - local.get $1 - i32.store - ) - (func $~lib/rt/tlsf/Block#set:prev (param $0 i32) (param $1 i32) + i32.const 112 + local.set $0 + global.get $~lib/memory/__stack_pointer local.get $0 - local.get $1 i32.store offset=4 - ) - (func $~lib/rt/tlsf/Block#set:next (param $0 i32) (param $1 i32) local.get $0 - local.get $1 - i32.store offset=8 - ) - (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 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 528 - i32.const 268 - i32.const 14 + i32.const 64 + i32.const 6 + i32.const 1 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 12 - i32.ge_u + i32.const 144 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 + i32.const 144 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + local.get $0 + call $~lib/string/String.__eq i32.eqz if i32.const 0 - i32.const 528 - i32.const 270 - 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 - local.get $3 - local.tee $6 - i32.const 1073741820 - local.tee $7 - local.get $6 - local.get $7 - i32.lt_u - select - local.set $6 - i32.const 31 - local.get $6 - i32.clz - i32.sub - local.set $4 - local.get $6 - 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 64 + i32.const 7 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 528 - i32.const 284 - i32.const 14 call $~lib/builtins/abort unreachable end - local.get $1 - i32.load offset=4 - local.set $8 - local.get $1 - i32.load offset=8 - local.set $9 - local.get $8 - if - local.get $8 - local.get $9 - call $~lib/rt/tlsf/Block#set:next - end - local.get $9 - if - local.get $9 - local.get $8 - call $~lib/rt/tlsf/Block#set:prev - end - local.get $1 - local.get $0 - local.set $10 - local.get $4 - local.set $6 - local.get $5 - local.set $7 - local.get $10 - local.get $6 - i32.const 4 - i32.shl - local.get $7 - 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 $6 - local.get $9 - local.set $7 - local.get $11 - local.get $10 - i32.const 4 - i32.shl - local.get $6 - i32.add - i32.const 2 - i32.shl - i32.add - local.get $7 - i32.store offset=96 - local.get $9 - i32.eqz - if - local.get $0 - local.set $6 - local.get $4 - local.set $7 - local.get $6 - local.get $7 - i32.const 2 - i32.shl - i32.add - i32.load offset=4 - local.set $6 - local.get $0 - local.set $7 - local.get $4 - local.set $11 - local.get $6 - i32.const 1 - local.get $5 - i32.shl - i32.const -1 - i32.xor - i32.and - local.tee $6 - local.set $10 - local.get $7 - local.get $11 - i32.const 2 - i32.shl - i32.add - local.get $10 - i32.store offset=4 - local.get $6 - 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 - call $~lib/rt/tlsf/Root#set:flMap - 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 528 - i32.const 201 - 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 528 - i32.const 203 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.set $3 - local.get $3 - i32.const 4 - 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 $0 - local.get $4 - call $~lib/rt/tlsf/removeBlock - local.get $1 - local.get $2 - i32.const 4 - i32.add - local.get $5 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.tee $2 - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $1 - local.set $3 - local.get $3 - i32.const 4 - 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 - end - local.get $2 - i32.const 2 - i32.and - if - local.get $1 - local.set $3 - local.get $3 - i32.const 4 - i32.sub - i32.load - local.set $3 - local.get $3 - i32.load - local.set $6 - i32.const 1 - drop - local.get $6 - i32.const 1 - i32.and - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 221 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $3 - call $~lib/rt/tlsf/removeBlock - local.get $3 - local.set $1 - local.get $1 - local.get $6 - i32.const 4 - i32.add - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.add - local.tee $2 - call $~lib/rt/common/BLOCK#set:mmInfo - end - local.get $4 - local.get $5 - i32.const 2 - i32.or - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $2 - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.set $7 - i32.const 1 - drop - local.get $7 - i32.const 12 - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 233 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - i32.const 1 - drop - local.get $1 - i32.const 4 - i32.add - local.get $7 - i32.add - local.get $4 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 234 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $4 - i32.const 4 - i32.sub - local.get $1 - i32.store - local.get $7 - i32.const 256 - i32.lt_u - if - i32.const 0 - local.set $8 - local.get $7 - i32.const 4 - i32.shr_u - local.set $9 - else - local.get $7 - local.tee $3 - i32.const 1073741820 - local.tee $6 - local.get $3 - local.get $6 - i32.lt_u - select - local.set $3 - i32.const 31 - local.get $3 - i32.clz - i32.sub - local.set $8 - local.get $3 - local.get $8 - i32.const 4 - i32.sub - i32.shr_u - i32.const 1 - i32.const 4 - i32.shl - i32.xor - local.set $9 - local.get $8 - i32.const 8 - i32.const 1 - i32.sub - i32.sub - local.set $8 - end - i32.const 1 - drop - local.get $8 - i32.const 23 - i32.lt_u - if (result i32) - local.get $9 - i32.const 16 - i32.lt_u - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 251 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $10 - local.get $8 - local.set $3 - local.get $9 - local.set $6 - local.get $10 - 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 - call $~lib/rt/tlsf/Block#set:prev - local.get $1 - local.get $11 - call $~lib/rt/tlsf/Block#set:next - local.get $11 - if - local.get $11 - local.get $1 - call $~lib/rt/tlsf/Block#set:prev - end - local.get $0 - local.set $12 - local.get $8 - local.set $10 - local.get $9 - local.set $3 - local.get $1 - local.set $6 - local.get $12 - local.get $10 - 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 $8 - i32.shl - i32.or - call $~lib/rt/tlsf/Root#set:flMap - local.get $0 - local.set $13 - local.get $8 - local.set $12 - local.get $0 - local.set $3 - local.get $8 - 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 $9 - i32.shl - i32.or - local.set $10 - local.get $13 - local.get $12 - i32.const 2 - i32.shl - i32.add - local.get $10 - 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 - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 377 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 4 - i32.add - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - i32.const 4 - i32.sub - local.set $1 - local.get $2 - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $2 - 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 4 - i32.add - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 384 - 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 528 - i32.const 397 - 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 4 - i32.const 12 - i32.add - i32.const 4 - i32.add - i32.lt_u - if - i32.const 0 - return - end - local.get $6 - i32.const 2 - i32.const 4 - i32.mul - 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 - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $8 - i32.const 0 - call $~lib/rt/tlsf/Block#set:prev - local.get $8 - i32.const 0 - call $~lib/rt/tlsf/Block#set:next - local.get $1 - i32.const 4 - i32.add - local.get $7 - i32.add - local.set $4 - local.get $4 - i32.const 0 - i32.const 2 - i32.or - call $~lib/rt/common/BLOCK#set:mmInfo - 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/initialize - (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) - (local $12 i32) - i32.const 0 - drop - global.get $~lib/memory/__heap_base - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - local.set $0 - memory.size - local.set $1 - local.get $0 - 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 $2 - local.get $2 - local.get $1 - i32.gt_s - if (result i32) - local.get $2 - local.get $1 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else - i32.const 0 - end - if - unreachable - end - local.get $0 - local.set $3 - local.get $3 - i32.const 0 - call $~lib/rt/tlsf/Root#set:flMap - local.get $3 - 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 $3 - 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 $3 - 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 $0 - i32.const 1572 - i32.add - local.set $12 - i32.const 0 - drop - local.get $3 - local.get $12 - memory.size - i32.const 16 - i32.shl - call $~lib/rt/tlsf/addMemory - drop - local.get $3 - global.set $~lib/rt/tlsf/ROOT - ) - (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 4 - 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 - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 559 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - ) - (func $~lib/rt/tlsf/freeBlock (param $0 i32) (param $1 i32) - i32.const 0 - drop - local.get $1 - local.get $1 - i32.load - i32.const 1 - i32.or - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $0 - local.get $1 - call $~lib/rt/tlsf/insertBlock - ) - (func $~lib/rt/tlsf/__free (param $0 i32) - local.get $0 - global.get $~lib/memory/__heap_base - i32.lt_u - if - return - end - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/checkUsedBlock - call $~lib/rt/tlsf/freeBlock - ) - (func $~lib/rt/itcms/free (param $0 i32) - local.get $0 - global.get $~lib/memory/__heap_base - i32.lt_u - if - local.get $0 - i32.const 0 - call $~lib/rt/itcms/Object#set:nextWithColor - local.get $0 - i32.const 0 - call $~lib/rt/itcms/Object#set:prev - else - global.get $~lib/rt/itcms/total - local.get $0 - call $~lib/rt/itcms/Object#get:size - i32.sub - global.set $~lib/rt/itcms/total - i32.const 0 - drop - local.get $0 - i32.const 4 - i32.add - call $~lib/rt/tlsf/__free - end - ) - (func $~lib/rt/itcms/step (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - block $break|0 - block $case2|0 - block $case1|0 - block $case0|0 - global.get $~lib/rt/itcms/state - local.set $1 - local.get $1 - i32.const 0 - i32.eq - br_if $case0|0 - local.get $1 - i32.const 1 - i32.eq - br_if $case1|0 - local.get $1 - i32.const 2 - i32.eq - br_if $case2|0 - br $break|0 - end - i32.const 1 - global.set $~lib/rt/itcms/state - i32.const 0 - global.set $~lib/rt/itcms/visitCount - i32.const 0 - call $~lib/rt/itcms/visitRoots - global.get $~lib/rt/itcms/toSpace - global.set $~lib/rt/itcms/iter - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.mul - return - end - global.get $~lib/rt/itcms/white - i32.eqz - local.set $1 - global.get $~lib/rt/itcms/iter - call $~lib/rt/itcms/Object#get:next - local.set $0 - loop $while-continue|1 - local.get $0 - global.get $~lib/rt/itcms/toSpace - i32.ne - local.set $2 - local.get $2 - if - local.get $0 - global.set $~lib/rt/itcms/iter - local.get $0 - call $~lib/rt/itcms/Object#get:color - local.get $1 - i32.ne - if - local.get $0 - local.get $1 - call $~lib/rt/itcms/Object#set:color - i32.const 0 - global.set $~lib/rt/itcms/visitCount - local.get $0 - i32.const 20 - i32.add - i32.const 0 - call $~lib/rt/__visit_members - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.mul - return - end - local.get $0 - call $~lib/rt/itcms/Object#get:next - local.set $0 - br $while-continue|1 - end - end - i32.const 0 - global.set $~lib/rt/itcms/visitCount - i32.const 0 - call $~lib/rt/itcms/visitRoots - global.get $~lib/rt/itcms/iter - call $~lib/rt/itcms/Object#get:next - local.set $0 - local.get $0 - global.get $~lib/rt/itcms/toSpace - i32.eq - if - i32.const 0 - call $~lib/rt/itcms/visitStack - global.get $~lib/rt/itcms/iter - call $~lib/rt/itcms/Object#get:next - local.set $0 - loop $while-continue|2 - local.get $0 - global.get $~lib/rt/itcms/toSpace - i32.ne - local.set $2 - local.get $2 - if - local.get $0 - call $~lib/rt/itcms/Object#get:color - local.get $1 - i32.ne - if - local.get $0 - local.get $1 - call $~lib/rt/itcms/Object#set:color - local.get $0 - i32.const 20 - i32.add - i32.const 0 - call $~lib/rt/__visit_members - end - local.get $0 - call $~lib/rt/itcms/Object#get:next - local.set $0 - br $while-continue|2 - end - end - global.get $~lib/rt/itcms/fromSpace - local.set $2 - global.get $~lib/rt/itcms/toSpace - global.set $~lib/rt/itcms/fromSpace - local.get $2 - global.set $~lib/rt/itcms/toSpace - local.get $1 - global.set $~lib/rt/itcms/white - local.get $2 - call $~lib/rt/itcms/Object#get:next - global.set $~lib/rt/itcms/iter - i32.const 2 - global.set $~lib/rt/itcms/state - end - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.mul - return - end - global.get $~lib/rt/itcms/iter - local.set $0 - local.get $0 - global.get $~lib/rt/itcms/toSpace - i32.ne - if - local.get $0 - call $~lib/rt/itcms/Object#get:next - global.set $~lib/rt/itcms/iter - i32.const 1 - drop - local.get $0 - call $~lib/rt/itcms/Object#get:color - global.get $~lib/rt/itcms/white - i32.eqz - i32.eq - i32.eqz - if - i32.const 0 - i32.const 256 - i32.const 228 - i32.const 20 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/itcms/free - i32.const 10 - return - end - global.get $~lib/rt/itcms/toSpace - global.get $~lib/rt/itcms/toSpace - call $~lib/rt/itcms/Object#set:nextWithColor - global.get $~lib/rt/itcms/toSpace - global.get $~lib/rt/itcms/toSpace - call $~lib/rt/itcms/Object#set:prev - i32.const 0 - global.set $~lib/rt/itcms/state - br $break|0 - end - i32.const 0 - ) - (func $~lib/rt/itcms/interrupt - (local $0 i32) - (local $1 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 1024 - i32.const 200 - i32.mul - i32.const 100 - i32.div_u - local.set $0 - loop $do-continue|0 - local.get $0 - call $~lib/rt/itcms/step - i32.sub - local.set $0 - global.get $~lib/rt/itcms/state - i32.const 0 - i32.eq - if - i32.const 0 - drop - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i64.const 200 - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - i32.const 0 - drop - return - end - local.get $0 - i32.const 0 - i32.gt_s - local.set $1 - local.get $1 - br_if $do-continue|0 - end - i32.const 0 - drop - global.get $~lib/rt/itcms/total - i32.const 1024 - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.sub - i32.const 1024 - i32.lt_u - i32.mul - i32.add - global.set $~lib/rt/itcms/threshold - i32.const 0 - drop - ) - (func $~lib/rt/tlsf/computeSize (param $0 i32) (result i32) - local.get $0 - i32.const 12 - i32.le_u - if (result i32) - i32.const 12 - else - local.get $0 - i32.const 4 - i32.add - i32.const 15 - i32.add - i32.const 15 - i32.const -1 - i32.xor - i32.and - i32.const 4 - i32.sub - end - ) - (func $~lib/rt/tlsf/prepareSize (param $0 i32) (result i32) - local.get $0 - i32.const 1073741820 - i32.gt_u - if - i32.const 192 - i32.const 528 - i32.const 458 - i32.const 29 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/rt/tlsf/computeSize - ) - (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 536870910 - 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 528 - i32.const 330 - 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 528 - i32.const 343 - 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 536870910 - 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 4 - local.get $2 - i32.const 16 - i32.shl - i32.const 4 - 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 4 - i32.add - i32.const 15 - i32.and - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 357 - 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 4 - i32.const 12 - i32.add - i32.ge_u - if - local.get $1 - local.get $2 - local.get $3 - i32.const 2 - i32.and - i32.or - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $1 - i32.const 4 - i32.add - local.get $2 - i32.add - local.set $5 - local.get $5 - local.get $4 - i32.const 4 - i32.sub - i32.const 1 - i32.or - call $~lib/rt/common/BLOCK#set:mmInfo - 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 - call $~lib/rt/common/BLOCK#set:mmInfo - local.get $1 - local.set $5 - local.get $5 - i32.const 4 - 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 4 - 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 - call $~lib/rt/common/BLOCK#set:mmInfo - end - ) - (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $1 - call $~lib/rt/tlsf/prepareSize - local.set $2 - local.get $0 - local.get $2 - call $~lib/rt/tlsf/searchBlock - local.set $3 - local.get $3 - i32.eqz - if - local.get $0 - local.get $2 - call $~lib/rt/tlsf/growMemory - local.get $0 - local.get $2 - call $~lib/rt/tlsf/searchBlock - local.set $3 - i32.const 1 - drop - local.get $3 - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 496 - i32.const 16 - call $~lib/builtins/abort - unreachable - end - end - i32.const 1 - drop - local.get $3 - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - local.get $2 - i32.ge_u - i32.eqz - if - i32.const 0 - i32.const 528 - i32.const 498 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $3 - call $~lib/rt/tlsf/removeBlock - local.get $0 - local.get $3 - local.get $2 - call $~lib/rt/tlsf/prepareBlock - i32.const 0 - drop - local.get $3 - ) - (func $~lib/rt/tlsf/__alloc (param $0 i32) (result i32) - global.get $~lib/rt/tlsf/ROOT - i32.eqz - if - call $~lib/rt/tlsf/initialize - end - global.get $~lib/rt/tlsf/ROOT - local.get $0 - call $~lib/rt/tlsf/allocateBlock - i32.const 4 - i32.add - ) - (func $~lib/rt/itcms/Object#set:rtId (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=12 - ) - (func $~lib/rt/itcms/Object#set:rtSize (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=16 - ) - (func $~lib/memory/memory.fill (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) - block $~lib/util/memory/memset|inlined.0 - local.get $0 - local.set $5 - local.get $1 - local.set $4 - local.get $2 - local.set $3 - i32.const 0 - i32.const 1 - i32.gt_s - drop - local.get $3 - i32.eqz - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $5 - local.get $3 - i32.add - local.set $6 - local.get $5 - local.get $4 - i32.store8 - local.get $6 - i32.const 1 - i32.sub - local.get $4 - i32.store8 - local.get $3 - i32.const 2 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $5 - local.get $4 - i32.store8 offset=1 - local.get $5 - local.get $4 - i32.store8 offset=2 - local.get $6 - i32.const 2 - i32.sub - local.get $4 - i32.store8 - local.get $6 - i32.const 3 - i32.sub - local.get $4 - i32.store8 - local.get $3 - i32.const 6 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $5 - local.get $4 - i32.store8 offset=3 - local.get $6 - i32.const 4 - i32.sub - local.get $4 - i32.store8 - local.get $3 - i32.const 8 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - i32.const 0 - local.get $5 - i32.sub - i32.const 3 - i32.and - local.set $7 - local.get $5 - local.get $7 - i32.add - local.set $5 - local.get $3 - local.get $7 - i32.sub - local.set $3 - local.get $3 - i32.const -4 - i32.and - local.set $3 - i32.const -1 - i32.const 255 - i32.div_u - local.get $4 - i32.const 255 - i32.and - i32.mul - local.set $8 - local.get $5 - local.get $3 - i32.add - local.set $6 - local.get $5 - local.get $8 - i32.store - local.get $6 - i32.const 4 - i32.sub - local.get $8 - i32.store - local.get $3 - i32.const 8 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $5 - local.get $8 - i32.store offset=4 - local.get $5 - local.get $8 - i32.store offset=8 - local.get $6 - i32.const 12 - i32.sub - local.get $8 - i32.store - local.get $6 - i32.const 8 - i32.sub - local.get $8 - i32.store - local.get $3 - i32.const 24 - i32.le_u - if - br $~lib/util/memory/memset|inlined.0 - end - local.get $5 - local.get $8 - i32.store offset=12 - local.get $5 - local.get $8 - i32.store offset=16 - local.get $5 - local.get $8 - i32.store offset=20 - local.get $5 - local.get $8 - i32.store offset=24 - local.get $6 - i32.const 28 - i32.sub - local.get $8 - i32.store - local.get $6 - i32.const 24 - i32.sub - local.get $8 - i32.store - local.get $6 - i32.const 20 - i32.sub - local.get $8 - i32.store - local.get $6 - i32.const 16 - i32.sub - local.get $8 - i32.store - i32.const 24 - local.get $5 - i32.const 4 - i32.and - i32.add - local.set $7 - local.get $5 - local.get $7 - i32.add - local.set $5 - local.get $3 - local.get $7 - i32.sub - local.set $3 - local.get $8 - i64.extend_i32_u - local.get $8 - i64.extend_i32_u - i64.const 32 - i64.shl - i64.or - local.set $9 - loop $while-continue|0 - local.get $3 - i32.const 32 - i32.ge_u - local.set $10 - local.get $10 - if - local.get $5 - local.get $9 - i64.store - local.get $5 - local.get $9 - i64.store offset=8 - local.get $5 - local.get $9 - i64.store offset=16 - local.get $5 - local.get $9 - i64.store offset=24 - local.get $3 - i32.const 32 - i32.sub - local.set $3 - local.get $5 - i32.const 32 - i32.add - local.set $5 - br $while-continue|0 - end - end - end - ) - (func $~lib/rt/itcms/__new (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.const 1073741804 - i32.ge_u - if - i32.const 192 - i32.const 256 - i32.const 260 - i32.const 31 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/itcms/total - global.get $~lib/rt/itcms/threshold - i32.ge_u - if - call $~lib/rt/itcms/interrupt - end - i32.const 16 - local.get $0 - i32.add - call $~lib/rt/tlsf/__alloc - i32.const 4 - i32.sub - local.set $2 - local.get $2 - local.get $1 - call $~lib/rt/itcms/Object#set:rtId - local.get $2 - local.get $0 - call $~lib/rt/itcms/Object#set:rtSize - local.get $2 - global.get $~lib/rt/itcms/fromSpace - global.get $~lib/rt/itcms/white - call $~lib/rt/itcms/Object#linkTo - global.get $~lib/rt/itcms/total - local.get $2 - call $~lib/rt/itcms/Object#get:size - i32.add - global.set $~lib/rt/itcms/total - local.get $2 - i32.const 20 - i32.add - local.set $3 - local.get $3 - i32.const 0 - local.get $0 - call $~lib/memory/memory.fill - local.get $3 - ) - (func $nonnullable/Tee#call (param $0 i32) - (local $1 i32) - i32.const 0 - local.set $1 - ) - (func $nonnullable/takesGeneric (param $0 i32) - i32.const 0 - i32.eqz - if (result i32) - i32.const 1 - else - local.get $0 - i32.const 0 - i32.ne - end - drop - i32.const 1 - drop - local.get $0 - call $nonnullable/Tee#call - ) - (func $nonnullable/callsGeneric (param $0 i32) - local.get $0 - i32.const 0 - i32.ne - if - local.get $0 - call $nonnullable/takesGeneric - end - ) - (func $~lib/rt/__visit_globals (param $0 i32) - (local $1 i32) - global.get $nonnullable/y - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - i32.const 384 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 192 - local.get $0 - call $~lib/rt/itcms/__visit - ) - (func $~lib/arraybuffer/ArrayBufferView~visit (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/itcms/__visit - end - ) - (func $~lib/array/Array<~lib/string/String>#__visit (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - i32.const 1 - drop - local.get $0 - i32.load offset=4 - local.set $2 - local.get $2 - local.get $0 - i32.load offset=12 - i32.const 2 - i32.shl - i32.add - local.set $3 - loop $while-continue|0 - local.get $2 - local.get $3 - i32.lt_u - local.set $4 - local.get $4 - if - local.get $2 - i32.load - local.set $5 - local.get $5 - if - local.get $5 - local.get $1 - call $~lib/rt/itcms/__visit - end - local.get $2 - i32.const 4 - i32.add - local.set $2 - br $while-continue|0 - end - end - local.get $0 - i32.load - local.get $1 - call $~lib/rt/itcms/__visit - ) - (func $~lib/array/Array<~lib/string/String>~visit (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/string/String>#__visit - ) - (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) - block $invalid - block $nonnullable/Tee - block $~lib/array/Array<~lib/string/String> - block $~lib/arraybuffer/ArrayBufferView - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $~lib/array/Array<~lib/string/String> $nonnullable/Tee $invalid - end - return - end - return - end - local.get $0 - local.get $1 - call $~lib/arraybuffer/ArrayBufferView~visit - return - end - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/string/String>~visit - return - end - return - end - unreachable - ) - (func $~start - call $start:nonnullable - ) - (func $~stack_check - global.get $~lib/memory/__stack_pointer - global.get $~lib/memory/__data_end - i32.lt_s - if - i32.const 17024 - i32.const 17072 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - ) - (func $start:nonnullable - (local $0 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - i32.const 32 - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - i32.const 32 - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 64 - i32.const 4 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - i32.const 112 - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - i32.const 112 - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 64 - i32.const 6 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - memory.size - i32.const 16 - i32.shl - global.get $~lib/memory/__heap_base - i32.sub - i32.const 1 - i32.shr_u - global.set $~lib/rt/itcms/threshold - i32.const 304 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/pinSpace - i32.const 336 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/toSpace - i32.const 480 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/fromSpace - i32.const 0 - call $nonnullable/Tee#constructor - global.set $nonnullable/y - global.get $nonnullable/y - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - call $nonnullable/callsGeneric + call $NonNullable/assertNonNull<~lib/string/String> global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer ) - (func $nonnullable/Tee#constructor (param $0 i32) (result i32) - (local $1 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 4 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - local.set $1 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - ) ) From 9198cf007f4419467a797b87d3a6804ce2f2b667 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 1 Jun 2021 11:42:53 -0400 Subject: [PATCH 06/19] fix: remove old test generated by accident with --create --- tests/compiler/nonnullable.ts | 4 +--- tests/compiler/nullable.json | 8 -------- tests/compiler/nullable.ts | 7 ------- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 tests/compiler/nullable.json delete mode 100644 tests/compiler/nullable.ts diff --git a/tests/compiler/nonnullable.ts b/tests/compiler/nonnullable.ts index 4e9ee8cded..3bf4c90edf 100644 --- a/tests/compiler/nonnullable.ts +++ b/tests/compiler/nonnullable.ts @@ -1,6 +1,4 @@ - - -type nullableString = string | null;; +type nullableString = string | null; assert(nameof>() == nameof()); assert(nameof>() == nameof()); diff --git a/tests/compiler/nullable.json b/tests/compiler/nullable.json deleted file mode 100644 index d3a557bf65..0000000000 --- a/tests/compiler/nullable.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "asc_flags": [ - ], - "stderr": [ - "TS2322: Type 'nullable/Example | null' is not assignable to type 'nullable/Example'.", - "EOF" - ] -} \ No newline at end of file diff --git a/tests/compiler/nullable.ts b/tests/compiler/nullable.ts deleted file mode 100644 index 3cffa68d67..0000000000 --- a/tests/compiler/nullable.ts +++ /dev/null @@ -1,7 +0,0 @@ -class Example {} - -function notNullable(a: Example): void {} - -notNullable(null); - -ERROR("EOF"); From e9e85aebf652570a61c1f26155ad20dce5bbcf4c Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 1 Jun 2021 12:12:08 -0400 Subject: [PATCH 07/19] fix: remove old artifacts from git cache --- ...{nonnullable.optimized.wat => NonNullable.optimized.wat} | 6 +++--- ...{nonnullable.untouched.wat => NonNullable.untouched.wat} | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) rename tests/compiler/{nonnullable.optimized.wat => NonNullable.optimized.wat} (99%) rename tests/compiler/{nonnullable.untouched.wat => NonNullable.untouched.wat} (99%) diff --git a/tests/compiler/nonnullable.optimized.wat b/tests/compiler/NonNullable.optimized.wat similarity index 99% rename from tests/compiler/nonnullable.optimized.wat rename to tests/compiler/NonNullable.optimized.wat index 67c129759a..349698e3d1 100644 --- a/tests/compiler/nonnullable.optimized.wat +++ b/tests/compiler/NonNullable.optimized.wat @@ -168,7 +168,7 @@ if i32.const 0 i32.const 1088 - i32.const 5 + i32.const 3 i32.const 1 call $~lib/builtins/abort unreachable @@ -187,7 +187,7 @@ if i32.const 0 i32.const 1088 - i32.const 6 + i32.const 4 i32.const 1 call $~lib/builtins/abort unreachable @@ -206,7 +206,7 @@ if i32.const 0 i32.const 1088 - i32.const 7 + i32.const 5 i32.const 1 call $~lib/builtins/abort unreachable diff --git a/tests/compiler/nonnullable.untouched.wat b/tests/compiler/NonNullable.untouched.wat similarity index 99% rename from tests/compiler/nonnullable.untouched.wat rename to tests/compiler/NonNullable.untouched.wat index 5b9bbf2eaf..791e42a471 100644 --- a/tests/compiler/nonnullable.untouched.wat +++ b/tests/compiler/NonNullable.untouched.wat @@ -223,7 +223,7 @@ if i32.const 0 i32.const 64 - i32.const 5 + i32.const 3 i32.const 1 call $~lib/builtins/abort unreachable @@ -245,7 +245,7 @@ if i32.const 0 i32.const 64 - i32.const 6 + i32.const 4 i32.const 1 call $~lib/builtins/abort unreachable @@ -267,7 +267,7 @@ if i32.const 0 i32.const 64 - i32.const 7 + i32.const 5 i32.const 1 call $~lib/builtins/abort unreachable From 78960913b0bdb3142bd3f39ae52301301a8ca380 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 1 Jun 2021 12:15:49 -0400 Subject: [PATCH 08/19] fix: rename again --- tests/compiler/NonNullable.optimized.wat | 37 +++++-- .../{nonnullable.ts => NonNullable.ts} | 7 +- tests/compiler/NonNullable.untouched.wat | 100 +++++++++++++----- 3 files changed, 109 insertions(+), 35 deletions(-) rename tests/compiler/{nonnullable.ts => NonNullable.ts} (66%) diff --git a/tests/compiler/NonNullable.optimized.wat b/tests/compiler/NonNullable.optimized.wat index 349698e3d1..0bb3af66b0 100644 --- a/tests/compiler/NonNullable.optimized.wat +++ b/tests/compiler/NonNullable.optimized.wat @@ -3,7 +3,7 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_none (func)) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17612)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17708)) (memory $0 1) (data (i32.const 1036) "\1c") (data (i32.const 1048) "\01\00\00\00\06\00\00\00u\003\002") @@ -13,6 +13,10 @@ (data (i32.const 1128) "\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g") (data (i32.const 1148) "L") (data (i32.const 1160) "\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>") + (data (i32.const 1228) "\1c") + (data (i32.const 1240) "\01\00\00\00\02\00\00\00z") + (data (i32.const 1260) "<") + (data (i32.const 1272) "\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l") (export "memory" (memory $0)) (start $~start) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) @@ -137,15 +141,15 @@ (func $~start (local $0 i32) global.get $~lib/memory/__stack_pointer - i32.const 8 + i32.const 12 i32.sub global.set $~lib/memory/__stack_pointer global.get $~lib/memory/__stack_pointer - i32.const 1228 + i32.const 1324 i32.lt_s if - i32.const 17632 - i32.const 17680 + i32.const 17728 + i32.const 17776 i32.const 1 i32.const 1 call $~lib/builtins/abort @@ -156,6 +160,9 @@ i64.const 0 i64.store local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 i32.const 1056 i32.store local.get $0 @@ -212,7 +219,25 @@ unreachable end global.get $~lib/memory/__stack_pointer - i32.const 8 + local.tee $0 + i32.const 1248 + i32.store offset=8 + local.get $0 + i32.const 1248 + i32.store + i32.const 1248 + i32.const 0 + call $~lib/string/String.__eq + if + i32.const 0 + i32.const 1088 + i32.const 9 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 12 i32.add global.set $~lib/memory/__stack_pointer ) diff --git a/tests/compiler/nonnullable.ts b/tests/compiler/NonNullable.ts similarity index 66% rename from tests/compiler/nonnullable.ts rename to tests/compiler/NonNullable.ts index 3bf4c90edf..a6ddba3369 100644 --- a/tests/compiler/nonnullable.ts +++ b/tests/compiler/NonNullable.ts @@ -4,8 +4,11 @@ assert(nameof>() == nameof()); assert(nameof>() == nameof()); assert(nameof>() == nameof()); -function assertNonNull(): void { +function assertNonNull(t: T): void { assert(!isNullable(), "T cannot be null"); + assert(t != null); } -assertNonNull>(); +let z: nullableString = "z"; + +assertNonNull>(z!); diff --git a/tests/compiler/NonNullable.untouched.wat b/tests/compiler/NonNullable.untouched.wat index 791e42a471..c20e423c2d 100644 --- a/tests/compiler/NonNullable.untouched.wat +++ b/tests/compiler/NonNullable.untouched.wat @@ -1,19 +1,23 @@ (module (type $none_=>_none (func)) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_=>_none (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/memory/__data_end i32 (i32.const 204)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16588)) - (global $~lib/memory/__heap_base i32 (i32.const 16588)) + (global $NonNullable/z (mut i32) (i32.const 224)) + (global $~lib/memory/__data_end i32 (i32.const 300)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16684)) + (global $~lib/memory/__heap_base i32 (i32.const 16684)) (memory $0 1) (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00u\003\002\00\00\00\00\00\00\00") (data (i32.const 44) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00N\00o\00n\00N\00u\00l\00l\00a\00b\00l\00e\00.\00t\00s\00") (data (i32.const 92) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00S\00t\00r\00i\00n\00g\00") (data (i32.const 124) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\002\00\00\00A\00r\00r\00a\00y\00<\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00/\00S\00t\00r\00i\00n\00g\00>\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 204) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00z\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 236) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00u\00n\00e\00x\00p\00e\00c\00t\00e\00d\00 \00n\00u\00l\00l\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) (elem $0 (i32.const 1)) (export "memory" (memory $0)) @@ -175,10 +179,28 @@ call $~lib/util/string/compareImpl i32.eqz ) - (func $NonNullable/assertNonNull<~lib/string/String> + (func $~lib/string/String.__ne (param $0 i32) (param $1 i32) (result i32) + local.get $0 + local.get $1 + call $~lib/string/String.__eq + i32.eqz + ) + (func $NonNullable/assertNonNull<~lib/string/String> (param $0 i32) i32.const 0 i32.eqz drop + local.get $0 + i32.const 0 + call $~lib/string/String.__ne + i32.eqz + if + i32.const 0 + i32.const 64 + i32.const 9 + i32.const 3 + call $~lib/builtins/abort + unreachable + end ) (func $~start call $start:NonNullable @@ -188,8 +210,8 @@ global.get $~lib/memory/__data_end i32.lt_s if - i32.const 16608 - i32.const 16656 + i32.const 16704 + i32.const 16752 i32.const 1 i32.const 1 call $~lib/builtins/abort @@ -198,26 +220,30 @@ ) (func $start:NonNullable (local $0 i32) + (local $1 i32) global.get $~lib/memory/__stack_pointer - i32.const 8 + i32.const 12 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer i64.const 0 i64.store + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store offset=8 i32.const 32 - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store - local.get $0 + local.get $1 i32.const 32 - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store offset=4 - local.get $0 + local.get $1 call $~lib/string/String.__eq i32.eqz if @@ -229,17 +255,17 @@ unreachable end i32.const 112 - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store - local.get $0 + local.get $1 i32.const 112 - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store offset=4 - local.get $0 + local.get $1 call $~lib/string/String.__eq i32.eqz if @@ -251,17 +277,17 @@ unreachable end i32.const 144 - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store - local.get $0 + local.get $1 i32.const 144 - local.set $0 + local.set $1 global.get $~lib/memory/__stack_pointer - local.get $0 + local.get $1 i32.store offset=4 - local.get $0 + local.get $1 call $~lib/string/String.__eq i32.eqz if @@ -272,9 +298,29 @@ call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer + global.get $NonNullable/z + local.tee $0 + i32.store offset=8 + local.get $0 + if (result i32) + local.get $0 + else + i32.const 256 + i32.const 64 + i32.const 14 + i32.const 44 + call $~lib/builtins/abort + unreachable + end + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store + local.get $1 call $NonNullable/assertNonNull<~lib/string/String> global.get $~lib/memory/__stack_pointer - i32.const 8 + i32.const 12 i32.add global.set $~lib/memory/__stack_pointer ) From 706894c6a4285c76303095462f1df1556f34eb04 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 1 Jun 2021 12:32:07 -0400 Subject: [PATCH 09/19] feat: add second function to show casting works --- tests/compiler/NonNullable.optimized.wat | 211 +++++++++++++---------- tests/compiler/NonNullable.ts | 7 + tests/compiler/NonNullable.untouched.wat | 50 +++++- 3 files changed, 178 insertions(+), 90 deletions(-) diff --git a/tests/compiler/NonNullable.optimized.wat b/tests/compiler/NonNullable.optimized.wat index 0bb3af66b0..ddbf4dbb62 100644 --- a/tests/compiler/NonNullable.optimized.wat +++ b/tests/compiler/NonNullable.optimized.wat @@ -144,10 +144,124 @@ i32.const 12 i32.sub global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 1324 - i32.lt_s - if + block $folding-inner1 + block $folding-inner0 + global.get $~lib/memory/__stack_pointer + i32.const 1324 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i64.const 0 + i64.store + local.get $0 + i32.const 0 + i32.store offset=8 + local.get $0 + i32.const 1056 + i32.store + local.get $0 + i32.const 1056 + i32.store offset=4 + i32.const 1056 + i32.const 1056 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 3 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 1136 + i32.store + local.get $0 + i32.const 1136 + i32.store offset=4 + i32.const 1136 + i32.const 1136 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 4 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 1168 + i32.store + local.get $0 + i32.const 1168 + i32.store offset=4 + i32.const 1168 + i32.const 1168 + call $~lib/string/String.__eq + i32.eqz + if + i32.const 0 + i32.const 1088 + i32.const 5 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 1248 + i32.store offset=8 + local.get $0 + i32.const 1248 + i32.store + i32.const 1248 + i32.const 0 + call $~lib/string/String.__eq + br_if $folding-inner1 + global.get $~lib/memory/__stack_pointer + local.tee $0 + i32.const 1248 + i32.store + local.get $0 + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 1324 + i32.lt_s + br_if $folding-inner0 + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + i32.const 1248 + i32.const 0 + call $~lib/string/String.__eq + i32.eqz + if + global.get $~lib/memory/__stack_pointer + i32.const 1248 + i32.store + i32.const 1248 + i32.const 0 + call $~lib/string/String.__eq + br_if $folding-inner1 + end + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 12 + i32.add + global.set $~lib/memory/__stack_pointer + return + end i32.const 17728 i32.const 17776 i32.const 1 @@ -155,90 +269,11 @@ call $~lib/builtins/abort unreachable end - global.get $~lib/memory/__stack_pointer - local.tee $0 - i64.const 0 - i64.store - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 1056 - i32.store - local.get $0 - i32.const 1056 - i32.store offset=4 - i32.const 1056 - i32.const 1056 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 1088 - i32.const 3 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 1136 - i32.store - local.get $0 - i32.const 1136 - i32.store offset=4 - i32.const 1136 - i32.const 1136 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 1088 - i32.const 4 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 1168 - i32.store - local.get $0 - i32.const 1168 - i32.store offset=4 - i32.const 1168 - i32.const 1168 - call $~lib/string/String.__eq - i32.eqz - if - i32.const 0 - i32.const 1088 - i32.const 5 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 1248 - i32.store offset=8 - local.get $0 - i32.const 1248 - i32.store - i32.const 1248 i32.const 0 - call $~lib/string/String.__eq - if - i32.const 0 - i32.const 1088 - i32.const 9 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.add - global.set $~lib/memory/__stack_pointer + i32.const 1088 + i32.const 9 + i32.const 3 + call $~lib/builtins/abort + unreachable ) ) diff --git a/tests/compiler/NonNullable.ts b/tests/compiler/NonNullable.ts index a6ddba3369..a4725ebfa4 100644 --- a/tests/compiler/NonNullable.ts +++ b/tests/compiler/NonNullable.ts @@ -9,6 +9,13 @@ function assertNonNull(t: T): void { assert(t != null); } +function safetyCheck(t: A): void { + if (t != null) { + assertNonNull(>t); + } +} + let z: nullableString = "z"; assertNonNull>(z!); +safetyCheck(z); \ No newline at end of file diff --git a/tests/compiler/NonNullable.untouched.wat b/tests/compiler/NonNullable.untouched.wat index c20e423c2d..1e0f367793 100644 --- a/tests/compiler/NonNullable.untouched.wat +++ b/tests/compiler/NonNullable.untouched.wat @@ -1,10 +1,10 @@ (module (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $i32_=>_none (func (param i32))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_=>_none (func (param i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0)) (global $NonNullable/z (mut i32) (i32.const 224)) @@ -218,6 +218,45 @@ unreachable end ) + (func $NonNullable/safetyCheck<~lib/string/String|null> (param $0 i32) + (local $1 i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + i32.const 0 + call $~lib/string/String.__ne + if + local.get $0 + local.tee $1 + if (result i32) + local.get $1 + else + i32.const 256 + i32.const 64 + i32.const 14 + i32.const 35 + call $~lib/builtins/abort + unreachable + end + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + call $NonNullable/assertNonNull<~lib/string/String> + end + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + ) (func $start:NonNullable (local $0 i32) (local $1 i32) @@ -308,7 +347,7 @@ else i32.const 256 i32.const 64 - i32.const 14 + i32.const 20 i32.const 44 call $~lib/builtins/abort unreachable @@ -319,6 +358,13 @@ i32.store local.get $1 call $NonNullable/assertNonNull<~lib/string/String> + global.get $NonNullable/z + local.set $1 + global.get $~lib/memory/__stack_pointer + local.get $1 + i32.store + local.get $1 + call $NonNullable/safetyCheck<~lib/string/String|null> global.get $~lib/memory/__stack_pointer i32.const 12 i32.add From a8138920329a2ef90fea55cc89b51fbf7b1ac1e7 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 09:50:58 -0400 Subject: [PATCH 10/19] Update src/resolver.ts Co-authored-by: Max Graey --- src/resolver.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resolver.ts b/src/resolver.ts index 1a75197714..e87d5da37e 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -3346,7 +3346,8 @@ export class Resolver extends DiagnosticEmitter { /** The type to resolve. */ node: NamedTypeNode, /** How to proceed with eventual diagnostics. */ - reportMode: ReportMode = ReportMode.REPORT): TypeNode | null { + reportMode: ReportMode = ReportMode.REPORT + ): TypeNode | null { var typeArgumentNodes = node.typeArguments; if (!typeArgumentNodes || typeArgumentNodes.length != 1) { let numTypeArguments = 0; From f9790bb51333fad4935914f6d854e1dc3a8ffb84 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 10:28:04 -0400 Subject: [PATCH 11/19] nit: refactor ensureOneTypeArgument --- src/resolver.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/resolver.ts b/src/resolver.ts index e87d5da37e..5a9d63e46c 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -3347,11 +3347,10 @@ export class Resolver extends DiagnosticEmitter { node: NamedTypeNode, /** How to proceed with eventual diagnostics. */ reportMode: ReportMode = ReportMode.REPORT - ): TypeNode | null { + ): TypeNode | null { var typeArgumentNodes = node.typeArguments; - if (!typeArgumentNodes || typeArgumentNodes.length != 1) { - let numTypeArguments = 0; - if (typeArgumentNodes) numTypeArguments = typeArgumentNodes.length; + const numTypeArguments = typeArgumentNodes ? typeArgumentNodes.length : 0; + if (typeArgumentNodes == null || numTypeArguments != 0) { if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Expected_0_type_arguments_but_got_1, From c6a709230bec42acd28e4005cf2b167d3909f44c Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 12:11:54 -0400 Subject: [PATCH 12/19] fix: make `!= 1` --- src/resolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolver.ts b/src/resolver.ts index 5a9d63e46c..d83b54f77a 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -3350,7 +3350,7 @@ export class Resolver extends DiagnosticEmitter { ): TypeNode | null { var typeArgumentNodes = node.typeArguments; const numTypeArguments = typeArgumentNodes ? typeArgumentNodes.length : 0; - if (typeArgumentNodes == null || numTypeArguments != 0) { + if (!typeArgumentNodes || numTypeArguments != 1) { if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Expected_0_type_arguments_but_got_1, From a5cb27b195e4098c3bc8f8a9d123698be685db07 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 12:28:24 -0400 Subject: [PATCH 13/19] fix: remove one check --- src/resolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolver.ts b/src/resolver.ts index d83b54f77a..5570cd9503 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -3349,8 +3349,8 @@ export class Resolver extends DiagnosticEmitter { reportMode: ReportMode = ReportMode.REPORT ): TypeNode | null { var typeArgumentNodes = node.typeArguments; - const numTypeArguments = typeArgumentNodes ? typeArgumentNodes.length : 0; - if (!typeArgumentNodes || numTypeArguments != 1) { + let numTypeArguments = 0; + if (!typeArgumentNodes || (numTypeArguments = typeArgumentNodes.length) != 1) { if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Expected_0_type_arguments_but_got_1, From 44d7b675b561cc046198cdf32818c2294ab91c01 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 12:42:18 -0400 Subject: [PATCH 14/19] chore: rename internally `nonnull` and make an alias for `NonNullable` --- src/common.ts | 2 +- src/program.ts | 6 +++--- src/resolver.ts | 2 +- std/assembly/compat.ts | 1 + std/assembly/index.d.ts | 2 ++ tests/compiler/NonNullable.ts | 2 +- tests/compiler/NonNullable.untouched.wat | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/common.ts b/src/common.ts index 9b8d4146f2..54ccd742b2 100644 --- a/src/common.ts +++ b/src/common.ts @@ -147,7 +147,7 @@ export namespace CommonNames { export const indexof = "indexof"; export const valueof = "valueof"; export const returnof = "returnof"; - export const notnullable = "NonNullable"; + export const nonnull = "nonnull"; // aliases export const null_ = "null"; export const true_ = "true"; diff --git a/src/program.ts b/src/program.ts index 72ac30390b..e614a0da5f 100644 --- a/src/program.ts +++ b/src/program.ts @@ -992,10 +992,10 @@ export class Program extends DiagnosticEmitter { this.makeNativeTypeDeclaration(CommonNames.returnof, CommonFlags.EXPORT | CommonFlags.GENERIC), DecoratorFlags.BUILTIN )); - this.nativeFile.add(CommonNames.notnullable, new TypeDefinition( - CommonNames.notnullable, + this.nativeFile.add(CommonNames.nonnull, new TypeDefinition( + CommonNames.nonnull, this.nativeFile, - this.makeNativeTypeDeclaration(CommonNames.notnullable, CommonFlags.EXPORT | CommonFlags.GENERIC), + this.makeNativeTypeDeclaration(CommonNames.nonnull, CommonFlags.EXPORT | CommonFlags.GENERIC), DecoratorFlags.BUILTIN )); diff --git a/src/resolver.ts b/src/resolver.ts index 5570cd9503..1e858c4cff 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -296,7 +296,7 @@ export class Resolver extends DiagnosticEmitter { if (text == CommonNames.indexof) return this.resolveBuiltinIndexofType(node, ctxElement, ctxTypes, reportMode); if (text == CommonNames.valueof) return this.resolveBuiltinValueofType(node, ctxElement, ctxTypes, reportMode); if (text == CommonNames.returnof) return this.resolveBuiltinReturnTypeType(node, ctxElement, ctxTypes, reportMode); - if (text == CommonNames.notnullable) return this.resolveBuiltinNotNullableType(node, ctxElement, ctxTypes, reportMode); + if (text == CommonNames.nonnull) return this.resolveBuiltinNotNullableType(node, ctxElement, ctxTypes, reportMode); } // Resolve normally diff --git a/std/assembly/compat.ts b/std/assembly/compat.ts index 372e4aa04f..669bb16fb1 100644 --- a/std/assembly/compat.ts +++ b/std/assembly/compat.ts @@ -1 +1,2 @@ export type ReturnType = returnof; +export type NonNullable = nonnull; diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 8286f10ee6..862b9914c3 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1316,6 +1316,8 @@ declare type ReturnType any> = T extends (...args: a declare type returnof any> = ReturnType; /** A special type that excludes null and undefined from T. */ declare type NonNullable = T extends null | undefined ? never : T; +/** A special type that excludes null and undefined from T. */ +declare type nonnull = NonNullable; /** Pseudo-class representing the backing class of integer types. */ declare class _Integer { diff --git a/tests/compiler/NonNullable.ts b/tests/compiler/NonNullable.ts index a4725ebfa4..ef9755281e 100644 --- a/tests/compiler/NonNullable.ts +++ b/tests/compiler/NonNullable.ts @@ -17,5 +17,5 @@ function safetyCheck(t: A): void { let z: nullableString = "z"; -assertNonNull>(z!); +assertNonNull>(z!); safetyCheck(z); \ No newline at end of file diff --git a/tests/compiler/NonNullable.untouched.wat b/tests/compiler/NonNullable.untouched.wat index 1e0f367793..3ab9ac7798 100644 --- a/tests/compiler/NonNullable.untouched.wat +++ b/tests/compiler/NonNullable.untouched.wat @@ -348,7 +348,7 @@ i32.const 256 i32.const 64 i32.const 20 - i32.const 44 + i32.const 40 call $~lib/builtins/abort unreachable end From 3142241237a2aa179f67b3b04ffeaf748d84f4c4 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 13:39:25 -0400 Subject: [PATCH 15/19] fix: revert package-lock.json --- package-lock.json | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index aca11ffc3c..6ef6778674 100644 --- a/package-lock.json +++ b/package-lock.json @@ -712,7 +712,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -788,8 +787,7 @@ "node_modules/buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" }, "node_modules/callsites": { "version": "3.1.0", @@ -1815,8 +1813,7 @@ "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, "node_modules/merge-stream": { "version": "2.0.0", @@ -1891,14 +1888,12 @@ "node_modules/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "node_modules/mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, "dependencies": { "minimist": "^1.2.5" }, @@ -2435,7 +2430,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -2444,7 +2438,6 @@ "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -2654,7 +2647,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.2.0.tgz", "integrity": "sha512-ZNT+OEGfUNVMGkpIaDJJ44Zq3Yr0bkU/ugN1PHbU+/01Z7UV1fsELRiTx1KuQNvQ1A3pGh3y25iYF6jXgxV21A==", - "dev": true, "dependencies": { "arrify": "^1.0.0", "buffer-from": "^1.1.0", @@ -2676,7 +2668,6 @@ "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true, "engines": { "node": ">=0.3.1" } @@ -2950,7 +2941,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", - "dev": true, "engines": { "node": ">=4" } @@ -3492,8 +3482,7 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, "astral-regex": { "version": "2.0.0", @@ -3547,8 +3536,7 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" }, "callsites": { "version": "3.1.0", @@ -4337,8 +4325,7 @@ "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, "merge-stream": { "version": "2.0.0", @@ -4395,14 +4382,12 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, "requires": { "minimist": "^1.2.5" } @@ -4769,14 +4754,12 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -4933,7 +4916,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.2.0.tgz", "integrity": "sha512-ZNT+OEGfUNVMGkpIaDJJ44Zq3Yr0bkU/ugN1PHbU+/01Z7UV1fsELRiTx1KuQNvQ1A3pGh3y25iYF6jXgxV21A==", - "dev": true, "requires": { "arrify": "^1.0.0", "buffer-from": "^1.1.0", @@ -4948,8 +4930,7 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" } } }, @@ -5138,8 +5119,7 @@ "yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", - "dev": true + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=" }, "yocto-queue": { "version": "0.1.0", From 510d52e9b98dc411a58088975cad5309b38468ee Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 13:44:21 -0400 Subject: [PATCH 16/19] fix: revert nullable test --- tests/compiler/nullable.json | 8 ++++++++ tests/compiler/nullable.ts | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/compiler/nullable.json create mode 100644 tests/compiler/nullable.ts diff --git a/tests/compiler/nullable.json b/tests/compiler/nullable.json new file mode 100644 index 0000000000..d3a557bf65 --- /dev/null +++ b/tests/compiler/nullable.json @@ -0,0 +1,8 @@ +{ + "asc_flags": [ + ], + "stderr": [ + "TS2322: Type 'nullable/Example | null' is not assignable to type 'nullable/Example'.", + "EOF" + ] +} \ No newline at end of file diff --git a/tests/compiler/nullable.ts b/tests/compiler/nullable.ts new file mode 100644 index 0000000000..1d21c6f9ab --- /dev/null +++ b/tests/compiler/nullable.ts @@ -0,0 +1,7 @@ +class Example {} + +function notNullable(a: Example): void {} + +notNullable(null); + +ERROR("EOF"); \ No newline at end of file From a715785e659b9c3d329cf56d0f9f300cf07b2257 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 13:45:39 -0400 Subject: [PATCH 17/19] fix: add line at end of file --- tests/compiler/nullable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/nullable.ts b/tests/compiler/nullable.ts index 1d21c6f9ab..3cffa68d67 100644 --- a/tests/compiler/nullable.ts +++ b/tests/compiler/nullable.ts @@ -4,4 +4,4 @@ function notNullable(a: Example): void {} notNullable(null); -ERROR("EOF"); \ No newline at end of file +ERROR("EOF"); From 44113734ad344ccc62f1129655246753f80bf9da Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Jun 2021 13:59:59 -0400 Subject: [PATCH 18/19] fix: add new line to test file --- tests/compiler/NonNullable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiler/NonNullable.ts b/tests/compiler/NonNullable.ts index ef9755281e..b06ddec286 100644 --- a/tests/compiler/NonNullable.ts +++ b/tests/compiler/NonNullable.ts @@ -18,4 +18,4 @@ function safetyCheck(t: A): void { let z: nullableString = "z"; assertNonNull>(z!); -safetyCheck(z); \ No newline at end of file +safetyCheck(z); From a44bf8f7aecdd6505c81a152ce48dd4c05ab24d1 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 8 Jun 2021 12:09:18 -0400 Subject: [PATCH 19/19] chore: add newline to end of files that are missing one --- tests/asconfig/complicated/asconfig.json | 2 +- tests/asconfig/extends/expected.json | 2 +- tests/asconfig/target/expected.json | 2 +- tests/compiler/ReturnType.json | 2 +- tests/compiler/abi.json | 2 +- tests/compiler/asc-constants.json | 2 +- tests/compiler/assert-nonnull.json | 2 +- tests/compiler/assert.json | 2 +- tests/compiler/basic-nullable.json | 2 +- tests/compiler/binary.json | 2 +- tests/compiler/bool.json | 2 +- tests/compiler/builtins.json | 2 +- tests/compiler/call-inferred.json | 2 +- tests/compiler/call-optional.json | 2 +- tests/compiler/call-super.json | 2 +- tests/compiler/class-abstract-errors.json | 2 +- tests/compiler/class-extends.json | 2 +- tests/compiler/class-implements.json | 2 +- tests/compiler/class-overloading.json | 2 +- tests/compiler/class-static-function.json | 2 +- tests/compiler/class.json | 2 +- tests/compiler/closure.json | 2 +- tests/compiler/comma.json | 2 +- tests/compiler/constant-assign.json | 2 +- tests/compiler/constructor.json | 2 +- tests/compiler/continue.json | 2 +- tests/compiler/converge.json | 2 +- tests/compiler/declare.json | 2 +- tests/compiler/do.json | 2 +- tests/compiler/duplicate-identifier.json | 2 +- tests/compiler/empty-use.json | 2 +- tests/compiler/enum.json | 2 +- tests/compiler/export-default.json | 2 +- tests/compiler/export-generic.json | 2 +- tests/compiler/export.json | 2 +- tests/compiler/exportimport-table.json | 2 +- tests/compiler/exports-lazy.json | 2 +- tests/compiler/exports.json | 2 +- tests/compiler/exportstar-rereexport.json | 2 +- tests/compiler/exportstar.json | 2 +- tests/compiler/extends-recursive.json | 2 +- tests/compiler/extends-self.json | 2 +- tests/compiler/external.json | 2 +- tests/compiler/features/reference-types.json | 2 +- tests/compiler/field-initialization-errors.json | 2 +- tests/compiler/field-initialization-warnings.json | 2 +- tests/compiler/field-initialization.json | 2 +- tests/compiler/for.json | 2 +- tests/compiler/function-call.json | 2 +- tests/compiler/function-types.json | 2 +- tests/compiler/getter-call.json | 2 +- tests/compiler/getter-setter.json | 2 +- tests/compiler/heap.json | 2 +- tests/compiler/if.json | 2 +- tests/compiler/implicit-getter-setter.json | 2 +- tests/compiler/import.json | 2 +- tests/compiler/indexof-valueof.json | 2 +- tests/compiler/infer-array.json | 2 +- tests/compiler/infer-generic.json | 2 +- tests/compiler/infer-type.json | 2 +- tests/compiler/inlining-blocklocals.json | 2 +- tests/compiler/inlining-recursive.json | 2 +- tests/compiler/inlining.json | 2 +- tests/compiler/instanceof-class.json | 2 +- tests/compiler/instanceof.json | 2 +- tests/compiler/issues/1095.json | 2 +- tests/compiler/issues/1225.json | 2 +- tests/compiler/limits.json | 2 +- tests/compiler/literals.json | 2 +- tests/compiler/logical.json | 2 +- tests/compiler/loop-flow.json | 2 +- tests/compiler/loop-wrap.json | 2 +- tests/compiler/managed-cast.json | 2 +- tests/compiler/many-locals.json | 2 +- tests/compiler/memcpy.json | 2 +- tests/compiler/memmove.json | 2 +- tests/compiler/memory.json | 2 +- tests/compiler/memorybase.json | 2 +- tests/compiler/memset.json | 2 +- tests/compiler/merge.json | 2 +- tests/compiler/named-export-default.json | 2 +- tests/compiler/named-import-default.json | 2 +- tests/compiler/namespace.json | 2 +- tests/compiler/new.json | 2 +- tests/compiler/nonnullable.json | 2 +- tests/compiler/nullable.json | 2 +- tests/compiler/number.json | 2 +- tests/compiler/object-literal.json | 2 +- tests/compiler/optional-typeparameters.json | 2 +- tests/compiler/overflow.json | 2 +- tests/compiler/portable-conversions.json | 2 +- tests/compiler/possibly-null.json | 2 +- tests/compiler/recursive.json | 2 +- tests/compiler/reexport.json | 2 +- tests/compiler/rereexport.json | 2 +- tests/compiler/resolve-binary.json | 2 +- tests/compiler/resolve-elementaccess.json | 2 +- tests/compiler/resolve-function-expression.json | 2 +- tests/compiler/resolve-nested.json | 2 +- tests/compiler/resolve-new.json | 2 +- tests/compiler/resolve-propertyaccess.json | 2 +- tests/compiler/resolve-unary.json | 2 +- tests/compiler/retain-i32.json | 2 +- tests/compiler/rt/finalize.json | 2 +- tests/compiler/rt/flags.json | 2 +- tests/compiler/rt/ids.json | 2 +- tests/compiler/rt/instanceof.json | 2 +- tests/compiler/rt/runtime-incremental-export.json | 2 +- tests/compiler/rt/runtime-incremental.json | 2 +- tests/compiler/rt/runtime-minimal-export.json | 2 +- tests/compiler/rt/runtime-minimal.json | 2 +- tests/compiler/rt/runtime-stub-export.json | 2 +- tests/compiler/rt/runtime-stub.json | 2 +- tests/compiler/scoped.json | 2 +- tests/compiler/static-this.json | 2 +- tests/compiler/std/array-access.json | 2 +- tests/compiler/std/array-literal.json | 2 +- tests/compiler/std/array.json | 2 +- tests/compiler/std/arraybuffer.json | 2 +- tests/compiler/std/dataview.json | 2 +- tests/compiler/std/date.json | 2 +- tests/compiler/std/hash.json | 2 +- tests/compiler/std/map.json | 2 +- tests/compiler/std/math.json | 2 +- tests/compiler/std/mod.json | 2 +- tests/compiler/std/new.json | 2 +- tests/compiler/std/operator-overloading.json | 2 +- tests/compiler/std/pointer.json | 2 +- tests/compiler/std/polyfills.json | 2 +- tests/compiler/std/set.json | 2 +- tests/compiler/std/simd.json | 2 +- tests/compiler/std/static-array.json | 2 +- tests/compiler/std/staticarray.json | 2 +- tests/compiler/std/string-casemapping.js | 2 +- tests/compiler/std/string-casemapping.json | 2 +- tests/compiler/std/string-encoding.json | 2 +- tests/compiler/std/string.json | 2 +- tests/compiler/std/symbol.json | 2 +- tests/compiler/std/trace.json | 2 +- tests/compiler/std/typedarray.json | 2 +- tests/compiler/super-inline.json | 2 +- tests/compiler/switch.json | 2 +- tests/compiler/tablebase.json | 2 +- tests/compiler/templateliteral.json | 2 +- tests/compiler/ternary.json | 2 +- tests/compiler/throw.json | 2 +- tests/compiler/typealias.json | 2 +- tests/compiler/typeof.json | 2 +- tests/compiler/unary.json | 2 +- tests/compiler/unify-local-flags.json | 2 +- tests/compiler/unsafe.json | 2 +- tests/compiler/variable-access-in-initializer.json | 2 +- tests/compiler/void.json | 2 +- tests/compiler/wasi/snapshot_preview1.json | 2 +- tests/compiler/while.json | 2 +- tests/extension/package.json | 2 +- tests/packages/packages/a/assembly/index.ts | 2 +- .../packages/c/node_modules/b/node_modules/a/assembly/index.ts | 2 +- tests/packages/packages/d/node_modules/as/package.json | 2 +- 159 files changed, 159 insertions(+), 159 deletions(-) diff --git a/tests/asconfig/complicated/asconfig.json b/tests/asconfig/complicated/asconfig.json index 7f5d4c8c57..0a8e106ebc 100644 --- a/tests/asconfig/complicated/asconfig.json +++ b/tests/asconfig/complicated/asconfig.json @@ -14,4 +14,4 @@ "initialMemory": 100, "enable": ["simd"] } -} \ No newline at end of file +} diff --git a/tests/asconfig/extends/expected.json b/tests/asconfig/extends/expected.json index c212ff76d8..1c542ae118 100644 --- a/tests/asconfig/extends/expected.json +++ b/tests/asconfig/extends/expected.json @@ -5,4 +5,4 @@ "noAssert": true, "enable": ["simd"] } -} \ No newline at end of file +} diff --git a/tests/asconfig/target/expected.json b/tests/asconfig/target/expected.json index 9608315490..1a9e43f149 100644 --- a/tests/asconfig/target/expected.json +++ b/tests/asconfig/target/expected.json @@ -3,4 +3,4 @@ "exportRuntime": false, "noAssert": true } -} \ No newline at end of file +} diff --git a/tests/compiler/ReturnType.json b/tests/compiler/ReturnType.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/ReturnType.json +++ b/tests/compiler/ReturnType.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/abi.json b/tests/compiler/abi.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/abi.json +++ b/tests/compiler/abi.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/asc-constants.json b/tests/compiler/asc-constants.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/asc-constants.json +++ b/tests/compiler/asc-constants.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/assert-nonnull.json b/tests/compiler/assert-nonnull.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/assert-nonnull.json +++ b/tests/compiler/assert-nonnull.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/assert.json b/tests/compiler/assert.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/assert.json +++ b/tests/compiler/assert.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/basic-nullable.json b/tests/compiler/basic-nullable.json index b44318af20..8a239581d5 100644 --- a/tests/compiler/basic-nullable.json +++ b/tests/compiler/basic-nullable.json @@ -5,4 +5,4 @@ "AS204: Type 'i32' cannot be nullable.", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/binary.json b/tests/compiler/binary.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/binary.json +++ b/tests/compiler/binary.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/bool.json b/tests/compiler/bool.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/bool.json +++ b/tests/compiler/bool.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/builtins.json b/tests/compiler/builtins.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/builtins.json +++ b/tests/compiler/builtins.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/call-inferred.json b/tests/compiler/call-inferred.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/call-inferred.json +++ b/tests/compiler/call-inferred.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/call-optional.json b/tests/compiler/call-optional.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/call-optional.json +++ b/tests/compiler/call-optional.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/call-super.json b/tests/compiler/call-super.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/call-super.json +++ b/tests/compiler/call-super.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/class-abstract-errors.json b/tests/compiler/class-abstract-errors.json index fffa589f5b..5482cd9174 100644 --- a/tests/compiler/class-abstract-errors.json +++ b/tests/compiler/class-abstract-errors.json @@ -7,4 +7,4 @@ "TS2515: Non-abstract class 'class-abstract-errors/Baz' does not implement inherited abstract member 'a'", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/class-extends.json b/tests/compiler/class-extends.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/class-extends.json +++ b/tests/compiler/class-extends.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/class-implements.json b/tests/compiler/class-implements.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/class-implements.json +++ b/tests/compiler/class-implements.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/class-overloading.json b/tests/compiler/class-overloading.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/class-overloading.json +++ b/tests/compiler/class-overloading.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/class-static-function.json b/tests/compiler/class-static-function.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/class-static-function.json +++ b/tests/compiler/class-static-function.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/class.json b/tests/compiler/class.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/class.json +++ b/tests/compiler/class.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/closure.json b/tests/compiler/closure.json index d4aa655329..75907cebe4 100644 --- a/tests/compiler/closure.json +++ b/tests/compiler/closure.json @@ -10,4 +10,4 @@ "$local0; // closure 3", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/comma.json b/tests/compiler/comma.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/comma.json +++ b/tests/compiler/comma.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/constant-assign.json b/tests/compiler/constant-assign.json index 93add47109..67ddc79096 100644 --- a/tests/compiler/constant-assign.json +++ b/tests/compiler/constant-assign.json @@ -9,4 +9,4 @@ "TS2540: Cannot assign to", "a = 2;", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/constructor.json b/tests/compiler/constructor.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/constructor.json +++ b/tests/compiler/constructor.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/continue.json b/tests/compiler/continue.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/continue.json +++ b/tests/compiler/continue.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/converge.json b/tests/compiler/converge.json index cde60dc56e..9208cfe9d6 100644 --- a/tests/compiler/converge.json +++ b/tests/compiler/converge.json @@ -2,4 +2,4 @@ "asc_flags": [ "--converge" ] -} \ No newline at end of file +} diff --git a/tests/compiler/declare.json b/tests/compiler/declare.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/declare.json +++ b/tests/compiler/declare.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/do.json b/tests/compiler/do.json index 5709811e4b..a3487fc1c7 100644 --- a/tests/compiler/do.json +++ b/tests/compiler/do.json @@ -1,3 +1,3 @@ { "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/duplicate-identifier.json b/tests/compiler/duplicate-identifier.json index 522a879cd9..a3f82cc818 100644 --- a/tests/compiler/duplicate-identifier.json +++ b/tests/compiler/duplicate-identifier.json @@ -10,4 +10,4 @@ "TS2300: Duplicate identifier 'f'", "let f: f32", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/empty-use.json b/tests/compiler/empty-use.json index f7ec67e6e9..29b0f194e5 100644 --- a/tests/compiler/empty-use.json +++ b/tests/compiler/empty-use.json @@ -6,4 +6,4 @@ "TS2304: Cannot find name 'Date'.", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/enum.json b/tests/compiler/enum.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/enum.json +++ b/tests/compiler/enum.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/export-default.json b/tests/compiler/export-default.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/export-default.json +++ b/tests/compiler/export-default.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/export-generic.json b/tests/compiler/export-generic.json index 98f5dfcd76..92e8dd2763 100644 --- a/tests/compiler/export-generic.json +++ b/tests/compiler/export-generic.json @@ -13,4 +13,4 @@ "AS232: Exported generic function or class has no concrete instances.", "export class TestNamespacedClass" ] -} \ No newline at end of file +} diff --git a/tests/compiler/export.json b/tests/compiler/export.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/export.json +++ b/tests/compiler/export.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/exportimport-table.json b/tests/compiler/exportimport-table.json index 673cf3c31c..ee90f77c52 100644 --- a/tests/compiler/exportimport-table.json +++ b/tests/compiler/exportimport-table.json @@ -3,4 +3,4 @@ "--importTable", "--exportTable" ] -} \ No newline at end of file +} diff --git a/tests/compiler/exports-lazy.json b/tests/compiler/exports-lazy.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/exports-lazy.json +++ b/tests/compiler/exports-lazy.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/exports.json b/tests/compiler/exports.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/exports.json +++ b/tests/compiler/exports.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/exportstar-rereexport.json b/tests/compiler/exportstar-rereexport.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/exportstar-rereexport.json +++ b/tests/compiler/exportstar-rereexport.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/exportstar.json b/tests/compiler/exportstar.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/exportstar.json +++ b/tests/compiler/exportstar.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/extends-recursive.json b/tests/compiler/extends-recursive.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/extends-recursive.json +++ b/tests/compiler/extends-recursive.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/extends-self.json b/tests/compiler/extends-self.json index a3cf85015e..839343b16a 100644 --- a/tests/compiler/extends-self.json +++ b/tests/compiler/extends-self.json @@ -5,4 +5,4 @@ "TS2506", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/external.json b/tests/compiler/external.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/external.json +++ b/tests/compiler/external.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/features/reference-types.json b/tests/compiler/features/reference-types.json index 93bb76dff8..8f72a8bff4 100644 --- a/tests/compiler/features/reference-types.json +++ b/tests/compiler/features/reference-types.json @@ -6,4 +6,4 @@ ], "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/field-initialization-errors.json b/tests/compiler/field-initialization-errors.json index 5eabd4e467..3769b587f1 100644 --- a/tests/compiler/field-initialization-errors.json +++ b/tests/compiler/field-initialization-errors.json @@ -16,4 +16,4 @@ "TS2564: Property 'field-initialization-errors/Inherit_Base.a' has no initializer", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/field-initialization-warnings.json b/tests/compiler/field-initialization-warnings.json index ccbf9265ff..b2fe2adfa8 100644 --- a/tests/compiler/field-initialization-warnings.json +++ b/tests/compiler/field-initialization-warnings.json @@ -6,4 +6,4 @@ "AS233: Property 'field-initialization-warnings/Ref_Ctor_Init.a' is always assigned", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/field-initialization.json b/tests/compiler/field-initialization.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/field-initialization.json +++ b/tests/compiler/field-initialization.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/for.json b/tests/compiler/for.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/for.json +++ b/tests/compiler/for.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/function-call.json b/tests/compiler/function-call.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/function-call.json +++ b/tests/compiler/function-call.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/function-types.json b/tests/compiler/function-types.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/function-types.json +++ b/tests/compiler/function-types.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/getter-call.json b/tests/compiler/getter-call.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/getter-call.json +++ b/tests/compiler/getter-call.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/getter-setter.json b/tests/compiler/getter-setter.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/getter-setter.json +++ b/tests/compiler/getter-setter.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/heap.json b/tests/compiler/heap.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/heap.json +++ b/tests/compiler/heap.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/if.json b/tests/compiler/if.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/if.json +++ b/tests/compiler/if.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/implicit-getter-setter.json b/tests/compiler/implicit-getter-setter.json index 7a73a41bfd..2c63c08510 100644 --- a/tests/compiler/implicit-getter-setter.json +++ b/tests/compiler/implicit-getter-setter.json @@ -1,2 +1,2 @@ { -} \ No newline at end of file +} diff --git a/tests/compiler/import.json b/tests/compiler/import.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/import.json +++ b/tests/compiler/import.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/indexof-valueof.json b/tests/compiler/indexof-valueof.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/indexof-valueof.json +++ b/tests/compiler/indexof-valueof.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/infer-array.json b/tests/compiler/infer-array.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/infer-array.json +++ b/tests/compiler/infer-array.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/infer-generic.json b/tests/compiler/infer-generic.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/infer-generic.json +++ b/tests/compiler/infer-generic.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/infer-type.json b/tests/compiler/infer-type.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/infer-type.json +++ b/tests/compiler/infer-type.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/inlining-blocklocals.json b/tests/compiler/inlining-blocklocals.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/inlining-blocklocals.json +++ b/tests/compiler/inlining-blocklocals.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/inlining-recursive.json b/tests/compiler/inlining-recursive.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/inlining-recursive.json +++ b/tests/compiler/inlining-recursive.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/inlining.json b/tests/compiler/inlining.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/inlining.json +++ b/tests/compiler/inlining.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/instanceof-class.json b/tests/compiler/instanceof-class.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/instanceof-class.json +++ b/tests/compiler/instanceof-class.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/instanceof.json b/tests/compiler/instanceof.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/instanceof.json +++ b/tests/compiler/instanceof.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/issues/1095.json b/tests/compiler/issues/1095.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/issues/1095.json +++ b/tests/compiler/issues/1095.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/issues/1225.json b/tests/compiler/issues/1225.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/issues/1225.json +++ b/tests/compiler/issues/1225.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/limits.json b/tests/compiler/limits.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/limits.json +++ b/tests/compiler/limits.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/literals.json b/tests/compiler/literals.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/literals.json +++ b/tests/compiler/literals.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/logical.json b/tests/compiler/logical.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/logical.json +++ b/tests/compiler/logical.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/loop-flow.json b/tests/compiler/loop-flow.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/loop-flow.json +++ b/tests/compiler/loop-flow.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/loop-wrap.json b/tests/compiler/loop-wrap.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/loop-wrap.json +++ b/tests/compiler/loop-wrap.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/managed-cast.json b/tests/compiler/managed-cast.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/managed-cast.json +++ b/tests/compiler/managed-cast.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/many-locals.json b/tests/compiler/many-locals.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/many-locals.json +++ b/tests/compiler/many-locals.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/memcpy.json b/tests/compiler/memcpy.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/memcpy.json +++ b/tests/compiler/memcpy.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/memmove.json b/tests/compiler/memmove.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/memmove.json +++ b/tests/compiler/memmove.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/memory.json b/tests/compiler/memory.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/memory.json +++ b/tests/compiler/memory.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/memorybase.json b/tests/compiler/memorybase.json index bf2639fb63..6349eac2ae 100644 --- a/tests/compiler/memorybase.json +++ b/tests/compiler/memorybase.json @@ -2,4 +2,4 @@ "asc_flags": [ "--memoryBase 1024" ] -} \ No newline at end of file +} diff --git a/tests/compiler/memset.json b/tests/compiler/memset.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/memset.json +++ b/tests/compiler/memset.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/merge.json b/tests/compiler/merge.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/merge.json +++ b/tests/compiler/merge.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/named-export-default.json b/tests/compiler/named-export-default.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/named-export-default.json +++ b/tests/compiler/named-export-default.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/named-import-default.json b/tests/compiler/named-import-default.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/named-import-default.json +++ b/tests/compiler/named-import-default.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/namespace.json b/tests/compiler/namespace.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/namespace.json +++ b/tests/compiler/namespace.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/new.json b/tests/compiler/new.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/new.json +++ b/tests/compiler/new.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/nonnullable.json b/tests/compiler/nonnullable.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/nonnullable.json +++ b/tests/compiler/nonnullable.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/nullable.json b/tests/compiler/nullable.json index d3a557bf65..fdef0a1a3b 100644 --- a/tests/compiler/nullable.json +++ b/tests/compiler/nullable.json @@ -5,4 +5,4 @@ "TS2322: Type 'nullable/Example | null' is not assignable to type 'nullable/Example'.", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/number.json b/tests/compiler/number.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/number.json +++ b/tests/compiler/number.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/object-literal.json b/tests/compiler/object-literal.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/object-literal.json +++ b/tests/compiler/object-literal.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/optional-typeparameters.json b/tests/compiler/optional-typeparameters.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/optional-typeparameters.json +++ b/tests/compiler/optional-typeparameters.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/overflow.json b/tests/compiler/overflow.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/overflow.json +++ b/tests/compiler/overflow.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/portable-conversions.json b/tests/compiler/portable-conversions.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/portable-conversions.json +++ b/tests/compiler/portable-conversions.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/possibly-null.json b/tests/compiler/possibly-null.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/possibly-null.json +++ b/tests/compiler/possibly-null.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/recursive.json b/tests/compiler/recursive.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/recursive.json +++ b/tests/compiler/recursive.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/reexport.json b/tests/compiler/reexport.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/reexport.json +++ b/tests/compiler/reexport.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/rereexport.json b/tests/compiler/rereexport.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/rereexport.json +++ b/tests/compiler/rereexport.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/resolve-binary.json b/tests/compiler/resolve-binary.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/resolve-binary.json +++ b/tests/compiler/resolve-binary.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/resolve-elementaccess.json b/tests/compiler/resolve-elementaccess.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/resolve-elementaccess.json +++ b/tests/compiler/resolve-elementaccess.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/resolve-function-expression.json b/tests/compiler/resolve-function-expression.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/resolve-function-expression.json +++ b/tests/compiler/resolve-function-expression.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/resolve-nested.json b/tests/compiler/resolve-nested.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/resolve-nested.json +++ b/tests/compiler/resolve-nested.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/resolve-new.json b/tests/compiler/resolve-new.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/resolve-new.json +++ b/tests/compiler/resolve-new.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/resolve-propertyaccess.json b/tests/compiler/resolve-propertyaccess.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/resolve-propertyaccess.json +++ b/tests/compiler/resolve-propertyaccess.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/resolve-unary.json b/tests/compiler/resolve-unary.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/resolve-unary.json +++ b/tests/compiler/resolve-unary.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/retain-i32.json b/tests/compiler/retain-i32.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/retain-i32.json +++ b/tests/compiler/retain-i32.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/finalize.json b/tests/compiler/rt/finalize.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/rt/finalize.json +++ b/tests/compiler/rt/finalize.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/flags.json b/tests/compiler/rt/flags.json index be2492774d..452f164780 100644 --- a/tests/compiler/rt/flags.json +++ b/tests/compiler/rt/flags.json @@ -4,4 +4,4 @@ ], "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/ids.json b/tests/compiler/rt/ids.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/rt/ids.json +++ b/tests/compiler/rt/ids.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/instanceof.json b/tests/compiler/rt/instanceof.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/rt/instanceof.json +++ b/tests/compiler/rt/instanceof.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/runtime-incremental-export.json b/tests/compiler/rt/runtime-incremental-export.json index 45a22d0d52..e6aec828e6 100644 --- a/tests/compiler/rt/runtime-incremental-export.json +++ b/tests/compiler/rt/runtime-incremental-export.json @@ -3,4 +3,4 @@ "--runtime", "incremental", "--exportRuntime" ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/runtime-incremental.json b/tests/compiler/rt/runtime-incremental.json index 5509d05509..d269004c58 100644 --- a/tests/compiler/rt/runtime-incremental.json +++ b/tests/compiler/rt/runtime-incremental.json @@ -2,4 +2,4 @@ "asc_flags": [ "--runtime", "incremental" ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/runtime-minimal-export.json b/tests/compiler/rt/runtime-minimal-export.json index e331f5f8b0..5a1c51bc88 100644 --- a/tests/compiler/rt/runtime-minimal-export.json +++ b/tests/compiler/rt/runtime-minimal-export.json @@ -3,4 +3,4 @@ "--runtime", "minimal", "--exportRuntime" ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/runtime-minimal.json b/tests/compiler/rt/runtime-minimal.json index db5353b1d0..6b2a4893c3 100644 --- a/tests/compiler/rt/runtime-minimal.json +++ b/tests/compiler/rt/runtime-minimal.json @@ -2,4 +2,4 @@ "asc_flags": [ "--runtime", "minimal" ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/runtime-stub-export.json b/tests/compiler/rt/runtime-stub-export.json index e0084d52c2..79c640c351 100644 --- a/tests/compiler/rt/runtime-stub-export.json +++ b/tests/compiler/rt/runtime-stub-export.json @@ -3,4 +3,4 @@ "--runtime", "stub", "--exportRuntime" ] -} \ No newline at end of file +} diff --git a/tests/compiler/rt/runtime-stub.json b/tests/compiler/rt/runtime-stub.json index c974f19a29..8e0a066281 100644 --- a/tests/compiler/rt/runtime-stub.json +++ b/tests/compiler/rt/runtime-stub.json @@ -2,4 +2,4 @@ "asc_flags": [ "--runtime", "stub" ] -} \ No newline at end of file +} diff --git a/tests/compiler/scoped.json b/tests/compiler/scoped.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/scoped.json +++ b/tests/compiler/scoped.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/static-this.json b/tests/compiler/static-this.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/static-this.json +++ b/tests/compiler/static-this.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/array-access.json b/tests/compiler/std/array-access.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/array-access.json +++ b/tests/compiler/std/array-access.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/array-literal.json b/tests/compiler/std/array-literal.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/array-literal.json +++ b/tests/compiler/std/array-literal.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/array.json b/tests/compiler/std/array.json index 2aa1e66970..f38dcdc11d 100644 --- a/tests/compiler/std/array.json +++ b/tests/compiler/std/array.json @@ -3,4 +3,4 @@ "--explicitStart" ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/arraybuffer.json b/tests/compiler/std/arraybuffer.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/arraybuffer.json +++ b/tests/compiler/std/arraybuffer.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/dataview.json b/tests/compiler/std/dataview.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/dataview.json +++ b/tests/compiler/std/dataview.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/date.json b/tests/compiler/std/date.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/std/date.json +++ b/tests/compiler/std/date.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/hash.json b/tests/compiler/std/hash.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/hash.json +++ b/tests/compiler/std/hash.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/map.json b/tests/compiler/std/map.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/map.json +++ b/tests/compiler/std/map.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/math.json b/tests/compiler/std/math.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/math.json +++ b/tests/compiler/std/math.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/mod.json b/tests/compiler/std/mod.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/mod.json +++ b/tests/compiler/std/mod.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/new.json b/tests/compiler/std/new.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/new.json +++ b/tests/compiler/std/new.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/operator-overloading.json b/tests/compiler/std/operator-overloading.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/operator-overloading.json +++ b/tests/compiler/std/operator-overloading.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/pointer.json b/tests/compiler/std/pointer.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/pointer.json +++ b/tests/compiler/std/pointer.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/polyfills.json b/tests/compiler/std/polyfills.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/polyfills.json +++ b/tests/compiler/std/polyfills.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/set.json b/tests/compiler/std/set.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/set.json +++ b/tests/compiler/std/set.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/simd.json b/tests/compiler/std/simd.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/simd.json +++ b/tests/compiler/std/simd.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/static-array.json b/tests/compiler/std/static-array.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/static-array.json +++ b/tests/compiler/std/static-array.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/staticarray.json b/tests/compiler/std/staticarray.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/staticarray.json +++ b/tests/compiler/std/staticarray.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/string-casemapping.js b/tests/compiler/std/string-casemapping.js index b944c36cf8..0190d58097 100644 --- a/tests/compiler/std/string-casemapping.js +++ b/tests/compiler/std/string-casemapping.js @@ -9,4 +9,4 @@ exports.preInstantiate = function preInstantiate(imports) { return code !== undefined ? code : -1; } }; -}; \ No newline at end of file +}; diff --git a/tests/compiler/std/string-casemapping.json b/tests/compiler/std/string-casemapping.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/std/string-casemapping.json +++ b/tests/compiler/std/string-casemapping.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/string-encoding.json b/tests/compiler/std/string-encoding.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/string-encoding.json +++ b/tests/compiler/std/string-encoding.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/string.json b/tests/compiler/std/string.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/string.json +++ b/tests/compiler/std/string.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/std/symbol.json b/tests/compiler/std/symbol.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/std/symbol.json +++ b/tests/compiler/std/symbol.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/trace.json b/tests/compiler/std/trace.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/std/trace.json +++ b/tests/compiler/std/trace.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/std/typedarray.json b/tests/compiler/std/typedarray.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/std/typedarray.json +++ b/tests/compiler/std/typedarray.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/super-inline.json b/tests/compiler/super-inline.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/super-inline.json +++ b/tests/compiler/super-inline.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/switch.json b/tests/compiler/switch.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/switch.json +++ b/tests/compiler/switch.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/tablebase.json b/tests/compiler/tablebase.json index c290be300d..3e8ac20bfe 100644 --- a/tests/compiler/tablebase.json +++ b/tests/compiler/tablebase.json @@ -2,4 +2,4 @@ "asc_flags": [ "--tableBase 32" ] -} \ No newline at end of file +} diff --git a/tests/compiler/templateliteral.json b/tests/compiler/templateliteral.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/templateliteral.json +++ b/tests/compiler/templateliteral.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/ternary.json b/tests/compiler/ternary.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/ternary.json +++ b/tests/compiler/ternary.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/throw.json b/tests/compiler/throw.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/throw.json +++ b/tests/compiler/throw.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/compiler/typealias.json b/tests/compiler/typealias.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/typealias.json +++ b/tests/compiler/typealias.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/typeof.json b/tests/compiler/typeof.json index 65091e5197..1b3c185bda 100644 --- a/tests/compiler/typeof.json +++ b/tests/compiler/typeof.json @@ -2,4 +2,4 @@ "asc_flags": [ "--explicitStart" ] -} \ No newline at end of file +} diff --git a/tests/compiler/unary.json b/tests/compiler/unary.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/unary.json +++ b/tests/compiler/unary.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/unify-local-flags.json b/tests/compiler/unify-local-flags.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/unify-local-flags.json +++ b/tests/compiler/unify-local-flags.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/unsafe.json b/tests/compiler/unsafe.json index 5c3770cac2..f44bd65446 100644 --- a/tests/compiler/unsafe.json +++ b/tests/compiler/unsafe.json @@ -29,4 +29,4 @@ "AS101: Operation is unsafe.", "foo.baz += 1;", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/variable-access-in-initializer.json b/tests/compiler/variable-access-in-initializer.json index ffa5efab4d..44ccbd7698 100644 --- a/tests/compiler/variable-access-in-initializer.json +++ b/tests/compiler/variable-access-in-initializer.json @@ -6,4 +6,4 @@ "TS2448: Variable 'variable-access-in-initializer/test~b' used before its declaration.", "EOF" ] -} \ No newline at end of file +} diff --git a/tests/compiler/void.json b/tests/compiler/void.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/void.json +++ b/tests/compiler/void.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/wasi/snapshot_preview1.json b/tests/compiler/wasi/snapshot_preview1.json index 73d40f91f2..1bdd02b1be 100644 --- a/tests/compiler/wasi/snapshot_preview1.json +++ b/tests/compiler/wasi/snapshot_preview1.json @@ -1,4 +1,4 @@ { "asc_flags": [ ] -} \ No newline at end of file +} diff --git a/tests/compiler/while.json b/tests/compiler/while.json index e2eed82c22..b83788465e 100644 --- a/tests/compiler/while.json +++ b/tests/compiler/while.json @@ -2,4 +2,4 @@ "asc_flags": [ ], "asc_rtrace": true -} \ No newline at end of file +} diff --git a/tests/extension/package.json b/tests/extension/package.json index 7eee66133e..0bfdd721eb 100644 --- a/tests/extension/package.json +++ b/tests/extension/package.json @@ -3,4 +3,4 @@ "test": "npm run asbuild", "asbuild": "node ../../bin/asc assembly/index.as --extension .as --noEmit" } -} \ No newline at end of file +} diff --git a/tests/packages/packages/a/assembly/index.ts b/tests/packages/packages/a/assembly/index.ts index f1c054c099..378dcf843c 100644 --- a/tests/packages/packages/a/assembly/index.ts +++ b/tests/packages/packages/a/assembly/index.ts @@ -1 +1 @@ -export * from "./a"; \ No newline at end of file +export * from "./a"; diff --git a/tests/packages/packages/c/node_modules/b/node_modules/a/assembly/index.ts b/tests/packages/packages/c/node_modules/b/node_modules/a/assembly/index.ts index f1c054c099..378dcf843c 100644 --- a/tests/packages/packages/c/node_modules/b/node_modules/a/assembly/index.ts +++ b/tests/packages/packages/c/node_modules/b/node_modules/a/assembly/index.ts @@ -1 +1 @@ -export * from "./a"; \ No newline at end of file +export * from "./a"; diff --git a/tests/packages/packages/d/node_modules/as/package.json b/tests/packages/packages/d/node_modules/as/package.json index 080e0e0975..614a251f86 100644 --- a/tests/packages/packages/d/node_modules/as/package.json +++ b/tests/packages/packages/d/node_modules/as/package.json @@ -1,3 +1,3 @@ { "ascMain": "./notassembly/index.ts" -} \ No newline at end of file +}