diff --git a/src/ast.ts b/src/ast.ts index 3dbdb19c..e6ff4692 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -87,6 +87,7 @@ export enum NodeKind { FIELDDECLARATION, FUNCTIONDECLARATION, IMPORTDECLARATION, + INDEXSIGNATUREDECLARATION, INTERFACEDECLARATION, METHODDECLARATION, NAMESPACEDECLARATION, @@ -181,12 +182,14 @@ export abstract class Node { static createTypeParameter( name: IdentifierExpression, extendsType: TypeNode | null, + defaultType: TypeNode | null, range: Range ): TypeParameterNode { var elem = new TypeParameterNode(); elem.range = range; elem.name = name; name.parent = elem; elem.extendsType = extendsType; if (extendsType) extendsType.parent = elem; + elem.defaultType = defaultType; if (defaultType) defaultType.parent = elem; return elem; } @@ -871,6 +874,18 @@ export abstract class Node { return stmt; } + static createIndexSignatureDeclaration( + keyType: TypeNode, + valueType: CommonTypeNode, + range: Range + ): IndexSignatureDeclaration { + var elem = new IndexSignatureDeclaration(); + elem.range = range; + elem.keyType = keyType; keyType.parent = elem; + elem.valueType = valueType; valueType.parent = elem; + return elem; + } + static createMethodDeclaration( name: IdentifierExpression, typeParameters: TypeParameterNode[] | null, @@ -1070,6 +1085,8 @@ export class TypeParameterNode extends Node { name: IdentifierExpression; /** Extended type reference, if any. */ extendsType: TypeNode | null; // can't be a function + /** Default type if omitted, if any. */ + defaultType: TypeNode | null; // can't be a function } /** Represents the kind of a parameter. */ @@ -1622,6 +1639,16 @@ export abstract class DeclarationStatement extends Statement { } } +/** Represents an index signature declaration. */ +export class IndexSignatureDeclaration extends DeclarationStatement { + kind = NodeKind.INDEXSIGNATUREDECLARATION; + + /** Key type. */ + keyType: TypeNode; + /** Value type. */ + valueType: CommonTypeNode; +} + /** Base class of all variable-like declaration statements. */ export abstract class VariableLikeDeclarationStatement extends DeclarationStatement { diff --git a/src/compiler.ts b/src/compiler.ts index f01c6549..21337e60 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -162,7 +162,8 @@ import { writeI32, writeI64, writeF32, - writeF64 + writeF64, + makeMap } from "./util"; /** Compilation target. */ @@ -619,7 +620,7 @@ export class Compiler extends DiagnosticEmitter { (noTreeShaking || (isEntry && statement.is(CommonFlags.EXPORT))) && !(statement).isGeneric ) { - this.compileClassDeclaration(statement, [], null); + this.compileClassDeclaration(statement, []); } break; } @@ -958,16 +959,15 @@ export class Compiler extends DiagnosticEmitter { /** Compiles a top-level function given its declaration. */ compileFunctionDeclaration( declaration: FunctionDeclaration, - typeArguments: TypeNode[], - contextualTypeArguments: Map | null = null + typeArguments: TypeNode[] ): Function | null { var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName)); assert(element.kind == ElementKind.FUNCTION_PROTOTYPE); return this.compileFunctionUsingTypeArguments( // reports element, typeArguments, - contextualTypeArguments, - null, // no outer scope (is top level) + makeMap(), + null, (element).declaration.name ); } @@ -976,7 +976,7 @@ export class Compiler extends DiagnosticEmitter { compileFunctionUsingTypeArguments( prototype: FunctionPrototype, typeArguments: TypeNode[], - contextualTypeArguments: Map | null, + contextualTypeArguments: Map, outerScope: Flow | null, reportNode: Node ): Function | null { @@ -1234,7 +1234,11 @@ export class Compiler extends DiagnosticEmitter { (element).is(CommonFlags.EXPORT) ) && !(element).is(CommonFlags.GENERIC) ) { - this.compileClassUsingTypeArguments(element, []); + this.compileClassUsingTypeArguments( + element, + [], + makeMap() + ); } break; } @@ -1252,8 +1256,8 @@ export class Compiler extends DiagnosticEmitter { this.compileFunctionUsingTypeArguments( element, [], - null, // no contextual type arguments - null, // no outer scope + makeMap(), + null, (element).declaration.name ); } @@ -1286,7 +1290,11 @@ export class Compiler extends DiagnosticEmitter { switch (element.kind) { case ElementKind.CLASS_PROTOTYPE: { if (!(element).is(CommonFlags.GENERIC)) { - this.compileClassUsingTypeArguments(element, []); + this.compileClassUsingTypeArguments( + element, + [], + makeMap() + ); } break; } @@ -1302,8 +1310,8 @@ export class Compiler extends DiagnosticEmitter { this.compileFunctionUsingTypeArguments( element, [], - null, // no contextual type arguments - null, // no outer scope + makeMap(), + null, (element).declaration.name ); } @@ -1325,15 +1333,14 @@ export class Compiler extends DiagnosticEmitter { compileClassDeclaration( declaration: ClassDeclaration, - typeArguments: TypeNode[], - contextualTypeArguments: Map | null = null + typeArguments: TypeNode[] ): void { var element = assert(this.program.elementsLookup.get(declaration.fileLevelInternalName)); assert(element.kind == ElementKind.CLASS_PROTOTYPE); this.compileClassUsingTypeArguments( element, typeArguments, - contextualTypeArguments, + makeMap(), declaration ); } @@ -1341,7 +1348,7 @@ export class Compiler extends DiagnosticEmitter { compileClassUsingTypeArguments( prototype: ClassPrototype, typeArguments: TypeNode[], - contextualTypeArguments: Map | null = null, + contextualTypeArguments: Map, alternativeReportNode: Node | null = null ): void { var instance = this.resolver.resolveClassInclTypeArguments( @@ -1372,7 +1379,9 @@ export class Compiler extends DiagnosticEmitter { ) { this.compileFunctionUsingTypeArguments( element, - [], null, null, + [], + makeMap(), + null, (element).declaration.name ); } @@ -1383,7 +1392,9 @@ export class Compiler extends DiagnosticEmitter { if (getter) { this.compileFunctionUsingTypeArguments( getter, - [], null, null, + [], + makeMap(), + null, getter.declaration.name ); } @@ -1391,7 +1402,9 @@ export class Compiler extends DiagnosticEmitter { if (setter) { this.compileFunctionUsingTypeArguments( setter, - [], null, null, + [], + makeMap(), + null, setter.declaration.name ); } @@ -1413,8 +1426,8 @@ export class Compiler extends DiagnosticEmitter { this.compileFunctionUsingTypeArguments( element, [], - instance.contextualTypeArguments, - null, // no outer scope + makeMap(instance.contextualTypeArguments), + null, (element).declaration.name ); } @@ -1429,7 +1442,9 @@ export class Compiler extends DiagnosticEmitter { if (getter) { this.compileFunctionUsingTypeArguments( getter, - [], instance.contextualTypeArguments, null, + [], + makeMap(instance.contextualTypeArguments), + null, getter.declaration.name ); } @@ -1437,7 +1452,9 @@ export class Compiler extends DiagnosticEmitter { if (setter) { this.compileFunctionUsingTypeArguments( setter, - [], instance.contextualTypeArguments, null, + [], + makeMap(instance.contextualTypeArguments), + null, setter.declaration.name ); } @@ -5014,7 +5031,7 @@ export class Compiler extends DiagnosticEmitter { instance = this.resolver.resolveFunctionInclTypeArguments( prototype, typeArguments, - this.currentFunction.flow.contextualTypeArguments, + makeMap(this.currentFunction.flow.contextualTypeArguments), expression ); @@ -5088,7 +5105,7 @@ export class Compiler extends DiagnosticEmitter { instance = this.resolver.resolveFunction( prototype, resolvedTypeArguments, - this.currentFunction.flow.contextualTypeArguments + makeMap(this.currentFunction.flow.contextualTypeArguments) ); if (!instance) return this.module.createUnreachable(); return this.makeCallDirect(instance, argumentExprs); @@ -5098,11 +5115,7 @@ export class Compiler extends DiagnosticEmitter { // otherwise resolve the non-generic call as usual } else { - instance = this.resolver.resolveFunction( - prototype, - null, - this.currentFunction.flow.contextualTypeArguments - ); + instance = this.resolver.resolveFunction(prototype, null); } if (!instance) return this.module.createUnreachable(); @@ -5241,7 +5254,7 @@ export class Compiler extends DiagnosticEmitter { typeArguments = this.resolver.resolveTypeArguments( assert(prototype.declaration.typeParameters), typeArgumentNodes, - this.currentFunction.flow.contextualTypeArguments, + makeMap(this.currentFunction.flow.contextualTypeArguments), expression ); } @@ -5932,7 +5945,7 @@ export class Compiler extends DiagnosticEmitter { var instance = this.compileFunctionUsingTypeArguments( prototype, [], - flow.contextualTypeArguments, + makeMap(flow.contextualTypeArguments), flow, declaration ); @@ -6093,7 +6106,7 @@ export class Compiler extends DiagnosticEmitter { let instance = this.resolver.resolveFunction( target, null, - currentFunction.flow.contextualTypeArguments + makeMap(currentFunction.flow.contextualTypeArguments) ); if (!(instance && this.compileFunction(instance))) return module.createUnreachable(); let index = this.ensureFunctionTableEntry(instance); @@ -6438,7 +6451,11 @@ export class Compiler extends DiagnosticEmitter { // create the Array segment and return a pointer to it var arrayPrototype = assert(program.arrayPrototype); - var arrayInstance = assert(this.resolver.resolveClass(arrayPrototype, [ elementType ])); + var arrayInstance = assert(this.resolver.resolveClass( + arrayPrototype, + [ elementType ], + makeMap() + )); var arrayHeaderSize = (arrayInstance.currentMemoryOffset + 7) & ~7; if (hasGC) { buf = new Uint8Array(gcHeaderSize + arrayHeaderSize); @@ -6506,9 +6523,11 @@ export class Compiler extends DiagnosticEmitter { // otherwise obtain the array type var arrayPrototype = assert(this.program.arrayPrototype); - if (!arrayPrototype || arrayPrototype.kind != ElementKind.CLASS_PROTOTYPE) return module.createUnreachable(); - var arrayInstance = this.resolver.resolveClass(arrayPrototype, [ elementType ]); - if (!arrayInstance) return module.createUnreachable(); + var arrayInstance = assert(this.resolver.resolveClass( + arrayPrototype, + [ elementType ], + makeMap() + )); var arrayType = arrayInstance.type; // and compile an explicit instantiation @@ -6660,13 +6679,13 @@ export class Compiler extends DiagnosticEmitter { classInstance = this.resolver.resolveClass( classPrototype, classReference.typeArguments, - currentFunction.flow.contextualTypeArguments + makeMap(currentFunction.flow.contextualTypeArguments) ); } else { classInstance = this.resolver.resolveClassInclTypeArguments( classPrototype, typeArguments, - currentFunction.flow.contextualTypeArguments, + makeMap(currentFunction.flow.contextualTypeArguments), expression ); } diff --git a/src/diagnosticMessages.generated.ts b/src/diagnosticMessages.generated.ts index 94af4a26..85c5b678 100644 --- a/src/diagnosticMessages.generated.ts +++ b/src/diagnosticMessages.generated.ts @@ -121,6 +121,7 @@ export enum DiagnosticCode { Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration = 2673, Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration = 2674, Namespace_0_has_no_exported_member_1 = 2694, + Required_type_parameters_may_not_follow_optional_type_parameters = 2706, File_0_not_found = 6054, Numeric_separators_are_not_allowed_here = 6188, Multiple_consecutive_numeric_separators_are_not_permitted = 6189 @@ -243,6 +244,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string { case 2673: return "Constructor of class '{0}' is private and only accessible within the class declaration."; case 2674: return "Constructor of class '{0}' is protected and only accessible within the class declaration."; case 2694: return "Namespace '{0}' has no exported member '{1}'."; + case 2706: return "Required type parameters may not follow optional type parameters."; case 6054: return "File '{0}' not found."; case 6188: return "Numeric separators are not allowed here."; case 6189: return "Multiple consecutive numeric separators are not permitted."; diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json index b9607098..3594958b 100644 --- a/src/diagnosticMessages.json +++ b/src/diagnosticMessages.json @@ -115,6 +115,7 @@ "Constructor of class '{0}' is private and only accessible within the class declaration.": 2673, "Constructor of class '{0}' is protected and only accessible within the class declaration.": 2674, "Namespace '{0}' has no exported member '{1}'.": 2694, + "Required type parameters may not follow optional type parameters.": 2706, "File '{0}' not found.": 6054, "Numeric separators are not allowed here.": 6188, diff --git a/src/extra/ast.ts b/src/extra/ast.ts index 2e005526..79e99adc 100644 --- a/src/extra/ast.ts +++ b/src/extra/ast.ts @@ -68,6 +68,7 @@ import { FieldDeclaration, FunctionDeclaration, ImportDeclaration, + IndexSignatureDeclaration, InterfaceDeclaration, MethodDeclaration, NamespaceDeclaration, @@ -295,6 +296,10 @@ export class ASTBuilder { this.visitImportDeclaration(node); break; } + case NodeKind.INDEXSIGNATUREDECLARATION: { + this.visitIndexSignatureDeclaration(node); + break; + } case NodeKind.INTERFACEDECLARATION: { this.visitInterfaceDeclaration(node); break; @@ -379,6 +384,11 @@ export class ASTBuilder { this.sb.push(" extends "); this.visitTypeNode(extendsType); } + var defaultType = node.defaultType; + if (defaultType) { + this.sb.push("="); + this.visitTypeNode(defaultType); + } } visitSignatureNode(node: SignatureNode): void { @@ -1176,6 +1186,14 @@ export class ASTBuilder { this.visitStringLiteralExpression(node.path); } + visitIndexSignatureDeclaration(node: IndexSignatureDeclaration): void { + var sb = this.sb; + sb.push("[key: "); + this.visitTypeNode(node.keyType); + sb.push("]: "); + this.visitTypeNode(node.valueType); + } + visitInterfaceDeclaration(node: InterfaceDeclaration): void { var decorators = node.decorators; if (decorators) { diff --git a/src/parser.ts b/src/parser.ts index 7f573a8a..24c0b0dd 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -83,7 +83,8 @@ import { mangleInternalPath, nodeIsCallable, - nodeIsGenericCallable + nodeIsGenericCallable, + IndexSignatureDeclaration } from "./ast"; /** Parser interface. */ @@ -926,9 +927,19 @@ export class Parser extends DiagnosticEmitter { // at '<': TypeParameter (',' TypeParameter)* '>' var typeParameters = new Array(); + var seenOptional = false; while (!tn.skip(Token.GREATERTHAN)) { let typeParameter = this.parseTypeParameter(tn); if (!typeParameter) return null; + if (typeParameter.defaultType !== null) { + seenOptional = true; + } else if (seenOptional) { + this.error( + DiagnosticCode.Required_type_parameters_may_not_follow_optional_type_parameters, + typeParameter.range + ); + typeParameter.defaultType = null; + } typeParameters.push(typeParameter); if (!tn.skip(Token.COMMA)) { if (tn.skip(Token.GREATERTHAN)) { @@ -955,7 +966,7 @@ export class Parser extends DiagnosticEmitter { tn: Tokenizer ): TypeParameterNode | null { - // before: Identifier ('extends' Type)? + // before: Identifier ('extends' Type)? ('=' Type)? if (tn.next() == Token.IDENTIFIER) { let identifier = Node.createIdentifierExpression( @@ -975,9 +986,23 @@ export class Parser extends DiagnosticEmitter { } extendsType = t; } + let defaultType: TypeNode | null = null; + if (tn.skip(Token.EQUALS)) { + let t = this.parseType(tn); + if (!t) return null; + if (t.kind != NodeKind.TYPE) { + this.error( + DiagnosticCode.Operation_not_supported, + t.range + ); + return null; + } + defaultType = t; + } return Node.createTypeParameter( identifier, extendsType, + defaultType, Range.join(identifier.range, tn.range()) ); } else { @@ -1602,16 +1627,18 @@ export class Parser extends DiagnosticEmitter { var isInterface = parent.kind == NodeKind.INTERFACEDECLARATION; var decorators = new Array(); - while (tn.skip(Token.AT)) { - let decorator = this.parseDecorator(tn); - if (!decorator) break; + if (tn.skip(Token.AT)) { + do { + let decorator = this.parseDecorator(tn); + if (!decorator) break; + decorators.push(decorator); + } while (tn.skip(Token.AT)); if (isInterface) { this.error( DiagnosticCode.Decorators_are_not_valid_here, - decorator.range + Range.join(decorators[0].range, decorators[decorators.length - 1].range) ); } - decorators.push(decorator); } // inherit ambient status @@ -1620,6 +1647,8 @@ export class Parser extends DiagnosticEmitter { // implemented methods are virtual if (isInterface) flags |= CommonFlags.VIRTUAL; + var accessStart = 0; + var accessEnd = 0; if (tn.skip(Token.PUBLIC)) { if (isInterface) { this.error( @@ -1628,6 +1657,8 @@ export class Parser extends DiagnosticEmitter { ); } flags |= CommonFlags.PUBLIC; + accessStart = tn.tokenPos; + accessEnd = tn.pos; } else if (tn.skip(Token.PRIVATE)) { if (isInterface) { this.error( @@ -1636,6 +1667,8 @@ export class Parser extends DiagnosticEmitter { ); } flags |= CommonFlags.PRIVATE; + accessStart = tn.tokenPos; + accessEnd = tn.pos; } else if (tn.skip(Token.PROTECTED)) { if (isInterface) { this.error( @@ -1644,12 +1677,14 @@ export class Parser extends DiagnosticEmitter { ); } flags |= CommonFlags.PROTECTED; + accessStart = tn.tokenPos; + accessEnd = tn.pos; } - var staticStart: i32 = 0; - var staticEnd: i32 = 0; - var abstractStart: i32 = 0; - var abstractEnd: i32 = 0; + var staticStart = 0; + var staticEnd = 0; + var abstractStart = 0; + var abstractEnd = 0; if (tn.skip(Token.STATIC)) { if (isInterface) { this.error( @@ -1673,9 +1708,7 @@ export class Parser extends DiagnosticEmitter { abstractStart = tn.tokenPos; abstractEnd = tn.pos; } - if (parent.flags & CommonFlags.GENERIC) { - flags |= CommonFlags.GENERIC_CONTEXT; - } + if (parent.flags & CommonFlags.GENERIC) flags |= CommonFlags.GENERIC_CONTEXT; } var readonlyStart: i32 = 0; @@ -1713,7 +1746,7 @@ export class Parser extends DiagnosticEmitter { } } else if (tn.skip(Token.SET)) { if (tn.peek(true, IdentifierHandling.PREFER) == Token.IDENTIFIER && !tn.nextTokenOnNewLine) { - flags |= CommonFlags.SET | CommonFlags.SET; + flags |= CommonFlags.SET; isSetter = true; setStart = tn.tokenPos; setEnd = tn.pos; @@ -1750,17 +1783,60 @@ export class Parser extends DiagnosticEmitter { } } - if (!isConstructor && !tn.skipIdentifier()) { - this.error( - DiagnosticCode.Identifier_expected, - tn.range() - ); - return null; + var name: IdentifierExpression; + if (isConstructor) { + name = Node.createConstructorExpression(tn.range()); + } else { + if (!(isGetter || isSetter) && tn.skip(Token.OPENBRACKET)) { + // TODO: also handle symbols, which might have some of these modifiers + if (flags & CommonFlags.PUBLIC) { + this.error( + DiagnosticCode._0_modifier_cannot_be_used_here, + tn.range(accessStart, accessEnd), "public" + ); // recoverable + } else if (flags & CommonFlags.PROTECTED) { + this.error( + DiagnosticCode._0_modifier_cannot_be_used_here, + tn.range(accessStart, accessEnd), "protected" + ); // recoverable + } else if (flags & CommonFlags.PRIVATE) { + this.error( + DiagnosticCode._0_modifier_cannot_be_used_here, + tn.range(accessStart, accessEnd), "protected" + ); // recoverable + } + if (flags & CommonFlags.STATIC) { + this.error( + DiagnosticCode._0_modifier_cannot_be_used_here, + tn.range(staticStart, staticEnd), "static" + ); // recoverable + } + if (flags & CommonFlags.ABSTRACT) { + this.error( + DiagnosticCode._0_modifier_cannot_be_used_here, + tn.range(abstractStart, abstractEnd), "abstract" + ); // recoverable + } + if (flags & CommonFlags.READONLY) { + this.error( + DiagnosticCode._0_modifier_cannot_be_used_here, + tn.range(readonlyStart, readonlyEnd), "readonly" + ); // recoverable + } + let retIndex = this.parseIndexSignatureDeclaration(tn, decorators); + if (!retIndex) return null; + tn.skip(Token.SEMICOLON); + return retIndex; + } + if (!tn.skipIdentifier()) { + this.error( + DiagnosticCode.Identifier_expected, + tn.range() + ); + return null; + } + name = Node.createIdentifierExpression(tn.readIdentifier(), tn.range()); } - - var name = isConstructor - ? Node.createConstructorExpression(tn.range()) - : Node.createIdentifierExpression(tn.readIdentifier(), tn.range()); var typeParameters: TypeParameterNode[] | null = null; if (tn.skip(Token.LESSTHAN)) { let typeParametersStart = tn.tokenPos; @@ -1979,6 +2055,69 @@ export class Parser extends DiagnosticEmitter { return null; } + parseIndexSignatureDeclaration(tn: Tokenizer, decorators: DecoratorNode[]): IndexSignatureDeclaration | null { + + // at: '[': 'key' ':' Type ']' ':' Type + + if (decorators.length) { + this.error( + DiagnosticCode.Decorators_are_not_valid_here, + Range.join(decorators[0].range, decorators[decorators.length - 1].range) + ); // recoverable + } + + var start = tn.tokenPos; + if (tn.skipIdentifier()) { + let id = tn.readIdentifier(); + if (id == "key") { + if (tn.skip(Token.COLON)) { + let keyType = this.parseType(tn); + if (!keyType) return null; + if (keyType.kind != NodeKind.TYPE) { + this.error( + DiagnosticCode.Type_expected, + tn.range() + ); + return null; + } + if (tn.skip(Token.CLOSEBRACKET)) { + if (tn.skip(Token.COLON)) { + let valueType = this.parseType(tn); + if (!valueType) return null; + return Node.createIndexSignatureDeclaration(keyType, valueType, tn.range(start, tn.pos)); + } else { + this.error( + DiagnosticCode._0_expected, + tn.range(), ":" + ); + } + } else { + this.error( + DiagnosticCode._0_expected, + tn.range(), "]" + ); + } + } else { + this.error( + DiagnosticCode._0_expected, + tn.range(), ":" + ); + } + } else { + this.error( + DiagnosticCode._0_expected, + tn.range(), "key" + ); + } + } else { + this.error( + DiagnosticCode.Identifier_expected, + tn.range() + ); + } + return null; + } + parseNamespace( tn: Tokenizer, flags: CommonFlags, diff --git a/src/program.ts b/src/program.ts index 96edbbc5..d8d54d2a 100644 --- a/src/program.ts +++ b/src/program.ts @@ -965,6 +965,7 @@ export class Program extends DiagnosticEmitter { } break; } + case NodeKind.INDEXSIGNATUREDECLARATION: break; // ignored for now default: { assert(false); // should have been reported while parsing return; @@ -2413,6 +2414,21 @@ export class FunctionPrototype extends Element { this.decoratorFlags = decoratorFlags; } + /** Applies class type arguments to the context of a partially resolved instance method. */ + applyClassTypeArguments(contextualTypeArguments: Map): void { + var classTypeArguments = assert(this.classTypeArguments); // set only if partial + var classDeclaration = assert(this.classPrototype).declaration; + var classTypeParameters = classDeclaration.typeParameters; + var numClassTypeParameters = classTypeParameters.length; + assert(numClassTypeParameters == classTypeArguments.length); + for (let i = 0; i < numClassTypeParameters; ++i) { + contextualTypeArguments.set( + classTypeParameters[i].name.text, + classTypeArguments[i] + ); + } + } + toString(): string { return this.simpleName; } } diff --git a/src/resolver.ts b/src/resolver.ts index c55059aa..1bc2c53f 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -51,7 +51,8 @@ import { import { Type, Signature, - typesToString + typesToString, + TypeKind } from "./types"; import { @@ -60,6 +61,10 @@ import { CommonFlags } from "./common"; +import { + makeMap +} from "./util"; + /** Indicates whether errors are reported or not. */ export enum ReportMode { /** Report errors. */ @@ -78,6 +83,8 @@ export class Resolver extends DiagnosticEmitter { currentThisExpression: Expression | null = null; /** Element expression of the previously resolved element access. */ currentElementExpression : Expression | null = null; + /** Whether the last resolved type has been resolved from a placeholder, i.e. `T`. */ + currentTypeIsPlaceholder: bool = false; /** Constructs the resolver for the specified program. */ constructor(program: Program) { @@ -131,7 +138,7 @@ export class Resolver extends DiagnosticEmitter { let instance = this.resolveClassInclTypeArguments( element, typeNode.typeArguments, - contextualTypeArguments, + makeMap(contextualTypeArguments), node ); // reports if (!instance) return null; @@ -148,30 +155,29 @@ export class Resolver extends DiagnosticEmitter { } // resolve parameters - { - let typeArgumentNodes = typeNode.typeArguments; - if (typeArgumentNodes) { - let numTypeArguments = typeArgumentNodes.length; - let paramTypes = new Array(numTypeArguments); - for (let i = 0; i < numTypeArguments; ++i) { - let paramType = this.resolveType( // reports - typeArgumentNodes[i], - contextualTypeArguments, - reportMode - ); - if (!paramType) return null; - paramTypes[i] = paramType; - } - if (numTypeArguments) { // can't be a placeholder if it has parameters - let instanceKey = typesToString(paramTypes); - if (instanceKey.length) { - localName += "<" + instanceKey + ">"; - globalName += "<" + instanceKey + ">"; - } - } else if (contextualTypeArguments) { - let placeholderType = contextualTypeArguments.get(globalName); - if (placeholderType) return placeholderType; + var typeArgumentNodes = typeNode.typeArguments; + var typeArguments: Type[] | null = null; + if (typeArgumentNodes) { + let numTypeArguments = typeArgumentNodes.length; + typeArguments = new Array(numTypeArguments); + for (let i = 0; i < numTypeArguments; ++i) { + let paramType = this.resolveType( // reports + typeArgumentNodes[i], + contextualTypeArguments, + reportMode + ); + if (!paramType) return null; + typeArguments[i] = paramType; + } + if (numTypeArguments) { // can't be a placeholder if it has parameters + let instanceKey = typesToString(typeArguments); + if (instanceKey.length) { + localName += "<" + instanceKey + ">"; + globalName += "<" + instanceKey + ">"; } + } else if (contextualTypeArguments) { + let placeholderType = contextualTypeArguments.get(globalName); + if (placeholderType) return placeholderType; } } @@ -187,6 +193,36 @@ export class Resolver extends DiagnosticEmitter { } } + // check built-in macro types + if (simpleName == "NATIVE") { + if (!(typeArguments && typeArguments.length == 1)) { + if (reportMode == ReportMode.REPORT) { + this.error( + DiagnosticCode.Expected_0_type_arguments_but_got_1, + typeNode.range, "1", (typeArgumentNodes ? typeArgumentNodes.length : 1).toString(10) + ); + } + return null; + } + switch (typeArguments[0].kind) { + case TypeKind.I8: + case TypeKind.I16: + case TypeKind.I32: return Type.i32; + case TypeKind.ISIZE: if (!this.program.options.isWasm64) return Type.i32; + case TypeKind.I64: return Type.i64; + case TypeKind.U8: + case TypeKind.U16: + case TypeKind.U32: + case TypeKind.BOOL: return Type.u32; + case TypeKind.USIZE: if (!this.program.options.isWasm64) return Type.u32; + case TypeKind.U64: return Type.u64; + case TypeKind.F32: return Type.f32; + case TypeKind.F64: return Type.f64; + case TypeKind.VOID: return Type.void; + default: assert(false); + } + } + if (reportMode == ReportMode.REPORT) { this.error( DiagnosticCode.Cannot_find_name_0, @@ -255,39 +291,47 @@ export class Resolver extends DiagnosticEmitter { resolveTypeArguments( typeParameters: TypeParameterNode[], typeArgumentNodes: CommonTypeNode[] | null, - contextualTypeArguments: Map | null = null, + contextualTypeArguments: Map, alternativeReportNode: Node | null = null, reportMode: ReportMode = ReportMode.REPORT ): Type[] | null { - var parameterCount = typeParameters.length; + var minParameterCount = 0; + var maxParameterCount = 0; + for (let i = 0; i < typeParameters.length; ++i) { + if (!typeParameters[i].defaultType) ++minParameterCount; + ++maxParameterCount; + } var argumentCount = typeArgumentNodes ? typeArgumentNodes.length : 0; - if (parameterCount != argumentCount) { - if (argumentCount) { - this.error( - DiagnosticCode.Expected_0_type_arguments_but_got_1, - Range.join( - (typeArgumentNodes)[0].range, - (typeArgumentNodes)[argumentCount - 1].range - ), - parameterCount.toString(10), argumentCount.toString(10) - ); - } else if (alternativeReportNode) { - this.error( - DiagnosticCode.Expected_0_type_arguments_but_got_1, - alternativeReportNode.range.atEnd, parameterCount.toString(10), "0" - ); - } + if (argumentCount < minParameterCount || argumentCount > maxParameterCount) { + this.error( + DiagnosticCode.Expected_0_type_arguments_but_got_1, + argumentCount + ? Range.join( + (typeArgumentNodes)[0].range, + (typeArgumentNodes)[argumentCount - 1].range + ) + : assert(alternativeReportNode).range.atEnd, + (argumentCount < minParameterCount ? minParameterCount : maxParameterCount).toString(10), + argumentCount.toString(10) + ); return null; } - var typeArguments = new Array(parameterCount); - for (let i = 0; i < parameterCount; ++i) { - let type = this.resolveType( // reports - (typeArgumentNodes)[i], - contextualTypeArguments, - reportMode - ); + var typeArguments = new Array(maxParameterCount); + for (let i = 0; i < maxParameterCount; ++i) { + let type = i < argumentCount + ? this.resolveType( // reports + (typeArgumentNodes)[i], + contextualTypeArguments, + reportMode + ) + : this.resolveType( // reports + assert(typeParameters[i].defaultType), + contextualTypeArguments, + reportMode + ); if (!type) return null; // TODO: check extendsType + contextualTypeArguments.set(typeParameters[i].name.text, type); typeArguments[i] = type; } return typeArguments; @@ -407,7 +451,7 @@ export class Resolver extends DiagnosticEmitter { let getter = this.resolveFunction( assert((target).getterPrototype), null, - null, + makeMap(), reportMode ); if (!getter) return null; @@ -662,7 +706,7 @@ export class Resolver extends DiagnosticEmitter { let instance = this.resolveFunctionInclTypeArguments( target, (expression).typeArguments, - contextualFunction.flow.contextualTypeArguments, + makeMap(contextualFunction.flow.contextualTypeArguments), expression, reportMode ); @@ -710,10 +754,10 @@ export class Resolver extends DiagnosticEmitter { resolveFunction( prototype: FunctionPrototype, typeArguments: Type[] | null, - contextualTypeArguments: Map | null = null, + contextualTypeArguments: Map = makeMap(), reportMode: ReportMode = ReportMode.REPORT ): Function | null { - var classTypeArguments = prototype.classTypeArguments; + var classTypeArguments = prototype.classTypeArguments; // set only if partially resolved var classInstanceKey = classTypeArguments ? typesToString(classTypeArguments) : ""; var instanceKey = typeArguments ? typesToString(typeArguments) : ""; var classInstances = prototype.instances.get(classInstanceKey); @@ -726,34 +770,8 @@ export class Resolver extends DiagnosticEmitter { var isInstance = prototype.is(CommonFlags.INSTANCE); var classPrototype = prototype.classPrototype; - // inherit contextual type arguments as provided. might be overridden. - var inheritedTypeArguments = contextualTypeArguments; - contextualTypeArguments = new Map(); - if (inheritedTypeArguments) { - for (let [inheritedName, inheritedType] of inheritedTypeArguments) { - contextualTypeArguments.set( - inheritedName, - inheritedType - ); - } - } - - // override with class type arguments if a partially resolved instance method - if (classTypeArguments) { // set only if partially resolved - assert(prototype.is(CommonFlags.INSTANCE)); - let classDeclaration = assert(classPrototype).declaration; - let classTypeParameters = classDeclaration.typeParameters; - let numClassTypeParameters = classTypeParameters.length; - assert(numClassTypeParameters == classTypeArguments.length); - for (let i = 0; i < numClassTypeParameters; ++i) { - contextualTypeArguments.set( - classTypeParameters[i].name.text, - classTypeArguments[i] - ); - } - } else { - assert(!classTypeArguments); - } + // apply class type arguments if a partially resolved instance method + if (classTypeArguments) prototype.applyClassTypeArguments(contextualTypeArguments); // override with function specific type arguments var signatureNode = declaration.signature; @@ -869,13 +887,21 @@ export class Resolver extends DiagnosticEmitter { resolveFunctionInclTypeArguments( prototype: FunctionPrototype, typeArgumentNodes: CommonTypeNode[] | null, - contextualTypeArguments: Map | null, + contextualTypeArguments: Map, reportNode: Node, reportMode: ReportMode = ReportMode.REPORT ): Function | null { var resolvedTypeArguments: Type[] | null = null; + + // Resolve type arguments if generic if (prototype.is(CommonFlags.GENERIC)) { - assert(typeArgumentNodes != null && typeArgumentNodes.length != 0); + + // apply class type arguments if a partially resolved instance method + // FIXME: this is done once more in resolveFunction. required here for resolveTypeArguments, + // required there for just resolving a function no matter if a partial or not. + let classTypeArguments = prototype.classTypeArguments; + if (classTypeArguments) prototype.applyClassTypeArguments(contextualTypeArguments); + resolvedTypeArguments = this.resolveTypeArguments( // reports assert(prototype.declaration.typeParameters), typeArgumentNodes, @@ -884,7 +910,21 @@ export class Resolver extends DiagnosticEmitter { reportMode ); if (!resolvedTypeArguments) return null; + + // Otherwise make sure that no type arguments have been specified + } else { + if (typeArgumentNodes !== null && typeArgumentNodes.length) { + if (reportMode == ReportMode.REPORT) { + this.error( + DiagnosticCode.Type_0_is_not_generic, + reportNode.range, prototype.internalName + ); + } + return null; + } } + + // Continue with concrete types return this.resolveFunction( prototype, resolvedTypeArguments, @@ -897,7 +937,7 @@ export class Resolver extends DiagnosticEmitter { resolveClass( prototype: ClassPrototype, typeArguments: Type[] | null, - contextualTypeArguments: Map | null = null, + contextualTypeArguments: Map = makeMap(), reportMode: ReportMode = ReportMode.REPORT ): Class | null { var instanceKey = typeArguments ? typesToString(typeArguments) : ""; @@ -906,15 +946,6 @@ export class Resolver extends DiagnosticEmitter { var instance = prototype.instances.get(instanceKey); if (instance) return instance; - // Copy contextual type arguments so we don't pollute the original map - var inheritedTypeArguments = contextualTypeArguments; - contextualTypeArguments = new Map(); - if (inheritedTypeArguments) { - for (let [inheritedName, inheritedType] of inheritedTypeArguments) { - contextualTypeArguments.set(inheritedName, inheritedType); - } - } - // Insert contextual type arguments for this operation. Internally, this method is always // called with matching type parameter / argument counts. var declaration = prototype.declaration; @@ -993,14 +1024,20 @@ export class Resolver extends DiagnosticEmitter { } // Resolve constructor by first applying the class type arguments - if (prototype.constructorPrototype) { + var constructorPrototype = prototype.constructorPrototype; + if (constructorPrototype) { let constructorPartial = this.resolveFunctionPartially( - prototype.constructorPrototype, + constructorPrototype, typeArguments, reportMode ); if (!constructorPartial) return null; - instance.constructorInstance = this.resolveFunction(constructorPartial, null, null, reportMode); + instance.constructorInstance = this.resolveFunction( + constructorPartial, + null, + makeMap(), + reportMode + ); } // Resolve instance members @@ -1125,9 +1162,19 @@ export class Resolver extends DiagnosticEmitter { reportMode ); if (!operatorPartial) continue; - operatorInstance = this.resolveFunction(operatorPartial, null, null, reportMode); + operatorInstance = this.resolveFunction( + operatorPartial, + null, + makeMap(), + reportMode + ); } else { - operatorInstance = this.resolveFunction(overloadPrototype, null, null, reportMode); + operatorInstance = this.resolveFunction( + overloadPrototype, + null, + makeMap(), + reportMode + ); } if (!operatorInstance) continue; let overloads = instance.overloads; @@ -1141,7 +1188,7 @@ export class Resolver extends DiagnosticEmitter { resolveClassInclTypeArguments( prototype: ClassPrototype, typeArgumentNodes: CommonTypeNode[] | null, - contextualTypeArguments: Map | null, + contextualTypeArguments: Map, reportNode: Node, reportMode: ReportMode = ReportMode.REPORT ): Class | null { @@ -1149,21 +1196,8 @@ export class Resolver extends DiagnosticEmitter { // Resolve type arguments if generic if (prototype.is(CommonFlags.GENERIC)) { - let typeParameterNodes = prototype.declaration.typeParameters; - let expectedTypeArguments = typeParameterNodes.length; - assert(expectedTypeArguments > 0); - let actualTypeArguments = typeArgumentNodes !== null ? typeArgumentNodes.length : 0; - if (expectedTypeArguments != actualTypeArguments) { - if (reportMode == ReportMode.REPORT) { - this.error( - DiagnosticCode.Expected_0_type_arguments_but_got_1, - reportNode.range, expectedTypeArguments.toString(10), actualTypeArguments.toString(10) - ); - } - return null; - } resolvedTypeArguments = this.resolveTypeArguments( - typeParameterNodes, + assert(prototype.declaration.typeParameters), typeArgumentNodes, contextualTypeArguments, reportNode, diff --git a/src/util/collections.ts b/src/util/collections.ts new file mode 100644 index 00000000..921d497a --- /dev/null +++ b/src/util/collections.ts @@ -0,0 +1,26 @@ +export function makeArray(original: Array | null = null): Array { + if (original) { + let cloned = new Array(original.length); + for (let i = 0, k = original.length; i < k; ++i) unchecked(cloned[i] = original[i]); + return cloned; + } + return new Array(); +} + +export function makeSet(original: Set | null = null): Set { + if (original) { + let cloned = new Set(); + for (let v of original) cloned.add(v); + return cloned; + } + return new Set(); +} + +export function makeMap(original: Map | null = null): Map { + if (original) { + let cloned = new Map(); + for (let [k, v] of original) cloned.set(k, v); + return cloned; + } + return new Map(); +} diff --git a/src/util/index.ts b/src/util/index.ts index 5b23eacc..c9f54137 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -5,6 +5,7 @@ *//***/ export * from "./charcode"; +export * from "./collections"; export * from "./path"; export * from "./text"; export * from "./binary"; diff --git a/std/assembly/array.ts b/std/assembly/array.ts index dc77c3e3..93a9cf2d 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -3,8 +3,8 @@ import { HEADER_SIZE, allocateUnsafe, reallocateUnsafe, - loadUnsafe, - storeUnsafe + LOAD, + STORE } from "./internal/arraybuffer"; import { @@ -32,6 +32,7 @@ import { } from "./builtins"; export class Array { + [key: number]: T; // compatibility only /* @internal */ buffer_: ArrayBuffer; /* @internal */ length_: i32; @@ -74,7 +75,7 @@ export class Array { every(callbackfn: (element: T, index: i32, array: Array) => bool): bool { var buffer = this.buffer_; for (let index = 0, toIndex = this.length_; index < toIndex && index < this.length_; ++index) { - if (!callbackfn(loadUnsafe(buffer, index), index, this)) return false; + if (!callbackfn(LOAD(buffer, index), index, this)) return false; } return true; } @@ -82,7 +83,7 @@ export class Array { findIndex(predicate: (element: T, index: i32, array: Array) => bool): i32 { var buffer = this.buffer_; for (let index = 0, toIndex = this.length_; index < toIndex && index < this.length_; ++index) { - if (predicate(loadUnsafe(buffer, index), index, this)) return index; + if (predicate(LOAD(buffer, index), index, this)) return index; } return -1; } @@ -91,13 +92,13 @@ export class Array { private __get(index: i32): T { var buffer = this.buffer_; return index < (buffer.byteLength >>> alignof()) - ? loadUnsafe(buffer, index) + ? LOAD(buffer, index) : unreachable(); } @operator("{}") private __unchecked_get(index: i32): T { - return loadUnsafe(this.buffer_, index); + return LOAD(this.buffer_, index); } @operator("[]=") @@ -111,13 +112,13 @@ export class Array { this.buffer_ = buffer; this.length_ = index + 1; } - storeUnsafe(buffer, index, value); + STORE(buffer, index, value); if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line } @operator("{}=") private __unchecked_set(index: i32, value: T): void { - storeUnsafe(this.buffer_, index, value); + STORE(this.buffer_, index, value); if (isManaged()) __gc_link(changetype(this), changetype(value)); // tslint:disable-line } @@ -138,7 +139,7 @@ export class Array { } } else { for (; start < end; ++start) { - storeUnsafe(buffer, start, value); + STORE(buffer, start, value); } } return this; @@ -155,7 +156,7 @@ export class Array { if (fromIndex < 0) fromIndex = max(length + fromIndex, 0); var buffer = this.buffer_; while (fromIndex < length) { - if (loadUnsafe(buffer, fromIndex) == searchElement) return fromIndex; + if (LOAD(buffer, fromIndex) == searchElement) return fromIndex; ++fromIndex; } return -1; @@ -168,7 +169,7 @@ export class Array { else if (fromIndex >= length) fromIndex = length - 1; var buffer = this.buffer_; while (fromIndex >= 0) { // ^ - if (loadUnsafe(buffer, fromIndex) == searchElement) return fromIndex; + if (LOAD(buffer, fromIndex) == searchElement) return fromIndex; --fromIndex; } return -1; @@ -186,7 +187,7 @@ export class Array { this.buffer_ = buffer; } this.length_ = newLength; - storeUnsafe(buffer, length, element); + STORE(buffer, length, element); if (isManaged()) __gc_link(changetype(this), changetype(element)); // tslint:disable-line return newLength; } @@ -228,7 +229,7 @@ export class Array { from += count - 1; to += count - 1; while (count) { - storeUnsafe(buffer, to, loadUnsafe(buffer, from)); + STORE(buffer, to, LOAD(buffer, from)); --from, --to, --count; } } else { @@ -244,7 +245,7 @@ export class Array { pop(): T { var length = this.length_; if (length < 1) throw new RangeError("Array is empty"); - var element = loadUnsafe(this.buffer_, --length); + var element = LOAD(this.buffer_, --length); this.length_ = length; return element; } @@ -252,7 +253,7 @@ export class Array { forEach(callbackfn: (value: T, index: i32, array: Array) => void): void { var buffer = this.buffer_; for (let index = 0, toIndex = this.length_; index < toIndex && index < this.length_; ++index) { - callbackfn(loadUnsafe(buffer, index), index, this); + callbackfn(LOAD(buffer, index), index, this); } } @@ -262,7 +263,7 @@ export class Array { var result = new Array(length); var resultBuffer = result.buffer_; for (let index = 0; index < length && index < this.length_; ++index) { - storeUnsafe(resultBuffer, index, callbackfn(loadUnsafe(buffer, index), index, this)); + STORE(resultBuffer, index, callbackfn(LOAD(buffer, index), index, this)); } return result; } @@ -272,7 +273,7 @@ export class Array { var length = this.length_; var result = new Array(); for (let index = 0; index < length && index < this.length_; ++index) { - let value = loadUnsafe(buffer, index); + let value = LOAD(buffer, index); if (callbackfn(value, index, this)) result.push(value); } return result; @@ -285,7 +286,7 @@ export class Array { var accum = initialValue; var buffer = this.buffer_; for (let index = 0, toIndex = this.length_; index < toIndex && index < this.length_; ++index) { - accum = callbackfn(accum, loadUnsafe(buffer, index), index, this); + accum = callbackfn(accum, LOAD(buffer, index), index, this); } return accum; } @@ -297,7 +298,7 @@ export class Array { var accum = initialValue; var buffer = this.buffer_; for (let index: i32 = this.length_ - 1; index >= 0; --index) { - accum = callbackfn(accum, loadUnsafe(buffer, index), index, this); + accum = callbackfn(accum, LOAD(buffer, index), index, this); } return accum; } @@ -306,14 +307,14 @@ export class Array { var length = this.length_; if (length < 1) throw new RangeError("Array is empty"); var buffer = this.buffer_; - var element = loadUnsafe(buffer, 0); + var element = LOAD(buffer, 0); var lastIndex = length - 1; memory.copy( changetype(buffer) + HEADER_SIZE, changetype(buffer) + HEADER_SIZE + sizeof(), lastIndex << alignof() ); - storeUnsafe(buffer, lastIndex, null); + STORE(buffer, lastIndex, null); this.length_ = lastIndex; return element; } @@ -321,7 +322,7 @@ export class Array { some(callbackfn: (element: T, index: i32, array: Array) => bool): bool { var buffer = this.buffer_; for (let index = 0, toIndex = this.length_; index < toIndex && index < this.length_; ++index) { - if (callbackfn(loadUnsafe(buffer, index), index, this)) return true; + if (callbackfn(LOAD(buffer, index), index, this)) return true; } return false; } @@ -343,7 +344,7 @@ export class Array { changetype(buffer) + HEADER_SIZE, (capacity - 1) << alignof() ); - storeUnsafe(buffer, 0, element); + STORE(buffer, 0, element); this.length_ = newLength; if (isManaged()) __gc_link(changetype(this), changetype(element)); // tslint:disable-line return newLength; @@ -396,9 +397,9 @@ export class Array { reverse(): Array { var buffer = this.buffer_; for (let front = 0, back = this.length_ - 1; front < back; ++front, --back) { - let temp = loadUnsafe(buffer, front); - storeUnsafe(buffer, front, loadUnsafe(buffer, back)); - storeUnsafe(buffer, back, temp); + let temp = LOAD(buffer, front); + STORE(buffer, front, LOAD(buffer, back)); + STORE(buffer, back, temp); } return this; } @@ -411,11 +412,11 @@ export class Array { if (length <= 1) return this; var buffer = this.buffer_; if (length == 2) { - let a = loadUnsafe(buffer, 1); // a = arr[1] - let b = loadUnsafe(buffer, 0); // b = arr[0] + let a = LOAD(buffer, 1); // a = arr[1] + let b = LOAD(buffer, 0); // b = arr[0] if (comparator(a, b) < 0) { - storeUnsafe(buffer, 1, b); // arr[1] = b; - storeUnsafe(buffer, 0, a); // arr[0] = a; + STORE(buffer, 1, b); // arr[1] = b; + STORE(buffer, 0, a); // arr[0] = a; } return this; } @@ -444,14 +445,14 @@ export class Array { var hasSeparator = sepLen != 0; if (value instanceof bool) { if (!lastIndex) { - return select("true", "false", loadUnsafe(buffer, 0)); + return select("true", "false", LOAD(buffer, 0)); } let valueLen = 5; // max possible length of element len("false") let estLen = (valueLen + sepLen) * lastIndex + valueLen; let result = allocateUnsafeString(estLen); let offset = 0; for (let i = 0; i < lastIndex; ++i) { - value = loadUnsafe(buffer, i); + value = LOAD(buffer, i); valueLen = 4 + (!value); copyUnsafeString(result, offset, select("true", "false", value), 0, valueLen); offset += valueLen; @@ -460,7 +461,7 @@ export class Array { offset += sepLen; } } - value = loadUnsafe(buffer, lastIndex); + value = LOAD(buffer, lastIndex); valueLen = 4 + (!value); copyUnsafeString(result, offset, select("true", "false", value), 0, valueLen); offset += valueLen; @@ -473,21 +474,21 @@ export class Array { return out; } else if (isInteger()) { if (!lastIndex) { - return changetype(itoa(loadUnsafe(buffer, 0))); + return changetype(itoa(LOAD(buffer, 0))); } const valueLen = (sizeof() <= 4 ? 10 : 20) + isSigned(); let estLen = (valueLen + sepLen) * lastIndex + valueLen; let result = allocateUnsafeString(estLen); let offset = 0; for (let i = 0; i < lastIndex; ++i) { - value = loadUnsafe(buffer, i); + value = LOAD(buffer, i); offset += itoa_stream(changetype(result), offset, value); if (hasSeparator) { copyUnsafeString(result, offset, separator, 0, sepLen); offset += sepLen; } } - value = loadUnsafe(buffer, lastIndex); + value = LOAD(buffer, lastIndex); offset += itoa_stream(changetype(result), offset, value); let out = result; if (estLen > offset) { @@ -497,21 +498,21 @@ export class Array { return out; } else if (isFloat()) { if (!lastIndex) { - return changetype(dtoa(loadUnsafe(buffer, 0))); + return changetype(dtoa(LOAD(buffer, 0))); } const valueLen = MAX_DOUBLE_LENGTH; let estLen = (valueLen + sepLen) * lastIndex + valueLen; let result = allocateUnsafeString(estLen); let offset = 0; for (let i = 0; i < lastIndex; ++i) { - value = loadUnsafe(buffer, i); + value = LOAD(buffer, i); offset += dtoa_stream(changetype(result), offset, value); if (hasSeparator) { copyUnsafeString(result, offset, separator, 0, sepLen); offset += sepLen; } } - value = loadUnsafe(buffer, lastIndex); + value = LOAD(buffer, lastIndex); offset += dtoa_stream(changetype(result), offset, value); let out = result; if (estLen > offset) { @@ -521,16 +522,16 @@ export class Array { return out; } else if (isString()) { if (!lastIndex) { - return loadUnsafe(buffer, 0); + return LOAD(buffer, 0); } let estLen = 0; for (let i = 0, len = lastIndex + 1; i < len; ++i) { - estLen += loadUnsafe(buffer, i).length; + estLen += LOAD(buffer, i).length; } let offset = 0; let result = allocateUnsafeString(estLen + sepLen * lastIndex); for (let i = 0; i < lastIndex; ++i) { - value = loadUnsafe(buffer, i); + value = LOAD(buffer, i); if (value) { let valueLen = value.length; // tslint:disable-line:no-unsafe-any copyUnsafeString(result, offset, value, 0, valueLen); // tslint:disable-line:no-unsafe-any @@ -541,7 +542,7 @@ export class Array { offset += sepLen; } } - value = loadUnsafe(buffer, lastIndex); + value = LOAD(buffer, lastIndex); if (value) { let valueLen = value.length; // tslint:disable-line:no-unsafe-any copyUnsafeString(result, offset, value, 0, valueLen); // tslint:disable-line:no-unsafe-any @@ -549,15 +550,15 @@ export class Array { return result; } else if (isArray()) { if (!lastIndex) { - value = loadUnsafe(buffer, 0); + value = LOAD(buffer, 0); return value ? value.join(separator) : ""; // tslint:disable-line:no-unsafe-any } for (let i = 0; i < lastIndex; ++i) { - value = loadUnsafe(buffer, i); + value = LOAD(buffer, i); if (value) result += value.join(separator); // tslint:disable-line:no-unsafe-any if (hasSeparator) result += separator; } - value = loadUnsafe(buffer, lastIndex); + value = LOAD(buffer, lastIndex); if (value) result += value.join(separator); // tslint:disable-line:no-unsafe-any return result; } else if (isReference()) { // References @@ -567,7 +568,7 @@ export class Array { let result = allocateUnsafeString(estLen); let offset = 0; for (let i = 0; i < lastIndex; ++i) { - value = loadUnsafe(buffer, i); + value = LOAD(buffer, i); if (value) { copyUnsafeString(result, offset, changetype("[object Object]"), 0, valueLen); offset += valueLen; @@ -577,7 +578,7 @@ export class Array { offset += sepLen; } } - if (loadUnsafe(buffer, lastIndex)) { + if (LOAD(buffer, lastIndex)) { copyUnsafeString(result, offset, changetype("[object Object]"), 0, valueLen); offset += valueLen; } diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index dbba2482..a2e3a9fb 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -365,6 +365,8 @@ declare namespace f64 { /** Converts A string to an integer. */ export function parseInt(string: string, radix?: i32): f64; } +/** Macro type evaluating to the underlying native WebAssembly type. */ +declare type NATIVE = T; // User-defined diagnostic macros diff --git a/std/assembly/internal/array.ts b/std/assembly/internal/array.ts index 846b759a..4f3b8873 100644 --- a/std/assembly/internal/array.ts +++ b/std/assembly/internal/array.ts @@ -1,6 +1,6 @@ import { - loadUnsafeWithOffset, - storeUnsafeWithOffset + LOAD, + STORE } from "./arraybuffer"; import { @@ -52,15 +52,15 @@ export function insertionSort( comparator: (a: T, b: T) => i32 ): void { for (let i = 0; i < length; i++) { - let a = loadUnsafeWithOffset(buffer, i, byteOffset); // a = arr[i] + let a = LOAD(buffer, i, byteOffset); // a = arr[i] let j = i - 1; while (j >= 0) { - let b = loadUnsafeWithOffset(buffer, j, byteOffset); // b = arr[j] + let b = LOAD(buffer, j, byteOffset); // b = arr[j] if (comparator(a, b) < 0) { - storeUnsafeWithOffset(buffer, j-- + 1, b, byteOffset); // arr[j + 1] = b + STORE(buffer, j-- + 1, b, byteOffset); // arr[j + 1] = b } else break; } - storeUnsafeWithOffset(buffer, j + 1, a, byteOffset); // arr[j + 1] = a + STORE(buffer, j + 1, a, byteOffset); // arr[j + 1] = a } } @@ -84,37 +84,37 @@ export function weakHeapSort( while ((j & 1) == (load(bitset + (j >> 6 << shift32)) >> (j >> 1 & 31) & 1)) j >>= 1; let p = j >> 1; - let a = loadUnsafeWithOffset(buffer, p, byteOffset); // a = arr[p] - let b = loadUnsafeWithOffset(buffer, i, byteOffset); // b = arr[i] + let a = LOAD(buffer, p, byteOffset); // a = arr[p] + let b = LOAD(buffer, i, byteOffset); // b = arr[i] if (comparator(a, b) < 0) { store( bitset + (i >> 5 << shift32), load(bitset + (i >> 5 << shift32)) ^ (1 << (i & 31)) ); - storeUnsafeWithOffset(buffer, i, a, byteOffset); // arr[i] = a - storeUnsafeWithOffset(buffer, p, b, byteOffset); // arr[p] = b + STORE(buffer, i, a, byteOffset); // arr[i] = a + STORE(buffer, p, b, byteOffset); // arr[p] = b } } for (let i = length - 1; i >= 2; i--) { - let a = loadUnsafeWithOffset(buffer, 0, byteOffset); - storeUnsafeWithOffset(buffer, 0, loadUnsafeWithOffset(buffer, i, byteOffset), byteOffset); - storeUnsafeWithOffset(buffer, i, a, byteOffset); + let a = LOAD(buffer, 0, byteOffset); + STORE(buffer, 0, LOAD(buffer, i, byteOffset), byteOffset); + STORE(buffer, i, a, byteOffset); let x = 1, y: i32; while ((y = (x << 1) + ((load(bitset + (x >> 5 << shift32)) >> (x & 31)) & 1)) < i) x = y; while (x > 0) { - a = loadUnsafeWithOffset(buffer, 0, byteOffset); // a = arr[0] - let b = loadUnsafeWithOffset(buffer, x, byteOffset); // b = arr[x] + a = LOAD(buffer, 0, byteOffset); // a = arr[0] + let b = LOAD(buffer, x, byteOffset); // b = arr[x] if (comparator(a, b) < 0) { store( bitset + (x >> 5 << shift32), load(bitset + (x >> 5 << shift32)) ^ (1 << (x & 31)) ); - storeUnsafeWithOffset(buffer, x, a, byteOffset); // arr[x] = a - storeUnsafeWithOffset(buffer, 0, b, byteOffset); // arr[0] = b + STORE(buffer, x, a, byteOffset); // arr[x] = a + STORE(buffer, 0, b, byteOffset); // arr[0] = b } x >>= 1; } @@ -122,7 +122,7 @@ export function weakHeapSort( memory.free(bitset); - var t = loadUnsafeWithOffset(buffer, 1, byteOffset); // t = arr[1] - storeUnsafeWithOffset(buffer, 1, loadUnsafeWithOffset(buffer, 0, byteOffset), byteOffset); - storeUnsafeWithOffset(buffer, 0, t, byteOffset); // arr[0] = t + var t = LOAD(buffer, 1, byteOffset); // t = arr[1] + STORE(buffer, 1, LOAD(buffer, 0, byteOffset), byteOffset); + STORE(buffer, 0, t, byteOffset); // arr[0] = t } diff --git a/std/assembly/internal/arraybuffer.ts b/std/assembly/internal/arraybuffer.ts index 9833116a..0c15601e 100644 --- a/std/assembly/internal/arraybuffer.ts +++ b/std/assembly/internal/arraybuffer.ts @@ -71,33 +71,13 @@ export function reallocateUnsafe(buffer: ArrayBuffer, newByteLength: i32): Array // * `i32.load8` ^= `load(...)` that reads an i8 but returns an i32, or // * `i64.load32_s` ^= `load(...)`) that reads a 32-bit as a 64-bit integer // -// without having to emit an additional instruction for conversion purposes. This is useful for -// small integers only of course. When dealing with reference types like classes, both parameters -// are usually the same, even though it looks ugly. -// -// TODO: is there a better way to model this? +// without having to emit an additional instruction for conversion purposes. The second parameter +// can be omitted for references and other loads and stores that simply return the exact type. -@inline export function loadUnsafe(buffer: ArrayBuffer, index: i32): TOut { - return load(changetype(buffer) + (index << alignof()), HEADER_SIZE); +@inline export function LOAD(buffer: ArrayBuffer, index: i32, byteOffset: i32 = 0): TOut { + return load(changetype(buffer) + (index << alignof()) + byteOffset, HEADER_SIZE); } -@inline export function storeUnsafe(buffer: ArrayBuffer, index: i32, value: TIn): void { - store(changetype(buffer) + (index << alignof()), value, HEADER_SIZE); -} - -@inline export function loadUnsafeWithOffset( - buffer: ArrayBuffer, - index: i32, - byteOffset: i32 -): TOut { - return load(changetype(buffer) + byteOffset + (index << alignof()), HEADER_SIZE); -} - -@inline export function storeUnsafeWithOffset( - buffer: ArrayBuffer, - index: i32, - value: TIn, - byteOffset: i32 -): void { - store(changetype(buffer) + byteOffset + (index << alignof()), value, HEADER_SIZE); +@inline export function STORE(buffer: ArrayBuffer, index: i32, value: TIn, byteOffset: i32 = 0): void { + store(changetype(buffer) + (index << alignof()) + byteOffset, value, HEADER_SIZE); } diff --git a/std/assembly/internal/number.ts b/std/assembly/internal/number.ts index bd674085..ab3b6f63 100644 --- a/std/assembly/internal/number.ts +++ b/std/assembly/internal/number.ts @@ -7,7 +7,7 @@ import { } from "./string"; import { - loadUnsafe + LOAD } from "./arraybuffer"; export const MAX_DOUBLE_LENGTH = 28; @@ -124,7 +124,7 @@ export function decimalCount32(value: u32): u32 { let t = l * 1233 >>> 12; // log10 let lutbuf = POWERS10().buffer_; - let power = loadUnsafe(lutbuf, t); + let power = LOAD(lutbuf, t); t -= (value < power); return t + 1; } else { @@ -154,7 +154,7 @@ export function decimalCount64(value: u64): u32 { let t = l * 1233 >>> 12; // log10 let lutbuf = POWERS10().buffer_; - let power = loadUnsafe(lutbuf, t - 10); + let power = LOAD(lutbuf, t - 10); t -= (value < 10000000000 * power); return t + 1; } else { @@ -188,8 +188,8 @@ function utoa32_lut(buffer: usize, num: u32, offset: usize): void { let d1 = r / 100; let d2 = r % 100; - let digits1 = loadUnsafe(lutbuf, d1); - let digits2 = loadUnsafe(lutbuf, d2); + let digits1 = LOAD(lutbuf, d1); + let digits2 = LOAD(lutbuf, d2); offset -= 4; store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE); @@ -200,13 +200,13 @@ function utoa32_lut(buffer: usize, num: u32, offset: usize): void { let d1 = num % 100; num = t; offset -= 2; - let digits = loadUnsafe(lutbuf, d1); + let digits = LOAD(lutbuf, d1); store(buffer + (offset << 1), digits, STRING_HEADER_SIZE); } if (num >= 10) { offset -= 2; - let digits = loadUnsafe(lutbuf, num); + let digits = LOAD(lutbuf, num); store(buffer + (offset << 1), digits, STRING_HEADER_SIZE); } else { offset -= 1; @@ -231,14 +231,14 @@ function utoa64_lut(buffer: usize, num: u64, offset: usize): void { let c1 = c / 100; let c2 = c % 100; - let digits1 = loadUnsafe(lutbuf, c1); - let digits2 = loadUnsafe(lutbuf, c2); + let digits1 = LOAD(lutbuf, c1); + let digits2 = LOAD(lutbuf, c2); offset -= 4; store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE); - digits1 = loadUnsafe(lutbuf, b1); - digits2 = loadUnsafe(lutbuf, b2); + digits1 = LOAD(lutbuf, b1); + digits2 = LOAD(lutbuf, b2); offset -= 4; store(buffer + (offset << 1), digits1 | (digits2 << 32), STRING_HEADER_SIZE); @@ -438,8 +438,8 @@ function getCachedPower(minExp: i32): void { _K = 348 - (index << 3); // decimal exponent no need lookup table var frcPowers = FRC_POWERS().buffer_; var expPowers = EXP_POWERS().buffer_; - _frc_pow = loadUnsafe(frcPowers, index); - _exp_pow = loadUnsafe(expPowers, index); + _frc_pow = LOAD(frcPowers, index); + _exp_pow = LOAD(expPowers, index); } @inline @@ -513,7 +513,7 @@ function genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i let tmp = ((p1) << one_exp) + p2; if (tmp <= delta) { _K += kappa; - grisuRound(buffer, len, delta, tmp, loadUnsafe(powers10, kappa) << one_exp, wp_w_frc); + grisuRound(buffer, len, delta, tmp, LOAD(powers10, kappa) << one_exp, wp_w_frc); return len; } } @@ -529,7 +529,7 @@ function genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i --kappa; if (p2 < delta) { _K += kappa; - wp_w_frc *= loadUnsafe(powers10, -kappa); + wp_w_frc *= LOAD(powers10, -kappa); grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc); return len; } diff --git a/std/assembly/internal/typedarray.ts b/std/assembly/internal/typedarray.ts index c90eb654..91b65863 100644 --- a/std/assembly/internal/typedarray.ts +++ b/std/assembly/internal/typedarray.ts @@ -2,21 +2,18 @@ import { HEADER_SIZE as AB_HEADER_SIZE, MAX_BLENGTH as AB_MAX_BLENGTH, allocateUnsafe, - loadUnsafeWithOffset, - storeUnsafeWithOffset + LOAD, + STORE } from "./arraybuffer"; import { insertionSort, - weakHeapSort, - defaultComparator + weakHeapSort } from "./array"; -// The internal TypedArray class uses two type parameters for the same reason as `loadUnsafe` and -// `storeUnsafe` in 'internal/arraybuffer.ts'. See the documentation there for details. - /** Typed array base class. Not a global object. */ -export abstract class TypedArray { +export abstract class TypedArray { + [key: number]: T; // compatibility only readonly buffer: ArrayBuffer; readonly byteOffset: i32; @@ -41,116 +38,142 @@ export abstract class TypedArray { @operator("[]") protected __get(index: i32): T { if (index >= (this.byteLength >>> alignof())) throw new Error("Index out of bounds"); - return loadUnsafeWithOffset(this.buffer, index, this.byteOffset); + return LOAD(this.buffer, index, this.byteOffset); } @inline @operator("{}") protected __unchecked_get(index: i32): T { - return loadUnsafeWithOffset(this.buffer, index, this.byteOffset); + return LOAD(this.buffer, index, this.byteOffset); } @operator("[]=") - protected __set(index: i32, value: TNative): void { + protected __set(index: i32, value: NATIVE): void { if (index >= (this.byteLength >>> alignof())) throw new Error("Index out of bounds"); - storeUnsafeWithOffset(this.buffer, index, value, this.byteOffset); + STORE>(this.buffer, index, value, this.byteOffset); } @inline @operator("{}=") - protected __unchecked_set(index: i32, value: TNative): void { - storeUnsafeWithOffset(this.buffer, index, value, this.byteOffset); + protected __unchecked_set(index: i32, value: NATIVE): void { + STORE>(this.buffer, index, value, this.byteOffset); } // copyWithin(target: i32, start: i32, end: i32 = this.length): this +} - fill(value: TNative, start: i32 = 0, end: i32 = i32.MAX_VALUE): this { - var buffer = this.buffer; - var byteOffset = this.byteOffset; - var len = this.length; - start = start < 0 ? max(len + start, 0) : min(start, len); - end = end < 0 ? max(len + end, 0) : min(end, len); - if (sizeof() == 1) { - if (start < end) { - memory.fill( - changetype(buffer) + start + byteOffset + AB_HEADER_SIZE, - value, - (end - start) - ); - } - } else { - for (; start < end; ++start) { - storeUnsafeWithOffset(buffer, start, value, byteOffset); - } - } - return this; - } - - @inline - subarray(begin: i32 = 0, end: i32 = i32.MAX_VALUE): TypedArray { - var length = this.length; - if (begin < 0) begin = max(length + begin, 0); - else begin = min(begin, length); - if (end < 0) end = max(length + end, begin); - else end = max(min(end, length), begin); - var slice = memory.allocate(offsetof()); - store(slice, this.buffer, offsetof("buffer")); - store(slice, this.byteOffset + (begin << alignof()), offsetof("byteOffset")); - store(slice, (end - begin) << alignof(), offsetof("byteLength")); - return changetype(slice); - } - - sort(comparator: (a: T, b: T) => i32 = defaultComparator()): this { - var byteOffset = this.byteOffset; - var length = this.length; - if (length <= 1) return this; - var buffer = this.buffer; - if (length == 2) { - let a = loadUnsafeWithOffset(buffer, 1, byteOffset); - let b = loadUnsafeWithOffset(buffer, 0, byteOffset); - if (comparator(a, b) < 0) { - storeUnsafeWithOffset(buffer, 1, b, byteOffset); - storeUnsafeWithOffset(buffer, 0, a, byteOffset); - } - return this; - } - - if (isReference()) { - // TODO replace this to faster stable sort (TimSort) when it implemented - insertionSort(buffer, byteOffset, length, comparator); - return this; - } else { - if (length < 256) { - insertionSort(buffer, byteOffset, length, comparator); - } else { - weakHeapSort(buffer, byteOffset, length, comparator); - } - return this; - } - } - - /** - * TypedArray reduce implementation. This is a method that will be called from the parent, - * passing types down from the child class using the typed parameters TypedArrayType and - * ReturnType respectively. This implementation requires an initial value, and the direction. - * When direction is true, reduce will reduce from the right side. - */ - @inline - protected reduce_internal( - callbackfn: (accumulator: ReturnType, value: T, index: i32, array: TypedArrayType) => ReturnType, - array: TypedArrayType, - initialValue: ReturnType, - direction: bool = false, - ): ReturnType { - var index: i32 = direction ? this.length - 1 : 0; - var length: i32 = direction ? -1 : this.length; - while (index != length) { - initialValue = callbackfn( - initialValue, - this.__unchecked_get(index), - index, - array, +@inline +export function FILL, T>( + array: TArray, + value: NATIVE, + start: i32, + end: i32 +): TArray { + var buffer = array.buffer; + var byteOffset = array.byteOffset; + var len = array.length; + start = start < 0 ? max(len + start, 0) : min(start, len); + end = end < 0 ? max(len + end, 0) : min(end, len); + if (sizeof() == 1) { + if (start < end) { + memory.fill( + changetype(buffer) + start + byteOffset + AB_HEADER_SIZE, + value, + (end - start) ); - index = direction ? index - 1 : index + 1; } - return initialValue; + } else { + for (; start < end; ++start) { + STORE>(buffer, start, value, byteOffset); + } + } + return array; +} + +@inline +export function SORT, T>( + array: TArray, + comparator: (a: T, b: T) => i32 +): TArray { + var byteOffset = array.byteOffset; + var length = array.length; + if (length <= 1) return array; + var buffer = array.buffer; + if (length == 2) { + let a = LOAD(buffer, 1, byteOffset); + let b = LOAD(buffer, 0, byteOffset); + if (comparator(a, b) < 0) { + STORE(buffer, 1, b, byteOffset); + STORE(buffer, 0, a, byteOffset); + } + return array; + } + if (isReference()) { + // TODO replace this to faster stable sort (TimSort) when it implemented + insertionSort(buffer, byteOffset, length, comparator); + return array; + } else { + if (length < 256) { + insertionSort(buffer, byteOffset, length, comparator); + } else { + weakHeapSort(buffer, byteOffset, length, comparator); + } + return array; } } + +@inline +export function SUBARRAY, T>( + array: TArray, + begin: i32, + end: i32 +): TArray { + var length = array.length; + if (begin < 0) begin = max(length + begin, 0); + else begin = min(begin, length); + if (end < 0) end = max(length + end, begin); + else end = max(min(end, length), begin); + var slice = memory.allocate(offsetof()); + store(slice, array.buffer, offsetof("buffer")); + store(slice, array.byteOffset + (begin << alignof()), offsetof("byteOffset")); + store(slice, (end - begin) << alignof(), offsetof("byteLength")); + return changetype(slice); +} + +@inline +export function REDUCE, T, TRet>( + array: TArray, + callbackfn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet, + initialValue: TRet +): TRet { + var index = 0; + var length = array.length; + while (index != length) { + initialValue = callbackfn( + initialValue, + unchecked(array[index]), + index, + array, + ); + ++index; + } + return initialValue; +} + +@inline +export function REDUCE_RIGHT, T, TRet>( + array: TArray, + callbackfn: (accumulator: TRet, value: T, index: i32, array: TArray) => TRet, + initialValue: TRet +): TRet { + var index = array.length - 1; + var length = -1; + while (index != length) { + initialValue = callbackfn( + initialValue, + unchecked(array[index]), + index, + array, + ); + --index; + } + return initialValue; +} diff --git a/std/assembly/string.ts b/std/assembly/string.ts index 8d5eb378..857848de 100644 --- a/std/assembly/string.ts +++ b/std/assembly/string.ts @@ -11,7 +11,7 @@ import { } from "./internal/string"; import { - storeUnsafe as storeUnsafeArray + STORE } from "./internal/arraybuffer"; @sealed @@ -436,7 +436,7 @@ export class String { ), HEADER_SIZE ); - storeUnsafeArray(buffer, i, char); + STORE(buffer, i, char); } return result; } else if (!length) { diff --git a/std/assembly/typedarray.ts b/std/assembly/typedarray.ts index 84a1ccb2..77455c74 100644 --- a/std/assembly/typedarray.ts +++ b/std/assembly/typedarray.ts @@ -1,52 +1,77 @@ import { - TypedArray + TypedArray, + FILL, + SORT, + SUBARRAY, + REDUCE, + REDUCE_RIGHT } from "./internal/typedarray"; -export class Int8Array extends TypedArray { +import { + defaultComparator +} from "./internal/array"; + +export class Int8Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int8Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: i8, b: i8) => i32 = defaultComparator()): Int8Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int8Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: i8, index: i32, array: Int8Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: i8, index: i32, array: Int8Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: i8, index: i32, array: Int8Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Uint8Array extends TypedArray { +export class Uint8Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint8Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: u8, b: u8) => i32 = defaultComparator()): Uint8Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint8Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: u8, index: i32, array: Uint8Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: u8, index: i32, array: Uint8Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: u8, index: i32, array: Uint8Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Uint8ClampedArray extends TypedArray { +export class Uint8ClampedArray extends Uint8Array { static readonly BYTES_PER_ELEMENT: usize = sizeof(); @inline @operator("[]=") @@ -58,202 +83,244 @@ export class Uint8ClampedArray extends TypedArray { protected __unchecked_set(index: i32, value: i32): void { super.__unchecked_set(index, max(min(value, 255), 0)); } - - subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint8ClampedArray { - return changetype(super.subarray(begin, end)); - } - - reduce( - callbackfn: (accumulator: ReturnType, value: u8, index: i32, array: Uint8ClampedArray) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); - } - - reduceRight( - callbackfn: (accumulator: ReturnType, value: u8, index: i32, array: Uint8ClampedArray) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); - } } -export class Int16Array extends TypedArray { +export class Int16Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int16Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: i16, b: i16) => i32 = defaultComparator()): Int16Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int16Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: i16, index: i32, array: Int16Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: i16, index: i32, array: Int16Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: i16, index: i32, array: Int16Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Uint16Array extends TypedArray { +export class Uint16Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint16Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: u16, b: u16) => i32 = defaultComparator()): Uint16Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint16Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: u16, index: i32, array: Uint16Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: u16, index: i32, array: Uint16Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: u16, index: i32, array: Uint16Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Int32Array extends TypedArray { +export class Int32Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: i32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int32Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: i32, b: i32) => i32 = defaultComparator()): Int32Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int32Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - /** - * @param callbackfn {function} - a function that reduces each value to a ReturnType - * @param initialValue {ReturnType} - the initial ReturnType value to be passed to the callbackfn - */ - reduce( - callbackfn: (accumulator: ReturnType, value: i32, index: i32, array: Int32Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: i32, index: i32, array: Int32Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: i32, index: i32, array: Int32Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Uint32Array extends TypedArray { +export class Uint32Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: u32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint32Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: u32, b: u32) => i32 = defaultComparator()): Uint32Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint32Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: u32, index: i32, array: Uint32Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: u32, index: i32, array: Uint32Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: u32, index: i32, array: Uint32Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Int64Array extends TypedArray { +export class Int64Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: i64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Int64Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: i64, b: i64) => i32 = defaultComparator()): Int64Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Int64Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: i64, index: i32, array: Int64Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: i64, index: i32, array: Int64Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: i64, index: i32, array: Int64Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Uint64Array extends TypedArray { +export class Uint64Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: u64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Uint64Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: u64, b: u64) => i32 = defaultComparator()): Uint64Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Uint64Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: u64, index: i32, array: Uint64Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: u64, index: i32, array: Uint64Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: u64, index: i32, array: Uint64Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Float32Array extends TypedArray { +export class Float32Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: f32, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float32Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: f32, b: f32) => i32 = defaultComparator()): Float32Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Float32Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: f32, index: i32, array: Float32Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: f32, index: i32, array: Float32Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: f32, index: i32, array: Float32Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } -export class Float64Array extends TypedArray { +export class Float64Array extends TypedArray { static readonly BYTES_PER_ELEMENT: usize = sizeof(); + fill(value: f64, start: i32 = 0, end: i32 = i32.MAX_VALUE): Float64Array { + return FILL(this, value, start, end); + } + + sort(comparator: (a: f64, b: f64) => i32 = defaultComparator()): Float64Array { + return SORT(this, comparator); + } + subarray(begin: i32 = 0, end: i32 = 0x7fffffff): Float64Array { - return changetype(super.subarray(begin, end)); + return SUBARRAY(this, begin, end); } - reduce( - callbackfn: (accumulator: ReturnType, value: f64, index: i32, array: Float64Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue); + reduce( + callbackfn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T, + initialValue: T, + ): T { + return REDUCE(this, callbackfn, initialValue); } - reduceRight( - callbackfn: (accumulator: ReturnType, value: f64, index: i32, array: Float64Array) => ReturnType, - initialValue: ReturnType, - ): ReturnType { - return super.reduce_internal(callbackfn, this, initialValue, true); + reduceRight( + callbackfn: (accumulator: T, value: f64, index: i32, array: Float64Array) => T, + initialValue: T, + ): T { + return REDUCE_RIGHT(this, callbackfn, initialValue); } } diff --git a/tests/compiler/optional-typeparameters.optimized.wat b/tests/compiler/optional-typeparameters.optimized.wat new file mode 100644 index 00000000..a5269c56 --- /dev/null +++ b/tests/compiler/optional-typeparameters.optimized.wat @@ -0,0 +1,91 @@ +(module + (type $ii (func (param i32) (result i32))) + (type $v (func)) + (memory $0 0) + (table $0 1 anyfunc) + (elem (i32.const 0) $null) + (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) + (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $optional-typeparameters/tConcrete (mut i32) (i32.const 0)) + (global $optional-typeparameters/tDerived (mut i32) (i32.const 0)) + (export "memory" (memory $0)) + (export "table" (table $0)) + (start $start) + (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.const 1073741824 + i32.gt_u + if + unreachable + end + get_global $~lib/allocator/arena/offset + tee_local $1 + get_local $0 + i32.const 1 + get_local $0 + i32.const 1 + i32.gt_u + select + i32.add + i32.const 7 + i32.add + i32.const -8 + i32.and + tee_local $2 + current_memory + tee_local $3 + i32.const 16 + i32.shl + i32.gt_u + if + get_local $3 + get_local $2 + get_local $1 + i32.sub + i32.const 65535 + i32.add + i32.const -65536 + i32.and + i32.const 16 + i32.shr_u + tee_local $0 + get_local $3 + get_local $0 + i32.gt_s + select + grow_memory + i32.const 0 + i32.lt_s + if + get_local $0 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + get_local $2 + set_global $~lib/allocator/arena/offset + get_local $1 + ) + (func $start (; 1 ;) (type $v) + i32.const 8 + set_global $~lib/allocator/arena/startOffset + get_global $~lib/allocator/arena/startOffset + set_global $~lib/allocator/arena/offset + i32.const 0 + call $~lib/allocator/arena/__memory_allocate + set_global $optional-typeparameters/tConcrete + i32.const 0 + call $~lib/allocator/arena/__memory_allocate + set_global $optional-typeparameters/tDerived + ) + (func $null (; 2 ;) (type $v) + nop + ) +) diff --git a/tests/compiler/optional-typeparameters.ts b/tests/compiler/optional-typeparameters.ts new file mode 100644 index 00000000..d4361fb1 --- /dev/null +++ b/tests/compiler/optional-typeparameters.ts @@ -0,0 +1,28 @@ +function testConcrete(a: T): U { + return a; +} + +function testDerived(a: T): U { + return a; +} + +testConcrete(1); +testDerived(2); + +class TestConcrete { + test(a: T, b: U): V { + return a + b; + } +} + +class TestDerived { + test(a: T, b: U): V { + return a + b; + } +} + +import "allocator/arena"; +var tConcrete = new TestConcrete(); +tConcrete.test(1, 2); +var tDerived = new TestDerived() +tDerived.test(1, 2); diff --git a/tests/compiler/optional-typeparameters.untouched.wat b/tests/compiler/optional-typeparameters.untouched.wat new file mode 100644 index 00000000..bdc16116 --- /dev/null +++ b/tests/compiler/optional-typeparameters.untouched.wat @@ -0,0 +1,166 @@ +(module + (type $ii (func (param i32) (result i32))) + (type $iiii (func (param i32 i32 i32) (result i32))) + (type $iFFF (func (param i32 f64 f64) (result f64))) + (type $v (func)) + (memory $0 0) + (table $0 1 anyfunc) + (elem (i32.const 0) $null) + (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) + (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) + (global $~lib/internal/allocator/AL_MASK i32 (i32.const 7)) + (global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824)) + (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) + (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) + (global $optional-typeparameters/tConcrete (mut i32) (i32.const 0)) + (global $optional-typeparameters/tDerived (mut i32) (i32.const 0)) + (global $HEAP_BASE i32 (i32.const 8)) + (export "memory" (memory $0)) + (export "table" (table $0)) + (start $start) + (func $optional-typeparameters/testConcrete (; 0 ;) (type $ii) (param $0 i32) (result i32) + get_local $0 + ) + (func $optional-typeparameters/testDerived (; 1 ;) (type $ii) (param $0 i32) (result i32) + get_local $0 + ) + (func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + get_local $0 + get_global $~lib/internal/allocator/MAX_SIZE_32 + i32.gt_u + if + unreachable + end + get_global $~lib/allocator/arena/offset + set_local $1 + get_local $1 + get_local $0 + tee_local $2 + i32.const 1 + tee_local $3 + get_local $2 + get_local $3 + i32.gt_u + select + i32.add + get_global $~lib/internal/allocator/AL_MASK + i32.add + get_global $~lib/internal/allocator/AL_MASK + i32.const -1 + i32.xor + i32.and + set_local $4 + current_memory + set_local $5 + get_local $4 + get_local $5 + i32.const 16 + i32.shl + i32.gt_u + if + get_local $4 + get_local $1 + i32.sub + i32.const 65535 + i32.add + i32.const 65535 + i32.const -1 + i32.xor + i32.and + i32.const 16 + i32.shr_u + set_local $2 + get_local $5 + tee_local $3 + get_local $2 + tee_local $6 + get_local $3 + get_local $6 + i32.gt_s + select + set_local $3 + get_local $3 + grow_memory + i32.const 0 + i32.lt_s + if + get_local $2 + grow_memory + i32.const 0 + i32.lt_s + if + unreachable + end + end + end + get_local $4 + set_global $~lib/allocator/arena/offset + get_local $1 + ) + (func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32) + get_local $0 + call $~lib/allocator/arena/__memory_allocate + return + ) + (func $optional-typeparameters/TestConcrete#test (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + get_local $1 + get_local $2 + i32.add + ) + (func $optional-typeparameters/TestDerived#test (; 5 ;) (type $iFFF) (param $0 i32) (param $1 f64) (param $2 f64) (result f64) + get_local $1 + get_local $2 + f64.add + ) + (func $start (; 6 ;) (type $v) + (local $0 i32) + i32.const 1 + call $optional-typeparameters/testConcrete + drop + i32.const 2 + call $optional-typeparameters/testDerived + drop + get_global $HEAP_BASE + get_global $~lib/internal/allocator/AL_MASK + i32.add + get_global $~lib/internal/allocator/AL_MASK + i32.const -1 + i32.xor + i32.and + set_global $~lib/allocator/arena/startOffset + get_global $~lib/allocator/arena/startOffset + set_global $~lib/allocator/arena/offset + block (result i32) + i32.const 0 + call $~lib/memory/memory.allocate + set_local $0 + get_local $0 + end + set_global $optional-typeparameters/tConcrete + get_global $optional-typeparameters/tConcrete + i32.const 1 + i32.const 2 + call $optional-typeparameters/TestConcrete#test + drop + block (result i32) + i32.const 0 + call $~lib/memory/memory.allocate + set_local $0 + get_local $0 + end + set_global $optional-typeparameters/tDerived + get_global $optional-typeparameters/tDerived + f64.const 1 + f64.const 2 + call $optional-typeparameters/TestDerived#test + drop + ) + (func $null (; 7 ;) (type $v) + ) +) diff --git a/tests/compiler/std/array-access.untouched.wat b/tests/compiler/std/array-access.untouched.wat index 085fbca0..a6c1ae47 100644 --- a/tests/compiler/std/array-access.untouched.wat +++ b/tests/compiler/std/array-access.untouched.wat @@ -27,6 +27,7 @@ (export "stringArrayArrayMethodCall" (func $std/array-access/stringArrayArrayMethodCall)) (func $~lib/array/Array>#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -37,11 +38,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -49,6 +54,7 @@ ) (func $~lib/array/Array#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -59,11 +65,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -78,6 +88,7 @@ ) (func $~lib/array/Array#__get (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -88,11 +99,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -234,6 +249,7 @@ ) (func $~lib/array/Array>#__get (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -244,11 +260,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable diff --git a/tests/compiler/std/array-literal.untouched.wat b/tests/compiler/std/array-literal.untouched.wat index 38071b41..0556d5e8 100644 --- a/tests/compiler/std/array-literal.untouched.wat +++ b/tests/compiler/std/array-literal.untouched.wat @@ -39,6 +39,7 @@ (start $start) (func $~lib/array/Array#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -49,11 +50,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 0 i32.shl i32.add + get_local $3 + i32.add i32.load8_s offset=8 else unreachable @@ -61,6 +66,7 @@ ) (func $~lib/array/Array#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -71,11 +77,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -471,7 +481,7 @@ if i32.const 0 i32.const 136 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -521,14 +531,19 @@ ) (func $~lib/array/Array#__unchecked_set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) get_local $0 i32.load set_local $3 + i32.const 0 + set_local $4 get_local $3 get_local $1 i32.const 0 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store8 offset=8 ) @@ -543,7 +558,7 @@ if i32.const 0 i32.const 136 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -593,14 +608,19 @@ ) (func $~lib/array/Array#__unchecked_set (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) get_local $0 i32.load set_local $3 + i32.const 0 + set_local $4 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store offset=8 ) @@ -615,7 +635,7 @@ if i32.const 0 i32.const 136 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -665,14 +685,19 @@ ) (func $~lib/array/Array#__unchecked_set (; 13 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) get_local $0 i32.load set_local $3 + i32.const 0 + set_local $4 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store offset=8 ) @@ -703,7 +728,7 @@ if i32.const 0 i32.const 136 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -753,14 +778,19 @@ ) (func $~lib/array/Array#__unchecked_set (; 16 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) get_local $0 i32.load set_local $3 + i32.const 0 + set_local $4 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store offset=8 ) diff --git a/tests/compiler/std/array.optimized.wat b/tests/compiler/std/array.optimized.wat index d2102f26..c353fecb 100644 --- a/tests/compiler/std/array.optimized.wat +++ b/tests/compiler/std/array.optimized.wat @@ -729,7 +729,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -997,10 +997,10 @@ i32.ge_s i32.eqz if + get_local $6 get_local $2 i32.const 2 i32.shl - get_local $6 i32.add get_local $1 i32.store offset=8 @@ -2344,7 +2344,7 @@ if i32.const 0 i32.const 8 - i32.const 184 + i32.const 185 i32.const 42 call $~lib/env/abort unreachable @@ -2361,10 +2361,10 @@ get_local $0 get_local $3 i32.store offset=4 + get_local $4 get_local $2 i32.const 2 i32.shl - get_local $4 i32.add get_local $1 i32.store offset=8 @@ -2381,7 +2381,7 @@ if i32.const 0 i32.const 8 - i32.const 246 + i32.const 247 i32.const 20 call $~lib/env/abort unreachable @@ -2582,15 +2582,15 @@ loop $continue|0 get_local $3 if + get_local $6 get_local $1 i32.const 2 i32.shl - get_local $6 i32.add + get_local $6 get_local $2 i32.const 2 i32.shl - get_local $6 i32.add i32.load offset=8 i32.store offset=8 @@ -2679,7 +2679,7 @@ if i32.const 0 i32.const 8 - i32.const 336 + i32.const 337 i32.const 42 call $~lib/env/abort unreachable @@ -2731,7 +2731,7 @@ if i32.const 0 i32.const 8 - i32.const 307 + i32.const 308 i32.const 20 call $~lib/env/abort unreachable @@ -2784,29 +2784,29 @@ get_local $2 i32.ge_s br_if $break|0 + get_local $3 get_local $1 i32.const 2 i32.shl - get_local $3 i32.add i32.load offset=8 set_local $4 + get_local $3 get_local $1 i32.const 2 i32.shl - get_local $3 i32.add + get_local $3 get_local $2 i32.const 2 i32.shl - get_local $3 i32.add i32.load offset=8 i32.store offset=8 + get_local $3 get_local $2 i32.const 2 i32.shl - get_local $3 i32.add get_local $4 i32.store offset=8 @@ -2866,10 +2866,10 @@ get_local $4 i32.lt_s if + get_local $0 get_local $2 i32.const 2 i32.shl - get_local $0 i32.add i32.load offset=8 get_local $1 @@ -3019,7 +3019,7 @@ if i32.const 0 i32.const 8 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -3039,10 +3039,10 @@ get_local $4 i32.store offset=4 end + get_local $3 get_local $1 i32.const 2 i32.shl - get_local $3 i32.add get_local $2 i32.store offset=8 @@ -3080,10 +3080,10 @@ br_if $break|0 i32.const 3 set_global $~argc + get_local $4 get_local $2 i32.const 2 i32.shl - get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3166,10 +3166,10 @@ br_if $break|0 i32.const 3 set_global $~argc + get_local $4 get_local $2 i32.const 2 i32.shl - get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3252,10 +3252,10 @@ br_if $break|0 i32.const 3 set_global $~argc + get_local $4 get_local $2 i32.const 2 i32.shl - get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3339,10 +3339,10 @@ br_if $break|0 i32.const 3 set_global $~argc + get_local $4 get_local $2 i32.const 2 i32.shl - get_local $4 i32.add i32.load offset=8 get_local $2 @@ -3483,15 +3483,15 @@ br_if $break|0 i32.const 3 set_global $~argc - get_local $2 - i32.const 2 - i32.shl get_local $7 - i32.add get_local $2 i32.const 2 i32.shl + i32.add get_local $4 + get_local $2 + i32.const 2 + i32.shl i32.add i32.load offset=8 get_local $2 @@ -3561,10 +3561,10 @@ get_local $3 i32.eqz br_if $break|0 + get_local $5 get_local $2 i32.const 2 i32.shl - get_local $5 i32.add i32.load offset=8 set_local $3 @@ -3659,10 +3659,10 @@ i32.const 4 set_global $~argc get_local $2 + get_local $5 get_local $3 i32.const 2 i32.shl - get_local $5 i32.add i32.load offset=8 get_local $3 @@ -3736,10 +3736,10 @@ i32.const 4 set_global $~argc get_local $2 + get_local $4 get_local $3 i32.const 2 i32.shl - get_local $4 i32.add i32.load offset=8 get_local $3 @@ -4074,14 +4074,12 @@ get_local $3 i32.const 2 i32.shl - tee_local $1 get_local $0 i32.add + tee_local $1 f32.load offset=8 f32.store offset=8 - get_local $0 get_local $1 - i32.add get_local $6 f32.store offset=8 i32.const 1 @@ -4183,12 +4181,11 @@ get_local $0 i32.const 4 i32.add - tee_local $2 + tee_local $1 f32.load offset=8 set_local $6 - get_local $2 + get_local $1 get_local $0 - tee_local $1 f32.load offset=8 f32.store offset=8 get_local $0 @@ -4205,7 +4202,7 @@ if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -4648,14 +4645,12 @@ get_local $3 i32.const 3 i32.shl - tee_local $1 get_local $0 i32.add + tee_local $1 f64.load offset=8 f64.store offset=8 - get_local $0 get_local $1 - i32.add get_local $6 f64.store offset=8 i32.const 1 @@ -4757,12 +4752,11 @@ get_local $0 i32.const 8 i32.add - tee_local $2 + tee_local $1 f64.load offset=8 set_local $6 - get_local $2 + get_local $1 get_local $0 - tee_local $1 f64.load offset=8 f64.store offset=8 get_local $0 @@ -4779,7 +4773,7 @@ if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -5106,19 +5100,19 @@ get_local $1 i32.const 1 i32.sub - set_local $4 + set_local $3 loop $repeat|0 - get_local $4 + get_local $3 i32.const 0 i32.gt_s if - get_local $4 - set_local $3 + get_local $3 + set_local $4 loop $continue|1 - get_local $3 + get_local $4 i32.const 1 i32.and - get_local $3 + get_local $4 i32.const 6 i32.shr_s i32.const 2 @@ -5126,7 +5120,7 @@ get_local $7 i32.add i32.load - get_local $3 + get_local $4 i32.const 1 i32.shr_s i32.const 31 @@ -5136,14 +5130,14 @@ i32.and i32.eq if - get_local $3 + get_local $4 i32.const 1 i32.shr_s - set_local $3 + set_local $4 br $continue|1 end end - get_local $3 + get_local $4 i32.const 1 i32.shr_s tee_local $5 @@ -5152,8 +5146,8 @@ get_local $0 i32.add i32.load offset=8 - set_local $3 - get_local $4 + set_local $4 + get_local $3 i32.const 2 i32.shl get_local $0 @@ -5162,14 +5156,14 @@ set_local $6 i32.const 2 set_global $~argc - get_local $3 + get_local $4 get_local $6 get_local $2 call_indirect (type $iii) i32.const 0 i32.lt_s if - get_local $4 + get_local $3 i32.const 5 i32.shr_s i32.const 2 @@ -5180,18 +5174,18 @@ get_local $8 i32.load i32.const 1 - get_local $4 + get_local $3 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $4 + get_local $3 i32.const 2 i32.shl get_local $0 i32.add - get_local $3 + get_local $4 i32.store offset=8 get_local $5 i32.const 2 @@ -5201,19 +5195,19 @@ get_local $6 i32.store offset=8 end - get_local $4 + get_local $3 i32.const 1 i32.sub - set_local $4 + set_local $3 br $repeat|0 end end get_local $1 i32.const 1 i32.sub - set_local $4 + set_local $3 loop $repeat|2 - get_local $4 + get_local $3 i32.const 2 i32.ge_s if @@ -5221,17 +5215,15 @@ i32.load offset=8 set_local $6 get_local $0 - get_local $4 + get_local $3 i32.const 2 i32.shl - tee_local $1 get_local $0 i32.add + tee_local $1 i32.load offset=8 i32.store offset=8 - get_local $0 get_local $1 - i32.add get_local $6 i32.store offset=8 i32.const 1 @@ -5255,11 +5247,11 @@ i32.const 1 i32.shl i32.add - tee_local $3 - get_local $4 + tee_local $4 + get_local $3 i32.lt_s if - get_local $3 + get_local $4 set_local $5 br $continue|3 end @@ -5278,11 +5270,11 @@ get_local $0 i32.add i32.load offset=8 - set_local $3 + set_local $4 i32.const 2 set_global $~argc get_local $6 - get_local $3 + get_local $4 get_local $2 call_indirect (type $iii) i32.const 0 @@ -5313,7 +5305,7 @@ get_local $6 i32.store offset=8 get_local $0 - get_local $3 + get_local $4 i32.store offset=8 end get_local $5 @@ -5323,22 +5315,21 @@ br $continue|4 end end - get_local $4 + get_local $3 i32.const 1 i32.sub - set_local $4 + set_local $3 br $repeat|2 end end get_local $0 i32.const 4 i32.add - tee_local $3 + tee_local $2 i32.load offset=8 set_local $1 - get_local $3 + get_local $2 get_local $0 - tee_local $2 i32.load offset=8 i32.store offset=8 get_local $0 @@ -5354,7 +5345,7 @@ if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -5743,7 +5734,7 @@ if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -6639,20 +6630,20 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $4 i32.const 100 i32.div_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 + get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -6682,10 +6673,10 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $4 i32.const 2 i32.shl - get_local $3 i32.add i32.load offset=8 i32.store offset=4 @@ -6701,10 +6692,10 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $1 i32.const 2 i32.shl - get_local $3 i32.add i32.load offset=8 i32.store offset=4 @@ -7283,10 +7274,10 @@ get_local $9 i32.add set_global $~lib/internal/number/_K + get_local $12 get_local $9 i32.const 2 i32.shl - get_local $12 i32.add i64.load32_u offset=8 get_local $11 @@ -7412,12 +7403,12 @@ get_local $9 i32.add set_global $~lib/internal/number/_K + get_local $12 i32.const 0 get_local $9 i32.sub i32.const 2 i32.shl - get_local $12 i32.add i64.load32_u offset=8 get_local $8 @@ -7430,9 +7421,9 @@ i32.shl get_local $0 i32.add - tee_local $4 + tee_local $7 i32.load16_u offset=4 - set_local $7 + set_local $4 loop $continue|4 get_local $1 get_local $8 @@ -7470,10 +7461,10 @@ end get_local $2 if - get_local $7 + get_local $4 i32.const 1 i32.sub - set_local $7 + set_local $4 get_local $1 get_local $10 i64.add @@ -7481,8 +7472,8 @@ br $continue|4 end end - get_local $4 get_local $7 + get_local $4 i32.store16 offset=4 get_local $6 else @@ -7888,10 +7879,10 @@ i32.add i64.load offset=8 set_global $~lib/internal/number/_frc_pow + get_local $4 get_local $5 i32.const 1 i32.shl - get_local $4 i32.add i32.load16_s offset=8 set_global $~lib/internal/number/_exp_pow @@ -8368,10 +8359,10 @@ get_local $2 i32.ge_s br_if $break|0 + get_local $6 get_local $0 i32.const 2 i32.shl - get_local $6 i32.add i32.load offset=8 i32.load @@ -8402,10 +8393,10 @@ get_local $5 i32.ge_s br_if $break|1 + get_local $6 get_local $3 i32.const 2 i32.shl - get_local $6 i32.add i32.load offset=8 tee_local $4 @@ -8443,10 +8434,10 @@ br $repeat|1 end end + get_local $6 get_local $5 i32.const 2 i32.shl - get_local $6 i32.add i32.load offset=8 tee_local $4 @@ -8504,20 +8495,22 @@ i32.add tee_local $7 call $~lib/internal/string/allocateUnsafe + set_local $2 + i32.const 0 set_local $0 loop $repeat|0 - get_local $2 + get_local $0 get_local $3 i32.lt_s if - get_local $2 + get_local $0 i32.const 2 i32.shl get_local $5 i32.add i32.load offset=8 if - get_local $0 + get_local $2 get_local $1 i32.const 6792 i32.const 0 @@ -8530,7 +8523,7 @@ end get_local $6 if - get_local $0 + get_local $2 get_local $1 i32.const 4136 i32.const 0 @@ -8541,10 +8534,10 @@ i32.add set_local $1 end - get_local $2 + get_local $0 i32.const 1 i32.add - set_local $2 + set_local $0 br $repeat|0 end end @@ -8555,7 +8548,7 @@ i32.add i32.load offset=8 if - get_local $0 + get_local $2 get_local $1 i32.const 6792 i32.const 0 @@ -8566,17 +8559,17 @@ i32.add set_local $1 end - get_local $0 - set_local $2 + get_local $2 + set_local $0 get_local $7 get_local $1 i32.gt_s if - get_local $0 + get_local $2 get_local $1 call $~lib/string/String#substring - set_local $2 - get_local $0 + set_local $0 + get_local $2 i32.eqz if i32.const 0 @@ -8587,7 +8580,7 @@ unreachable end end - get_local $2 + get_local $0 ) (func $~lib/internal/number/itoa_stream (; 128 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -8999,6 +8992,7 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $4 i32.const 10000 i32.rem_u @@ -9007,15 +9001,14 @@ i32.div_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 + get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -9030,16 +9023,16 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $6 i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 + get_local $3 get_local $5 i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -9869,10 +9862,10 @@ get_local $4 i32.ge_s br_if $break|0 + get_local $5 get_local $0 i32.const 2 i32.shl - get_local $5 i32.add i32.load offset=8 tee_local $3 @@ -9898,10 +9891,10 @@ br $repeat|0 end end + get_local $5 get_local $4 i32.const 2 i32.shl - get_local $5 i32.add i32.load offset=8 tee_local $3 diff --git a/tests/compiler/std/array.untouched.wat b/tests/compiler/std/array.untouched.wat index 980bc0b4..4aa8c006 100644 --- a/tests/compiler/std/array.untouched.wat +++ b/tests/compiler/std/array.untouched.wat @@ -828,7 +828,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -1000,6 +1000,7 @@ ) (func $~lib/array/Array#__get (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -1010,11 +1011,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 0 i32.shl i32.add + get_local $3 + i32.add i32.load8_u offset=8 else unreachable @@ -1175,13 +1180,19 @@ i32.lt_s i32.eqz br_if $break|0 - get_local $4 - get_local $2 - i32.const 2 - i32.shl - i32.add - get_local $1 - i32.store offset=8 + block + i32.const 0 + set_local $6 + get_local $4 + get_local $2 + i32.const 2 + i32.shl + i32.add + get_local $6 + i32.add + get_local $1 + i32.store offset=8 + end get_local $2 i32.const 1 i32.add @@ -1195,6 +1206,7 @@ ) (func $~lib/array/Array#__get (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -1205,11 +1217,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -2851,6 +2867,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) get_local $0 i32.load offset=4 set_local $2 @@ -2876,7 +2893,7 @@ if i32.const 0 i32.const 8 - i32.const 184 + i32.const 185 i32.const 42 call $~lib/env/abort unreachable @@ -2894,17 +2911,22 @@ get_local $0 get_local $5 i32.store offset=4 + i32.const 0 + set_local $6 get_local $3 get_local $2 i32.const 2 i32.shl i32.add + get_local $6 + i32.add get_local $1 i32.store offset=8 get_local $5 ) (func $~lib/array/Array#__get (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -2915,11 +2937,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -2930,6 +2956,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load offset=4 set_local $1 @@ -2939,12 +2966,12 @@ if i32.const 0 i32.const 8 - i32.const 246 + i32.const 247 i32.const 20 call $~lib/env/abort unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) get_local $0 i32.load set_local $2 @@ -2953,18 +2980,22 @@ i32.sub tee_local $1 set_local $3 + i32.const 0 + set_local $4 get_local $2 get_local $3 i32.const 2 i32.shl i32.add + get_local $4 + i32.add i32.load offset=8 end - set_local $4 + set_local $5 get_local $0 get_local $1 i32.store offset=4 - get_local $4 + get_local $5 ) (func $~lib/array/Array#concat (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3187,20 +3218,28 @@ get_local $11 if block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 0 + set_local $6 get_local $4 get_local $9 i32.const 2 i32.shl i32.add + get_local $6 + i32.add i32.load offset=8 end set_local $6 + i32.const 0 + set_local $7 get_local $4 get_local $8 i32.const 2 i32.shl i32.add + get_local $7 + i32.add get_local $6 i32.store offset=8 get_local $9 @@ -3228,7 +3267,7 @@ i32.const 2 i32.shl i32.add - set_local $6 + set_local $7 get_local $4 get_global $~lib/internal/arraybuffer/HEADER_SIZE i32.add @@ -3236,13 +3275,13 @@ i32.const 2 i32.shl i32.add - set_local $7 + set_local $6 get_local $11 i32.const 2 i32.shl set_local $12 - get_local $6 get_local $7 + get_local $6 get_local $12 call $~lib/internal/memory/memmove end @@ -3360,7 +3399,7 @@ if i32.const 0 i32.const 8 - i32.const 336 + i32.const 337 i32.const 42 call $~lib/env/abort unreachable @@ -3402,11 +3441,15 @@ call $~lib/internal/memory/memmove i32.const 0 set_local $8 + i32.const 0 + set_local $7 get_local $2 get_local $8 i32.const 2 i32.shl i32.add + get_local $7 + i32.add get_local $1 i32.store offset=8 get_local $0 @@ -3431,7 +3474,7 @@ if i32.const 0 i32.const 8 - i32.const 307 + i32.const 308 i32.const 20 call $~lib/env/abort unreachable @@ -3439,52 +3482,60 @@ get_local $0 i32.load set_local $2 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) i32.const 0 set_local $3 + i32.const 0 + set_local $4 get_local $2 get_local $3 i32.const 2 i32.shl i32.add + get_local $4 + i32.add i32.load offset=8 end - set_local $4 + set_local $5 get_local $1 i32.const 1 i32.sub - set_local $5 + set_local $6 get_local $2 get_global $~lib/internal/arraybuffer/HEADER_SIZE i32.add - set_local $3 + set_local $4 get_local $2 get_global $~lib/internal/arraybuffer/HEADER_SIZE i32.add i32.const 4 i32.add - set_local $6 - get_local $5 + set_local $3 + get_local $6 i32.const 2 i32.shl set_local $7 + get_local $4 get_local $3 - get_local $6 get_local $7 call $~lib/internal/memory/memmove i32.const 0 set_local $7 + i32.const 0 + set_local $3 get_local $2 - get_local $5 + get_local $6 i32.const 2 i32.shl i32.add + get_local $3 + i32.add get_local $7 i32.store offset=8 get_local $0 - get_local $5 + get_local $6 i32.store offset=4 - get_local $4 + get_local $5 ) (func $~lib/array/Array#reverse (; 33 ;) (type $ii) (param $0 i32) (result i32) (local $1 i32) @@ -3492,6 +3543,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) get_local $0 i32.load set_local $1 @@ -3512,36 +3564,52 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.4 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) + i32.const 0 + set_local $4 get_local $1 get_local $2 i32.const 2 i32.shl i32.add + get_local $4 + i32.add i32.load offset=8 end set_local $4 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.5 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) + i32.const 0 + set_local $5 get_local $1 get_local $3 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end set_local $5 + i32.const 0 + set_local $6 get_local $1 get_local $2 i32.const 2 i32.shl i32.add + get_local $6 + i32.add get_local $5 i32.store offset=8 + i32.const 0 + set_local $6 get_local $1 get_local $3 i32.const 2 i32.shl i32.add + get_local $6 + i32.add get_local $4 i32.store offset=8 end @@ -3611,12 +3679,16 @@ i32.lt_s if block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.7 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) + i32.const 0 + set_local $4 get_local $6 get_local $2 i32.const 2 i32.shl i32.add + get_local $4 + i32.add i32.load offset=8 end get_local $1 @@ -3774,6 +3846,7 @@ (func $~lib/array/Array#__set (; 37 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -3792,7 +3865,7 @@ if i32.const 0 i32.const 8 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -3814,11 +3887,15 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $2 i32.store offset=8 ) @@ -3861,12 +3938,16 @@ block (result i32) i32.const 3 set_global $~argc - block $~lib/internal/arraybuffer/loadUnsafe|inlined.9 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) + i32.const 0 + set_local $5 get_local $2 get_local $3 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end get_local $3 @@ -3962,12 +4043,16 @@ block (result i32) i32.const 3 set_global $~argc - block $~lib/internal/arraybuffer/loadUnsafe|inlined.11 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) + i32.const 0 + set_local $5 get_local $2 get_local $3 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end get_local $3 @@ -4059,12 +4144,16 @@ block (result i32) i32.const 3 set_global $~argc - block $~lib/internal/arraybuffer/loadUnsafe|inlined.13 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) + i32.const 0 + set_local $5 get_local $2 get_local $3 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end get_local $3 @@ -4156,12 +4245,16 @@ block i32.const 3 set_global $~argc - block $~lib/internal/arraybuffer/loadUnsafe|inlined.14 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) + i32.const 0 + set_local $5 get_local $2 get_local $3 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end get_local $3 @@ -4219,7 +4312,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -4310,12 +4403,16 @@ block (result f32) i32.const 3 set_global $~argc - block $~lib/internal/arraybuffer/loadUnsafe|inlined.15 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.15 (result i32) + i32.const 0 + set_local $7 get_local $2 get_local $6 i32.const 2 i32.shl i32.add + get_local $7 + i32.add i32.load offset=8 end get_local $6 @@ -4324,11 +4421,15 @@ call_indirect (type $iiif) end set_local $8 + i32.const 0 + set_local $7 get_local $5 get_local $6 i32.const 2 i32.shl i32.add + get_local $7 + i32.add get_local $8 f32.store offset=8 end @@ -4345,6 +4446,7 @@ ) (func $~lib/array/Array#__get (; 65 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -4355,11 +4457,15 @@ i32.shr_u i32.lt_u if (result f32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add f32.load offset=8 else unreachable @@ -4383,6 +4489,7 @@ (local $5 i32) (local $6 i32) (local $7 i32) + (local $8 i32) get_local $0 i32.load set_local $2 @@ -4418,12 +4525,16 @@ block (result i32) i32.const 3 set_global $~argc - block $~lib/internal/arraybuffer/loadUnsafe|inlined.16 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) + i32.const 0 + set_local $7 get_local $2 get_local $6 i32.const 2 i32.shl i32.add + get_local $7 + i32.add i32.load offset=8 end get_local $6 @@ -4432,11 +4543,15 @@ call_indirect (type $iiii) end set_local $7 + i32.const 0 + set_local $8 get_local $5 get_local $6 i32.const 2 i32.shl i32.add + get_local $8 + i32.add get_local $7 i32.store offset=8 end @@ -4508,12 +4623,16 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.17 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.17 (result i32) + i32.const 0 + set_local $6 get_local $2 get_local $5 i32.const 2 i32.shl i32.add + get_local $6 + i32.add i32.load offset=8 end set_local $6 @@ -4623,12 +4742,16 @@ i32.const 4 set_global $~argc get_local $3 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.18 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.18 (result i32) + i32.const 0 + set_local $7 get_local $4 get_local $5 i32.const 2 i32.shl i32.add + get_local $7 + i32.add i32.load offset=8 end get_local $5 @@ -4703,12 +4826,16 @@ i32.const 4 set_global $~argc get_local $3 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.19 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.19 (result i32) + i32.const 0 + set_local $7 get_local $4 get_local $5 i32.const 2 i32.shl i32.add + get_local $7 + i32.add i32.load offset=8 end get_local $5 @@ -4771,6 +4898,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) get_local $2 set_local $3 get_local $0 @@ -4792,12 +4920,16 @@ i32.const 4 set_global $~argc get_local $3 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.20 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.20 (result i32) + i32.const 0 + set_local $6 get_local $4 get_local $5 i32.const 2 i32.shl i32.add + get_local $6 + i32.add i32.load offset=8 end get_local $5 @@ -4838,6 +4970,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) get_local $2 set_local $3 get_local $0 @@ -4859,12 +4992,16 @@ i32.const 4 set_global $~argc get_local $3 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.21 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.21 (result i32) + i32.const 0 + set_local $6 get_local $4 get_local $5 i32.const 2 i32.shl i32.add + get_local $6 + i32.add i32.load offset=8 end get_local $5 @@ -5027,14 +5164,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f32) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $5 @@ -5049,14 +5186,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $7 @@ -5083,12 +5220,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 f32.store offset=8 else @@ -5104,12 +5241,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $5 f32.store offset=8 end @@ -5205,25 +5342,25 @@ i32.const 1 i32.shr_s set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f32) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $9 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $10 @@ -5261,21 +5398,21 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $9 f32.store offset=8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 f32.store offset=8 end @@ -5301,48 +5438,48 @@ i32.eqz br_if $break|2 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f32) i32.const 0 set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $10 i32.const 0 set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $9 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $9 f32.store offset=8 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 f32.store offset=8 i32.const 1 @@ -5384,27 +5521,27 @@ i32.gt_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f32) i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $10 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f32) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $9 @@ -5442,23 +5579,23 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 f32.store offset=8 i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $9 f32.store offset=8 end @@ -5490,52 +5627,52 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f32) i32.const 1 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $12 i32.const 1 set_local $6 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f32) i32.const 0 set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add f32.load offset=8 end set_local $10 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 f32.store offset=8 i32.const 0 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $12 f32.store offset=8 ) @@ -5543,14 +5680,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 f32) + (local $5 i32) (local $6 f32) + (local $7 f32) get_local $1 i32.eqz if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -5572,33 +5710,41 @@ i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result f32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f32) i32.const 1 set_local $4 + i32.const 0 + set_local $5 get_local $3 get_local $4 i32.const 2 i32.shl i32.add - f32.load offset=8 - end - set_local $5 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result f32) - i32.const 0 - set_local $4 - get_local $3 - get_local $4 - i32.const 2 - i32.shl + get_local $5 i32.add f32.load offset=8 end set_local $6 + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f32) + i32.const 0 + set_local $5 + i32.const 0 + set_local $4 + get_local $3 + get_local $5 + i32.const 2 + i32.shl + i32.add + get_local $4 + i32.add + f32.load offset=8 + end + set_local $7 block (result i32) i32.const 2 set_global $~argc - get_local $5 get_local $6 + get_local $7 get_local $1 call_indirect (type $ffi) end @@ -5607,21 +5753,29 @@ if i32.const 1 set_local $4 - get_local $3 - get_local $4 - i32.const 2 - i32.shl - i32.add - get_local $6 - f32.store offset=8 i32.const 0 - set_local $4 + set_local $5 get_local $3 get_local $4 i32.const 2 i32.shl i32.add get_local $5 + i32.add + get_local $7 + f32.store offset=8 + i32.const 0 + set_local $5 + i32.const 0 + set_local $4 + get_local $3 + get_local $5 + i32.const 2 + i32.shl + i32.add + get_local $4 + i32.add + get_local $6 f32.store offset=8 end get_local $0 @@ -5794,14 +5948,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f64) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $5 @@ -5816,14 +5970,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f64) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $7 @@ -5850,12 +6004,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $7 f64.store offset=8 else @@ -5871,12 +6025,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $5 f64.store offset=8 end @@ -5969,25 +6123,25 @@ i32.const 1 i32.shr_s set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f64) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $9 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f64) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 @@ -6025,21 +6179,21 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $9 f64.store offset=8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 end @@ -6065,48 +6219,48 @@ i32.eqz br_if $break|2 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f64) i32.const 0 set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 i32.const 0 set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f64) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $9 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $9 f64.store offset=8 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 i32.const 1 @@ -6148,27 +6302,27 @@ i32.gt_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f64) i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f64) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $9 @@ -6206,23 +6360,23 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $9 f64.store offset=8 end @@ -6254,52 +6408,52 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f64) i32.const 1 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $12 i32.const 1 set_local $6 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f64) i32.const 0 set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 i32.const 0 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $12 f64.store offset=8 ) @@ -6307,14 +6461,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 f64) + (local $5 i32) (local $6 f64) + (local $7 f64) get_local $1 i32.eqz if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -6336,33 +6491,41 @@ i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f64) i32.const 1 set_local $4 + i32.const 0 + set_local $5 get_local $3 get_local $4 i32.const 3 i32.shl i32.add - f64.load offset=8 - end - set_local $5 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result f64) - i32.const 0 - set_local $4 - get_local $3 - get_local $4 - i32.const 3 - i32.shl + get_local $5 i32.add f64.load offset=8 end set_local $6 + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f64) + i32.const 0 + set_local $5 + i32.const 0 + set_local $4 + get_local $3 + get_local $5 + i32.const 3 + i32.shl + i32.add + get_local $4 + i32.add + f64.load offset=8 + end + set_local $7 block (result i32) i32.const 2 set_global $~argc - get_local $5 get_local $6 + get_local $7 get_local $1 call_indirect (type $FFi) end @@ -6371,21 +6534,29 @@ if i32.const 1 set_local $4 - get_local $3 - get_local $4 - i32.const 3 - i32.shl - i32.add - get_local $6 - f64.store offset=8 i32.const 0 - set_local $4 + set_local $5 get_local $3 get_local $4 i32.const 3 i32.shl i32.add get_local $5 + i32.add + get_local $7 + f64.store offset=8 + i32.const 0 + set_local $5 + i32.const 0 + set_local $4 + get_local $3 + get_local $5 + i32.const 3 + i32.shl + i32.add + get_local $4 + i32.add + get_local $6 f64.store offset=8 end get_local $0 @@ -6464,6 +6635,7 @@ ) (func $~lib/array/Array#__get (; 109 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -6474,11 +6646,15 @@ i32.shr_u i32.lt_u if (result f64) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 3 i32.shl i32.add + get_local $3 + i32.add f64.load offset=8 else unreachable @@ -6580,14 +6756,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.24 (result i32) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $5 @@ -6602,14 +6778,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.25 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $7 @@ -6636,12 +6812,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 i32.store offset=8 else @@ -6657,12 +6833,12 @@ i32.add set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $5 i32.store offset=8 end @@ -6755,25 +6931,25 @@ i32.const 1 i32.shr_s set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.26 (result i32) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $9 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.27 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $10 @@ -6811,21 +6987,21 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $9 i32.store offset=8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 i32.store offset=8 end @@ -6851,48 +7027,48 @@ i32.eqz br_if $break|2 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.28 (result i32) i32.const 0 set_local $10 get_local $0 - get_local $1 - i32.add get_local $10 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $10 i32.const 0 set_local $9 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.29 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $8 get_local $0 - get_local $1 - i32.add get_local $9 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $8 i32.store offset=8 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 i32.store offset=8 i32.const 1 @@ -6934,27 +7110,27 @@ i32.gt_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.30 (result i32) i32.const 0 set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $10 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.31 (result i32) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $7 @@ -6992,23 +7168,23 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 i32.store offset=8 i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 i32.store offset=8 end @@ -7040,52 +7216,52 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.32 (result i32) i32.const 1 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $12 i32.const 1 set_local $6 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.33 (result i32) i32.const 0 set_local $9 get_local $0 - get_local $1 - i32.add get_local $9 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $9 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $9 i32.store offset=8 i32.const 0 set_local $9 get_local $0 - get_local $1 - i32.add get_local $9 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $12 i32.store offset=8 ) @@ -7095,12 +7271,13 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) get_local $1 i32.eqz if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -7122,33 +7299,41 @@ i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.22 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.22 (result i32) i32.const 1 set_local $4 + i32.const 0 + set_local $5 get_local $3 get_local $4 i32.const 2 i32.shl i32.add - i32.load offset=8 - end - set_local $4 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.23 (result i32) - i32.const 0 - set_local $5 - get_local $3 get_local $5 - i32.const 2 - i32.shl i32.add i32.load offset=8 end set_local $5 + block $~lib/internal/arraybuffer/LOAD|inlined.23 (result i32) + i32.const 0 + set_local $4 + i32.const 0 + set_local $6 + get_local $3 + get_local $4 + i32.const 2 + i32.shl + i32.add + get_local $6 + i32.add + i32.load offset=8 + end + set_local $6 block (result i32) i32.const 2 set_global $~argc - get_local $4 get_local $5 + get_local $6 get_local $1 call_indirect (type $iii) end @@ -7156,22 +7341,30 @@ i32.lt_s if i32.const 1 - set_local $6 + set_local $4 + i32.const 0 + set_local $7 get_local $3 - get_local $6 + get_local $4 i32.const 2 i32.shl i32.add - get_local $5 + get_local $7 + i32.add + get_local $6 i32.store offset=8 i32.const 0 - set_local $6 + set_local $7 + i32.const 0 + set_local $4 get_local $3 - get_local $6 + get_local $7 i32.const 2 i32.shl i32.add get_local $4 + i32.add + get_local $5 i32.store offset=8 end get_local $0 @@ -7236,14 +7429,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $5 @@ -7258,14 +7451,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $7 @@ -7292,12 +7485,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 i32.store offset=8 else @@ -7313,12 +7506,12 @@ i32.add set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $5 i32.store offset=8 end @@ -7411,25 +7604,25 @@ i32.const 1 i32.shr_s set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $9 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $10 @@ -7467,21 +7660,21 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $9 i32.store offset=8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 i32.store offset=8 end @@ -7507,48 +7700,48 @@ i32.eqz br_if $break|2 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) i32.const 0 set_local $10 get_local $0 - get_local $1 - i32.add get_local $10 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $10 i32.const 0 set_local $9 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $8 get_local $0 - get_local $1 - i32.add get_local $9 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $8 i32.store offset=8 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 i32.store offset=8 i32.const 1 @@ -7590,27 +7783,27 @@ i32.gt_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.9 (result i32) i32.const 0 set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $10 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result i32) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $7 @@ -7648,23 +7841,23 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $10 i32.store offset=8 i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 i32.store offset=8 end @@ -7696,52 +7889,52 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result i32) i32.const 1 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $12 i32.const 1 set_local $6 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result i32) i32.const 0 set_local $9 get_local $0 - get_local $1 - i32.add get_local $9 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $9 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $9 i32.store offset=8 i32.const 0 set_local $9 get_local $0 - get_local $1 - i32.add get_local $9 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $12 i32.store offset=8 ) @@ -7751,12 +7944,13 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) get_local $1 i32.eqz if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -7778,33 +7972,41 @@ i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 1 set_local $4 + i32.const 0 + set_local $5 get_local $3 get_local $4 i32.const 2 i32.shl i32.add - i32.load offset=8 - end - set_local $4 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) - i32.const 0 - set_local $5 - get_local $3 get_local $5 - i32.const 2 - i32.shl i32.add i32.load offset=8 end set_local $5 + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 0 + set_local $4 + i32.const 0 + set_local $6 + get_local $3 + get_local $4 + i32.const 2 + i32.shl + i32.add + get_local $6 + i32.add + i32.load offset=8 + end + set_local $6 block (result i32) i32.const 2 set_global $~argc - get_local $4 get_local $5 + get_local $6 get_local $1 call_indirect (type $iii) end @@ -7812,22 +8014,30 @@ i32.lt_s if i32.const 1 - set_local $6 + set_local $4 + i32.const 0 + set_local $7 get_local $3 - get_local $6 + get_local $4 i32.const 2 i32.shl i32.add - get_local $5 + get_local $7 + i32.add + get_local $6 i32.store offset=8 i32.const 0 - set_local $6 + set_local $7 + i32.const 0 + set_local $4 get_local $3 - get_local $6 + get_local $7 i32.const 2 i32.shl i32.add get_local $4 + i32.add + get_local $5 i32.store offset=8 end get_local $0 @@ -8129,7 +8339,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -8180,6 +8390,7 @@ (func $~lib/array/Array>#__set (; 134 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -8198,7 +8409,7 @@ if i32.const 0 i32.const 8 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -8220,16 +8431,21 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $2 i32.store offset=8 ) (func $~lib/array/Array>#__get (; 135 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -8240,11 +8456,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -8326,14 +8546,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Array>|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.3 (result i32) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $5 @@ -8348,14 +8568,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Array>|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.4 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $7 @@ -8382,12 +8602,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 i32.store offset=8 else @@ -8403,12 +8623,12 @@ i32.add set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $5 i32.store offset=8 end @@ -8428,12 +8648,13 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) get_local $1 i32.eqz if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -8455,33 +8676,41 @@ i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.1 (result i32) i32.const 1 set_local $4 + i32.const 0 + set_local $5 get_local $3 get_local $4 i32.const 2 i32.shl i32.add - i32.load offset=8 - end - set_local $4 - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.2 (result i32) - i32.const 0 - set_local $5 - get_local $3 get_local $5 - i32.const 2 - i32.shl i32.add i32.load offset=8 end set_local $5 + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.2 (result i32) + i32.const 0 + set_local $4 + i32.const 0 + set_local $6 + get_local $3 + get_local $4 + i32.const 2 + i32.shl + i32.add + get_local $6 + i32.add + i32.load offset=8 + end + set_local $6 block (result i32) i32.const 2 set_global $~argc - get_local $4 get_local $5 + get_local $6 get_local $1 call_indirect (type $iii) end @@ -8489,22 +8718,30 @@ i32.lt_s if i32.const 1 - set_local $6 + set_local $4 + i32.const 0 + set_local $7 get_local $3 - get_local $6 + get_local $4 i32.const 2 i32.shl i32.add - get_local $5 + get_local $7 + i32.add + get_local $6 i32.store offset=8 i32.const 0 - set_local $6 + set_local $7 + i32.const 0 + set_local $4 get_local $3 - get_local $6 + get_local $7 i32.const 2 i32.shl i32.add get_local $4 + i32.add + get_local $5 i32.store offset=8 end get_local $0 @@ -8595,7 +8832,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -8665,6 +8902,7 @@ (func $~lib/array/Array>#__set (; 144 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -8683,7 +8921,7 @@ if i32.const 0 i32.const 8 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -8705,11 +8943,15 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $2 i32.store offset=8 ) @@ -8779,14 +9021,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Proxy>|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.2 (result i32) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $5 @@ -8801,14 +9043,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset,Proxy>|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.3 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $7 @@ -8835,12 +9077,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 i32.store offset=8 else @@ -8856,12 +9098,12 @@ i32.add set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $5 i32.store offset=8 end @@ -8881,12 +9123,13 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) get_local $1 i32.eqz if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -8908,33 +9151,41 @@ i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/loadUnsafe,Proxy>|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.0 (result i32) i32.const 1 set_local $4 + i32.const 0 + set_local $5 get_local $3 get_local $4 i32.const 2 i32.shl i32.add - i32.load offset=8 - end - set_local $4 - block $~lib/internal/arraybuffer/loadUnsafe,Proxy>|inlined.1 (result i32) - i32.const 0 - set_local $5 - get_local $3 get_local $5 - i32.const 2 - i32.shl i32.add i32.load offset=8 end set_local $5 + block $~lib/internal/arraybuffer/LOAD,Proxy>|inlined.1 (result i32) + i32.const 0 + set_local $4 + i32.const 0 + set_local $6 + get_local $3 + get_local $4 + i32.const 2 + i32.shl + i32.add + get_local $6 + i32.add + i32.load offset=8 + end + set_local $6 block (result i32) i32.const 2 set_global $~argc - get_local $4 get_local $5 + get_local $6 get_local $1 call_indirect (type $iii) end @@ -8942,22 +9193,30 @@ i32.lt_s if i32.const 1 - set_local $6 + set_local $4 + i32.const 0 + set_local $7 get_local $3 - get_local $6 + get_local $4 i32.const 2 i32.shl i32.add - get_local $5 + get_local $7 + i32.add + get_local $6 i32.store offset=8 i32.const 0 - set_local $6 + set_local $7 + i32.const 0 + set_local $4 get_local $3 - get_local $6 + get_local $7 i32.const 2 i32.shl i32.add get_local $4 + i32.add + get_local $5 i32.store offset=8 end get_local $0 @@ -8973,6 +9232,7 @@ ) (func $~lib/array/Array>#__get (; 149 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -8983,11 +9243,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -9267,14 +9531,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $5 @@ -9289,14 +9553,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 2 i32.shl i32.add + get_local $1 + i32.add i32.load offset=8 end set_local $7 @@ -9323,12 +9587,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $7 i32.store offset=8 else @@ -9344,12 +9608,12 @@ i32.add set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 2 i32.shl i32.add + get_local $1 + i32.add get_local $5 i32.store offset=8 end @@ -9369,12 +9633,13 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) get_local $1 i32.eqz if i32.const 0 i32.const 8 - i32.const 408 + i32.const 409 i32.const 4 call $~lib/env/abort unreachable @@ -9396,33 +9661,41 @@ i32.const 2 i32.eq if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 1 set_local $4 + i32.const 0 + set_local $5 get_local $3 get_local $4 i32.const 2 i32.shl i32.add - i32.load offset=8 - end - set_local $4 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) - i32.const 0 - set_local $5 - get_local $3 get_local $5 - i32.const 2 - i32.shl i32.add i32.load offset=8 end set_local $5 + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) + i32.const 0 + set_local $4 + i32.const 0 + set_local $6 + get_local $3 + get_local $4 + i32.const 2 + i32.shl + i32.add + get_local $6 + i32.add + i32.load offset=8 + end + set_local $6 block (result i32) i32.const 2 set_global $~argc - get_local $4 get_local $5 + get_local $6 get_local $1 call_indirect (type $iii) end @@ -9430,22 +9703,30 @@ i32.lt_s if i32.const 1 - set_local $6 + set_local $4 + i32.const 0 + set_local $7 get_local $3 - get_local $6 + get_local $4 i32.const 2 i32.shl i32.add - get_local $5 + get_local $7 + i32.add + get_local $6 i32.store offset=8 i32.const 0 - set_local $6 + set_local $7 + i32.const 0 + set_local $4 get_local $3 - get_local $6 + get_local $7 i32.const 2 i32.shl i32.add get_local $4 + i32.add + get_local $5 i32.store offset=8 end get_local $0 @@ -9461,6 +9742,7 @@ ) (func $~lib/array/Array#__get (; 158 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -9471,11 +9753,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -9667,7 +9953,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -9933,6 +10219,7 @@ (func $~lib/array/Array#__set (; 171 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -9951,7 +10238,7 @@ if i32.const 0 i32.const 8 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -9973,11 +10260,15 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $2 i32.store offset=8 ) @@ -10150,6 +10441,7 @@ (local $10 i32) (local $11 i32) (local $12 i32) + (local $13 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -10179,14 +10471,18 @@ if i32.const 4104 i32.const 4120 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 0 i32.shl i32.add + get_local $9 + i32.add i32.load8_u offset=8 end i32.const 0 @@ -10195,16 +10491,16 @@ return end i32.const 5 - set_local $8 - get_local $8 + set_local $9 + get_local $9 get_local $6 i32.add get_local $2 i32.mul - get_local $8 - i32.add - set_local $9 get_local $9 + i32.add + set_local $8 + get_local $8 call $~lib/internal/string/allocateUnsafe set_local $10 i32.const 0 @@ -10219,12 +10515,16 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) + i32.const 0 + set_local $13 get_local $5 get_local $12 i32.const 0 i32.shl i32.add + get_local $13 + i32.add i32.load8_u offset=8 end set_local $4 @@ -10234,7 +10534,7 @@ i32.ne i32.eqz i32.add - set_local $8 + set_local $9 get_local $10 get_local $11 i32.const 4104 @@ -10244,10 +10544,10 @@ i32.ne select i32.const 0 - get_local $8 + get_local $9 call $~lib/internal/string/copyUnsafe get_local $11 - get_local $8 + get_local $9 i32.add set_local $11 get_local $7 @@ -10273,12 +10573,16 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $2 i32.const 0 i32.shl i32.add + get_local $12 + i32.add i32.load8_u offset=8 end set_local $4 @@ -10288,7 +10592,7 @@ i32.ne i32.eqz i32.add - set_local $8 + set_local $9 get_local $10 get_local $11 i32.const 4104 @@ -10298,15 +10602,15 @@ i32.ne select i32.const 0 - get_local $8 + get_local $9 call $~lib/internal/string/copyUnsafe get_local $11 - get_local $8 + get_local $9 i32.add set_local $11 get_local $10 set_local $12 - get_local $9 + get_local $8 get_local $11 i32.gt_s if @@ -10413,8 +10717,9 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i64) + (local $8 i32) (local $9 i64) + (local $10 i64) block $~lib/internal/number/DIGITS|inlined.0 (result i32) i32.const 4752 end @@ -10445,24 +10750,32 @@ i32.const 100 i32.rem_u set_local $7 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) + i32.const 0 + set_local $8 get_local $3 get_local $6 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i64.load32_u offset=8 end - set_local $8 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i64) + set_local $9 + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) + i32.const 0 + set_local $8 get_local $3 get_local $7 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i64.load32_u offset=8 end - set_local $9 + set_local $10 get_local $2 i32.const 4 i32.sub @@ -10472,8 +10785,8 @@ i32.const 1 i32.shl i32.add - get_local $8 get_local $9 + get_local $10 i64.const 32 i64.shl i64.or @@ -10501,12 +10814,16 @@ i32.const 2 i32.sub set_local $2 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.13 (result i32) + i32.const 0 + set_local $5 get_local $3 get_local $6 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end set_local $5 @@ -10526,12 +10843,16 @@ i32.const 2 i32.sub set_local $2 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.4 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.14 (result i32) + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end set_local $5 @@ -10665,6 +10986,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -10692,14 +11014,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.24 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.34 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end call $~lib/internal/number/itoa @@ -10712,10 +11038,10 @@ i32.mul i32.const 11 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -10728,17 +11054,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.25 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.35 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i32.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream @@ -10746,7 +11076,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -10767,34 +11097,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.26 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.36 (result i32) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $11 + i32.add i32.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -10806,7 +11140,7 @@ end block $~lib/memory/memory.free|inlined.5 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.5 unreachable @@ -10882,6 +11216,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -10909,14 +11244,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.5 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.15 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end call $~lib/internal/number/itoa @@ -10929,10 +11268,10 @@ i32.mul i32.const 10 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -10945,17 +11284,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.6 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.16 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i32.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream @@ -10963,7 +11306,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -10984,34 +11327,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.7 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.17 (result i32) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $11 + i32.add i32.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -11023,7 +11370,7 @@ end block $~lib/memory/memory.free|inlined.6 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.6 unreachable @@ -11347,12 +11694,16 @@ get_local $14 i32.add set_global $~lib/internal/number/_K - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) + i32.const 0 + set_local $18 get_local $16 get_local $14 i32.const 2 i32.shl i32.add + get_local $18 + i32.add i64.load32_u offset=8 end get_local $7 @@ -11497,16 +11848,20 @@ i32.add set_global $~lib/internal/number/_K get_local $10 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) i32.const 0 get_local $14 i32.sub set_local $17 + i32.const 0 + set_local $21 get_local $16 get_local $17 i32.const 2 i32.shl i32.add + get_local $21 + i32.add i64.load32_u offset=8 end i64.mul @@ -11518,10 +11873,10 @@ i32.const 1 i32.shl i32.add - set_local $17 - get_local $17 - i32.load16_u offset=4 set_local $21 + get_local $21 + i32.load16_u offset=4 + set_local $17 block $break|4 loop $continue|4 get_local $13 @@ -11563,10 +11918,10 @@ end if block - get_local $21 + get_local $17 i32.const 1 i32.sub - set_local $21 + set_local $17 get_local $13 get_local $8 i64.add @@ -11576,8 +11931,8 @@ end end end - get_local $17 get_local $21 + get_local $17 i32.store16 offset=4 get_local $15 return @@ -11946,7 +12301,7 @@ (local $11 f64) (local $12 i32) (local $13 i32) - (local $14 i64) + (local $14 i32) (local $15 i64) (local $16 i64) (local $17 i64) @@ -11956,7 +12311,8 @@ (local $21 i64) (local $22 i64) (local $23 i64) - (local $24 i32) + (local $24 i64) + (local $25 i32) get_local $1 f64.const 0 f64.lt @@ -12098,21 +12454,29 @@ end i32.load set_local $13 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) + i32.const 0 + set_local $14 get_local $12 get_local $8 i32.const 3 i32.shl i32.add + get_local $14 + i32.add i64.load offset=8 end set_global $~lib/internal/number/_frc_pow - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) + i32.const 0 + set_local $14 get_local $13 get_local $8 i32.const 1 i32.shl i32.add + get_local $14 + i32.add i32.load16_s offset=8 end set_global $~lib/internal/number/_exp_pow @@ -12138,60 +12502,60 @@ get_local $6 i64.const 4294967295 i64.and - set_local $14 + set_local $15 get_local $7 i64.const 4294967295 i64.and - set_local $15 + set_local $16 get_local $6 i64.const 32 i64.shr_u - set_local $16 + set_local $17 get_local $7 i64.const 32 i64.shr_u - set_local $17 - get_local $14 - get_local $15 - i64.mul set_local $18 - get_local $16 get_local $15 + get_local $16 i64.mul - get_local $18 + set_local $19 + get_local $17 + get_local $16 + i64.mul + get_local $19 i64.const 32 i64.shr_u i64.add - set_local $19 - get_local $14 - get_local $17 + set_local $20 + get_local $15 + get_local $18 i64.mul - get_local $19 + get_local $20 i64.const 4294967295 i64.and i64.add - set_local $20 - get_local $20 + set_local $21 + get_local $21 i64.const 2147483647 i64.add - set_local $20 - get_local $19 - i64.const 32 - i64.shr_u - set_local $19 + set_local $21 get_local $20 i64.const 32 i64.shr_u set_local $20 - get_local $16 + get_local $21 + i64.const 32 + i64.shr_u + set_local $21 get_local $17 + get_local $18 i64.mul - get_local $19 - i64.add get_local $20 i64.add + get_local $21 + i64.add end - set_local $20 + set_local $21 block $~lib/internal/number/umul64e|inlined.0 (result i32) get_local $4 get_local $12 @@ -12202,66 +12566,66 @@ set_local $8 block $~lib/internal/number/umul64f|inlined.1 (result i64) get_global $~lib/internal/number/_frc_plus + set_local $20 + get_local $20 + i64.const 4294967295 + i64.and set_local $19 - get_local $19 + get_local $7 i64.const 4294967295 i64.and set_local $18 - get_local $7 - i64.const 4294967295 - i64.and + get_local $20 + i64.const 32 + i64.shr_u set_local $17 - get_local $19 + get_local $7 i64.const 32 i64.shr_u set_local $16 - get_local $7 - i64.const 32 - i64.shr_u - set_local $15 + get_local $19 get_local $18 - get_local $17 i64.mul - set_local $14 - get_local $16 + set_local $15 get_local $17 + get_local $18 i64.mul - get_local $14 + get_local $15 i64.const 32 i64.shr_u i64.add - set_local $21 - get_local $18 - get_local $15 + set_local $22 + get_local $19 + get_local $16 i64.mul - get_local $21 + get_local $22 i64.const 4294967295 i64.and i64.add - set_local $22 - get_local $22 + set_local $23 + get_local $23 i64.const 2147483647 i64.add - set_local $22 - get_local $21 - i64.const 32 - i64.shr_u - set_local $21 + set_local $23 get_local $22 i64.const 32 i64.shr_u set_local $22 + get_local $23 + i64.const 32 + i64.shr_u + set_local $23 + get_local $17 get_local $16 - get_local $15 i64.mul - get_local $21 - i64.add get_local $22 i64.add + get_local $23 + i64.add end i64.const 1 i64.sub - set_local $22 + set_local $23 block $~lib/internal/number/umul64e|inlined.1 (result i32) get_global $~lib/internal/number/_exp set_local $9 @@ -12274,92 +12638,92 @@ set_local $9 block $~lib/internal/number/umul64f|inlined.2 (result i64) get_global $~lib/internal/number/_frc_minus - set_local $21 - get_local $21 - i64.const 4294967295 - i64.and - set_local $14 - get_local $7 + set_local $22 + get_local $22 i64.const 4294967295 i64.and set_local $15 - get_local $21 - i64.const 32 - i64.shr_u - set_local $16 get_local $7 + i64.const 4294967295 + i64.and + set_local $16 + get_local $22 i64.const 32 i64.shr_u set_local $17 - get_local $14 - get_local $15 - i64.mul + get_local $7 + i64.const 32 + i64.shr_u set_local $18 - get_local $16 get_local $15 + get_local $16 i64.mul - get_local $18 + set_local $19 + get_local $17 + get_local $16 + i64.mul + get_local $19 i64.const 32 i64.shr_u i64.add - set_local $19 - get_local $14 - get_local $17 + set_local $20 + get_local $15 + get_local $18 i64.mul - get_local $19 + get_local $20 i64.const 4294967295 i64.and i64.add - set_local $23 - get_local $23 + set_local $24 + get_local $24 i64.const 2147483647 i64.add - set_local $23 - get_local $19 + set_local $24 + get_local $20 i64.const 32 i64.shr_u - set_local $19 - get_local $23 + set_local $20 + get_local $24 i64.const 32 i64.shr_u - set_local $23 - get_local $16 + set_local $24 get_local $17 + get_local $18 i64.mul - get_local $19 + get_local $20 i64.add - get_local $23 + get_local $24 i64.add end i64.const 1 i64.add - set_local $23 - get_local $22 + set_local $24 get_local $23 + get_local $24 i64.sub - set_local $19 + set_local $20 get_local $0 - get_local $20 + get_local $21 get_local $8 - get_local $22 + get_local $23 get_local $9 - get_local $19 + get_local $20 get_local $2 call $~lib/internal/number/genDigits end - set_local $24 + set_local $25 get_local $0 get_local $2 i32.const 1 i32.shl i32.add - get_local $24 + get_local $25 get_local $2 i32.sub get_global $~lib/internal/number/_K call $~lib/internal/number/prettify - set_local $24 - get_local $24 + set_local $25 + get_local $25 get_local $2 i32.add ) @@ -12523,6 +12887,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -12550,14 +12915,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.13 (result f64) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 3 i32.shl i32.add + get_local $9 + i32.add f64.load offset=8 end call $~lib/internal/number/dtoa @@ -12570,10 +12939,10 @@ i32.mul i32.const 28 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -12586,17 +12955,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.4 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.14 (result f64) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 3 i32.shl i32.add + get_local $12 + i32.add f64.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/dtoa_stream @@ -12604,7 +12977,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -12625,34 +12998,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.5 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.15 (result f64) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 3 i32.shl i32.add + get_local $11 + i32.add f64.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/dtoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -12664,7 +13041,7 @@ end block $~lib/memory/memory.free|inlined.8 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.8 unreachable @@ -12714,51 +13091,59 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end return end i32.const 0 - set_local $8 + set_local $9 block $break|0 block i32.const 0 - set_local $9 + set_local $8 get_local $2 i32.const 1 i32.add set_local $10 end loop $repeat|0 - get_local $9 + get_local $8 get_local $10 i32.lt_s i32.eqz br_if $break|0 - get_local $8 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.4 (result i32) + get_local $9 + block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i32) + i32.const 0 + set_local $11 get_local $5 - get_local $9 + get_local $8 i32.const 2 i32.shl i32.add + get_local $11 + i32.add i32.load offset=8 end i32.load i32.add - set_local $8 - get_local $9 + set_local $9 + get_local $8 i32.const 1 i32.add - set_local $9 + set_local $8 br $repeat|0 unreachable end @@ -12766,13 +13151,13 @@ end i32.const 0 set_local $10 - get_local $8 + get_local $9 get_local $6 get_local $2 i32.mul i32.add call $~lib/internal/string/allocateUnsafe - set_local $9 + set_local $8 block $break|1 i32.const 0 set_local $11 @@ -12783,12 +13168,16 @@ i32.eqz br_if $break|1 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.5 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i32.load offset=8 end set_local $4 @@ -12797,7 +13186,7 @@ get_local $4 i32.load set_local $12 - get_local $9 + get_local $8 get_local $10 get_local $4 i32.const 0 @@ -12810,7 +13199,7 @@ end get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -12831,12 +13220,16 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.6 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.8 (result i32) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $11 + i32.add i32.load offset=8 end set_local $4 @@ -12845,14 +13238,14 @@ get_local $4 i32.load set_local $11 - get_local $9 + get_local $8 get_local $10 get_local $4 i32.const 0 get_local $11 call $~lib/internal/string/copyUnsafe end - get_local $9 + get_local $8 return ) (func $std/array/Ref#constructor (; 194 ;) (type $ii) (param $0 i32) (result i32) @@ -12882,7 +13275,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -12932,14 +13325,19 @@ ) (func $~lib/array/Array#__unchecked_set (; 196 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) get_local $0 i32.load set_local $3 + i32.const 0 + set_local $4 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store offset=8 ) @@ -12954,6 +13352,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -13007,12 +13406,16 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i32.load offset=8 end set_local $4 @@ -13052,12 +13455,16 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $11 + i32.add i32.load offset=8 end if @@ -13193,6 +13600,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -13220,14 +13628,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 0 i32.shl i32.add + get_local $9 + i32.add i32.load8_s offset=8 end call $~lib/internal/number/itoa @@ -13240,10 +13652,10 @@ i32.mul i32.const 11 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -13256,17 +13668,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 0 i32.shl i32.add + get_local $12 + i32.add i32.load8_s offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream @@ -13274,7 +13690,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -13295,34 +13711,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 0 i32.shl i32.add + get_local $11 + i32.add i32.load8_s offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -13334,7 +13754,7 @@ end block $~lib/memory/memory.free|inlined.10 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.10 unreachable @@ -13400,6 +13820,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -13427,14 +13848,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 1 i32.shl i32.add + get_local $9 + i32.add i32.load16_u offset=8 end call $~lib/internal/number/itoa @@ -13447,10 +13872,10 @@ i32.mul i32.const 10 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -13463,17 +13888,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 1 i32.shl i32.add + get_local $12 + i32.add i32.load16_u offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream @@ -13481,7 +13910,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -13502,34 +13931,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 1 i32.shl i32.add + get_local $11 + i32.add i32.load16_u offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -13541,7 +13974,7 @@ end block $~lib/memory/memory.free|inlined.11 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.11 unreachable @@ -13631,8 +14064,9 @@ (local $9 i32) (local $10 i32) (local $11 i32) - (local $12 i64) + (local $12 i32) (local $13 i64) + (local $14 i64) block $~lib/internal/number/DIGITS|inlined.1 (result i32) i32.const 7632 end @@ -13682,24 +14116,32 @@ i32.const 100 i32.rem_u set_local $11 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.4 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $10 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $12 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.5 (result i64) + set_local $13 + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $11 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $13 + set_local $14 get_local $2 i32.const 4 i32.sub @@ -13709,30 +14151,38 @@ i32.const 1 i32.shl i32.add - get_local $12 get_local $13 + get_local $14 i64.const 32 i64.shl i64.or i64.store offset=4 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.6 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $8 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $12 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.7 (result i64) + set_local $13 + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $9 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $13 + set_local $14 get_local $2 i32.const 4 i32.sub @@ -13742,8 +14192,8 @@ i32.const 1 i32.shl i32.add - get_local $12 get_local $13 + get_local $14 i64.const 32 i64.shl i64.or @@ -13863,6 +14313,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -13890,14 +14341,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 3 i32.shl i32.add + get_local $9 + i32.add i64.load offset=8 end call $~lib/internal/number/itoa @@ -13910,10 +14365,10 @@ i32.mul i32.const 20 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -13926,17 +14381,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 3 i32.shl i32.add + get_local $12 + i32.add i64.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream @@ -13944,7 +14403,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -13965,34 +14424,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 3 i32.shl i32.add + get_local $11 + i32.add i64.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -14004,7 +14467,7 @@ end block $~lib/memory/memory.free|inlined.12 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.12 unreachable @@ -14163,6 +14626,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -14190,14 +14654,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 3 i32.shl i32.add + get_local $9 + i32.add i64.load offset=8 end call $~lib/internal/number/itoa @@ -14210,10 +14678,10 @@ i32.mul i32.const 21 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -14226,17 +14694,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 3 i32.shl i32.add + get_local $12 + i32.add i64.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream @@ -14244,7 +14716,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -14265,34 +14737,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 3 i32.shl i32.add + get_local $11 + i32.add i64.load offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -14304,7 +14780,7 @@ end block $~lib/memory/memory.free|inlined.13 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.13 unreachable @@ -14323,6 +14799,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -14350,14 +14827,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.3 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.5 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 @@ -14373,20 +14854,24 @@ end block $break|0 i32.const 0 - set_local $8 + set_local $9 loop $repeat|0 - get_local $8 + get_local $9 get_local $2 i32.lt_s i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.4 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.6 (result i32) + i32.const 0 + set_local $8 get_local $5 - get_local $8 + get_local $9 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i32.load offset=8 end set_local $4 @@ -14407,21 +14892,25 @@ set_local $3 end end - get_local $8 + get_local $9 i32.const 1 i32.add - set_local $8 + set_local $9 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.5 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.7 (result i32) + i32.const 0 + set_local $9 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 @@ -14492,6 +14981,7 @@ (local $9 i32) (local $10 i32) (local $11 i32) + (local $12 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -14519,14 +15009,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 0 i32.shl i32.add + get_local $9 + i32.add i32.load8_u offset=8 end call $~lib/internal/number/itoa @@ -14539,10 +15033,10 @@ i32.mul i32.const 10 i32.add - set_local $8 - get_local $8 - call $~lib/internal/string/allocateUnsafe set_local $9 + get_local $9 + call $~lib/internal/string/allocateUnsafe + set_local $8 i32.const 0 set_local $10 block $break|0 @@ -14555,17 +15049,21 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i32) + i32.const 0 + set_local $12 get_local $5 get_local $11 i32.const 0 i32.shl i32.add + get_local $12 + i32.add i32.load8_u offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream @@ -14573,7 +15071,7 @@ set_local $10 get_local $7 if - get_local $9 + get_local $8 get_local $10 get_local $1 i32.const 0 @@ -14594,34 +15092,38 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i32) + i32.const 0 + set_local $11 get_local $5 get_local $2 i32.const 0 i32.shl i32.add + get_local $11 + i32.add i32.load8_u offset=8 end set_local $4 get_local $10 - get_local $9 + get_local $8 get_local $10 get_local $4 call $~lib/internal/number/itoa_stream i32.add set_local $10 - get_local $9 - set_local $11 get_local $8 + set_local $11 + get_local $9 get_local $10 i32.gt_s if - get_local $9 + get_local $8 i32.const 0 get_local $10 call $~lib/string/String#substring set_local $11 - get_local $9 + get_local $8 i32.eqz if i32.const 0 @@ -14633,7 +15135,7 @@ end block $~lib/memory/memory.free|inlined.14 block - get_local $9 + get_local $8 call $~lib/allocator/arena/__memory_free br $~lib/memory/memory.free|inlined.14 unreachable @@ -14652,6 +15154,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -14679,14 +15182,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.0 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 @@ -14702,20 +15209,24 @@ end block $break|0 i32.const 0 - set_local $8 + set_local $9 loop $repeat|0 - get_local $8 + get_local $9 get_local $2 i32.lt_s i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.1 (result i32) + i32.const 0 + set_local $8 get_local $5 - get_local $8 + get_local $9 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i32.load offset=8 end set_local $4 @@ -14736,21 +15247,25 @@ set_local $3 end end - get_local $8 + get_local $9 i32.const 1 i32.add - set_local $8 + set_local $9 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.2 (result i32) + i32.const 0 + set_local $9 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 @@ -14774,6 +15289,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -14801,14 +15317,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.0 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 @@ -14824,20 +15344,24 @@ end block $break|0 i32.const 0 - set_local $8 + set_local $9 loop $repeat|0 - get_local $8 + get_local $9 get_local $2 i32.lt_s i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.1 (result i32) + i32.const 0 + set_local $8 get_local $5 - get_local $8 + get_local $9 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i32.load offset=8 end set_local $4 @@ -14858,21 +15382,25 @@ set_local $3 end end - get_local $8 + get_local $9 i32.const 1 i32.add - set_local $8 + set_local $9 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe,Array>|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD,Array>|inlined.2 (result i32) + i32.const 0 + set_local $9 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 @@ -14896,6 +15424,7 @@ (local $6 i32) (local $7 i32) (local $8 i32) + (local $9 i32) get_local $0 i32.load offset=4 i32.const 1 @@ -14923,14 +15452,18 @@ get_local $2 i32.eqz if - block $~lib/internal/arraybuffer/loadUnsafe>,Array>>|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD>,Array>>|inlined.0 (result i32) i32.const 0 set_local $8 + i32.const 0 + set_local $9 get_local $5 get_local $8 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 @@ -14946,20 +15479,24 @@ end block $break|0 i32.const 0 - set_local $8 + set_local $9 loop $repeat|0 - get_local $8 + get_local $9 get_local $2 i32.lt_s i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafe>,Array>>|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD>,Array>>|inlined.1 (result i32) + i32.const 0 + set_local $8 get_local $5 - get_local $8 + get_local $9 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i32.load offset=8 end set_local $4 @@ -14980,21 +15517,25 @@ set_local $3 end end - get_local $8 + get_local $9 i32.const 1 i32.add - set_local $8 + set_local $9 br $repeat|0 unreachable end unreachable end - block $~lib/internal/arraybuffer/loadUnsafe>,Array>>|inlined.2 (result i32) + block $~lib/internal/arraybuffer/LOAD>,Array>>|inlined.2 (result i32) + i32.const 0 + set_local $9 get_local $5 get_local $2 i32.const 2 i32.shl i32.add + get_local $9 + i32.add i32.load offset=8 end set_local $4 diff --git a/tests/compiler/std/dataview.optimized.wat b/tests/compiler/std/dataview.optimized.wat index 4b74bdb5..6a424054 100644 --- a/tests/compiler/std/dataview.optimized.wat +++ b/tests/compiler/std/dataview.optimized.wat @@ -339,7 +339,7 @@ end end ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 4 ;) (type $FUNCSIG$i) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 4 ;) (type $FUNCSIG$i) (result i32) (local $0 i32) (local $1 i32) i32.const 8 @@ -371,7 +371,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) get_local $1 get_local $0 i32.load offset=8 @@ -379,16 +379,16 @@ if i32.const 0 i32.const 8 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable end + get_local $0 + i32.load offset=4 get_local $1 get_local $0 i32.load - get_local $0 - i32.load offset=4 i32.add i32.add get_local $2 @@ -1092,40 +1092,40 @@ set_global $~lib/allocator/arena/startOffset get_global $~lib/allocator/arena/startOffset set_global $~lib/allocator/arena/offset - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/dataview/array get_global $std/dataview/array i32.const 0 i32.const 246 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 1 i32.const 224 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 2 i32.const 88 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 3 i32.const 159 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 4 i32.const 130 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 5 i32.const 101 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 6 i32.const 67 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 7 i32.const 95 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.load get_global $std/dataview/array diff --git a/tests/compiler/std/dataview.untouched.wat b/tests/compiler/std/dataview.untouched.wat index 422adc3f..43aedbf2 100644 --- a/tests/compiler/std/dataview.untouched.wat +++ b/tests/compiler/std/dataview.untouched.wat @@ -415,7 +415,7 @@ call $~lib/allocator/arena/__memory_allocate return ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -426,7 +426,7 @@ if i32.const 0 i32.const 8 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -480,7 +480,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) get_local $1 @@ -492,7 +492,7 @@ if i32.const 0 i32.const 8 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -504,12 +504,12 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 0 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store8 offset=8 ) @@ -1703,40 +1703,40 @@ set_global $~lib/allocator/arena/offset i32.const 0 i32.const 8 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/dataview/array get_global $std/dataview/array i32.const 0 i32.const 246 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 1 i32.const 224 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 2 i32.const 88 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 3 i32.const 159 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 4 i32.const 130 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 5 i32.const 101 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 6 i32.const 67 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/dataview/array i32.const 7 i32.const 95 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set i32.const 0 get_global $std/dataview/array i32.load diff --git a/tests/compiler/std/gc-array.optimized.wat b/tests/compiler/std/gc-array.optimized.wat index 99578f95..3ebbdc0e 100644 --- a/tests/compiler/std/gc-array.optimized.wat +++ b/tests/compiler/std/gc-array.optimized.wat @@ -1900,7 +1900,7 @@ if i32.const 0 i32.const 72 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -1920,10 +1920,10 @@ get_local $4 i32.store offset=4 end + get_local $3 get_local $1 i32.const 2 i32.shl - get_local $3 i32.add get_local $2 i32.store offset=8 diff --git a/tests/compiler/std/gc-array.untouched.wat b/tests/compiler/std/gc-array.untouched.wat index b4d953e0..78b38bad 100644 --- a/tests/compiler/std/gc-array.untouched.wat +++ b/tests/compiler/std/gc-array.untouched.wat @@ -2412,6 +2412,7 @@ (func $~lib/array/Array#__set (; 28 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -2430,7 +2431,7 @@ if i32.const 0 i32.const 72 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -2452,11 +2453,15 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $2 i32.store offset=8 get_local $0 diff --git a/tests/compiler/std/static-array.untouched.wat b/tests/compiler/std/static-array.untouched.wat index bc73ca8b..f3ba5582 100644 --- a/tests/compiler/std/static-array.untouched.wat +++ b/tests/compiler/std/static-array.untouched.wat @@ -43,6 +43,7 @@ (start $start) (func $~lib/array/Array#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -53,11 +54,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -1978,6 +1983,7 @@ (func $~lib/array/Array#__set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -1996,7 +2002,7 @@ if i32.const 0 i32.const 184 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -2018,16 +2024,21 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $2 i32.store offset=8 ) (func $~lib/array/Array#__get (; 10 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -2038,11 +2049,15 @@ i32.shr_u i32.lt_u if (result i64) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 3 i32.shl i32.add + get_local $3 + i32.add i64.load offset=8 else unreachable @@ -2051,6 +2066,7 @@ (func $~lib/array/Array#__set (; 11 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -2069,7 +2085,7 @@ if i32.const 0 i32.const 184 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -2091,16 +2107,21 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 3 i32.shl i32.add + get_local $5 + i32.add get_local $2 i64.store offset=8 ) (func $~lib/array/Array#__get (; 12 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -2111,11 +2132,15 @@ i32.shr_u i32.lt_u if (result f32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add f32.load offset=8 else unreachable @@ -2124,6 +2149,7 @@ (func $~lib/array/Array#__set (; 13 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -2142,7 +2168,7 @@ if i32.const 0 i32.const 184 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -2164,16 +2190,21 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $2 f32.store offset=8 ) (func $~lib/array/Array#__get (; 14 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -2184,11 +2215,15 @@ i32.shr_u i32.lt_u if (result f64) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 3 i32.shl i32.add + get_local $3 + i32.add f64.load offset=8 else unreachable @@ -2197,6 +2232,7 @@ (func $~lib/array/Array#__set (; 15 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) (local $4 i32) + (local $5 i32) get_local $0 i32.load set_local $3 @@ -2215,7 +2251,7 @@ if i32.const 0 i32.const 184 - i32.const 109 + i32.const 110 i32.const 41 call $~lib/env/abort unreachable @@ -2237,11 +2273,15 @@ i32.add i32.store offset=4 end + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 3 i32.shl i32.add + get_local $5 + i32.add get_local $2 f64.store offset=8 ) diff --git a/tests/compiler/std/string.optimized.wat b/tests/compiler/std/string.optimized.wat index 17e0dd60..76c175fe 100644 --- a/tests/compiler/std/string.optimized.wat +++ b/tests/compiler/std/string.optimized.wat @@ -3304,7 +3304,7 @@ if i32.const 0 i32.const 976 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -3452,7 +3452,7 @@ if i32.const 0 i32.const 976 - i32.const 184 + i32.const 185 i32.const 42 call $~lib/env/abort unreachable @@ -3469,10 +3469,10 @@ get_local $0 get_local $3 i32.store offset=4 + get_local $4 get_local $2 i32.const 2 i32.shl - get_local $4 i32.add get_local $1 i32.store offset=8 @@ -3787,20 +3787,20 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $4 i32.const 100 i32.div_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 + get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -3830,10 +3830,10 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $4 i32.const 2 i32.shl - get_local $3 i32.add i32.load offset=8 i32.store offset=4 @@ -3849,10 +3849,10 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $1 i32.const 2 i32.shl - get_local $3 i32.add i32.load offset=8 i32.store offset=4 @@ -4022,6 +4022,7 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $4 i32.const 10000 i32.rem_u @@ -4030,15 +4031,14 @@ i32.div_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 + get_local $3 get_local $4 i32.const 100 i32.rem_u i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -4053,16 +4053,16 @@ i32.shl get_local $0 i32.add + get_local $3 get_local $6 i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 + get_local $3 get_local $5 i32.const 2 i32.shl - get_local $3 i32.add i64.load32_u offset=8 i64.const 32 @@ -4374,10 +4374,10 @@ get_local $9 i32.add set_global $~lib/internal/number/_K + get_local $12 get_local $9 i32.const 2 i32.shl - get_local $12 i32.add i64.load32_u offset=8 get_local $11 @@ -4503,12 +4503,12 @@ get_local $9 i32.add set_global $~lib/internal/number/_K + get_local $12 i32.const 0 get_local $9 i32.sub i32.const 2 i32.shl - get_local $12 i32.add i64.load32_u offset=8 get_local $8 @@ -4521,9 +4521,9 @@ i32.shl get_local $0 i32.add - tee_local $4 + tee_local $7 i32.load16_u offset=4 - set_local $7 + set_local $4 loop $continue|4 get_local $1 get_local $8 @@ -4561,10 +4561,10 @@ end get_local $2 if - get_local $7 + get_local $4 i32.const 1 i32.sub - set_local $7 + set_local $4 get_local $1 get_local $10 i64.add @@ -4572,8 +4572,8 @@ br $continue|4 end end - get_local $4 get_local $7 + get_local $4 i32.store16 offset=4 get_local $6 else @@ -4979,10 +4979,10 @@ i32.add i64.load offset=8 set_global $~lib/internal/number/_frc_pow + get_local $4 get_local $5 i32.const 1 i32.shl - get_local $4 i32.add i32.load16_s offset=8 set_global $~lib/internal/number/_exp_pow diff --git a/tests/compiler/std/string.untouched.wat b/tests/compiler/std/string.untouched.wat index ef756096..304a6b3a 100644 --- a/tests/compiler/std/string.untouched.wat +++ b/tests/compiler/std/string.untouched.wat @@ -4103,7 +4103,7 @@ if i32.const 0 i32.const 976 - i32.const 45 + i32.const 46 i32.const 39 call $~lib/env/abort unreachable @@ -4153,14 +4153,19 @@ ) (func $~lib/array/Array#__unchecked_set (; 39 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) + (local $4 i32) get_local $0 i32.load set_local $3 + i32.const 0 + set_local $4 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store offset=8 ) @@ -4279,6 +4284,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) + (local $6 i32) get_local $0 i32.load offset=4 set_local $2 @@ -4304,7 +4310,7 @@ if i32.const 0 i32.const 976 - i32.const 184 + i32.const 185 i32.const 42 call $~lib/env/abort unreachable @@ -4322,11 +4328,15 @@ get_local $0 get_local $5 i32.store offset=4 + i32.const 0 + set_local $6 get_local $3 get_local $2 i32.const 2 i32.shl i32.add + get_local $6 + i32.add get_local $1 i32.store offset=8 get_local $5 @@ -4344,6 +4354,7 @@ (local $12 i32) (local $13 i32) (local $14 i32) + (local $15 i32) get_local $0 i32.const 0 i32.ne @@ -4442,11 +4453,15 @@ i32.add i32.load16_u offset=4 i32.store16 offset=4 + i32.const 0 + set_local $9 get_local $6 get_local $7 i32.const 2 i32.shl i32.add + get_local $9 + i32.add get_local $8 i32.store offset=8 end @@ -4472,26 +4487,26 @@ i32.const 0 i32.const 0 call $~lib/array/Array#constructor - set_local $9 - i32.const 0 set_local $10 i32.const 0 set_local $11 i32.const 0 set_local $12 + i32.const 0 + set_local $13 block $break|1 loop $continue|1 get_local $0 get_local $1 - get_local $11 + get_local $12 call $~lib/string/String#indexOf - tee_local $10 + tee_local $11 i32.const -1 i32.ne if block - get_local $10 get_local $11 + get_local $12 i32.sub set_local $6 get_local $6 @@ -4504,82 +4519,82 @@ get_local $3 i32.const 0 get_local $0 - get_local $11 + get_local $12 get_local $6 call $~lib/internal/string/copyUnsafe - get_local $9 + get_local $10 get_local $3 call $~lib/array/Array#push drop else - get_local $9 + get_local $10 i32.const 256 call $~lib/array/Array#push drop end - get_local $12 + get_local $13 i32.const 1 i32.add - tee_local $12 + tee_local $13 get_local $2 i32.eq if - get_local $9 + get_local $10 return end - get_local $10 + get_local $11 get_local $5 i32.add - set_local $11 + set_local $12 end br $continue|1 end end end - get_local $11 + get_local $12 i32.eqz if block (result i32) i32.const 0 i32.const 1 call $~lib/array/Array#constructor - set_local $13 - get_local $13 + set_local $14 + get_local $14 i32.const 0 get_local $0 call $~lib/array/Array#__unchecked_set - get_local $13 + get_local $14 end return end get_local $4 - get_local $11 + get_local $12 i32.sub - set_local $14 - get_local $14 + set_local $15 + get_local $15 i32.const 0 i32.gt_s if - get_local $14 + get_local $15 call $~lib/internal/string/allocateUnsafe - set_local $13 - get_local $13 + set_local $14 + get_local $14 i32.const 0 get_local $0 - get_local $11 - get_local $14 + get_local $12 + get_local $15 call $~lib/internal/string/copyUnsafe - get_local $9 - get_local $13 + get_local $10 + get_local $14 call $~lib/array/Array#push drop else - get_local $9 + get_local $10 i32.const 256 call $~lib/array/Array#push drop end - get_local $9 + get_local $10 ) (func $~lib/string/String#split|trampoline (; 43 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) block $2of2 @@ -4604,6 +4619,7 @@ ) (func $~lib/array/Array#__get (; 44 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -4614,11 +4630,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -4699,8 +4719,9 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i64) + (local $8 i32) (local $9 i64) + (local $10 i64) block $~lib/internal/number/DIGITS|inlined.0 (result i32) i32.const 1720 end @@ -4731,24 +4752,32 @@ i32.const 100 i32.rem_u set_local $7 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) + i32.const 0 + set_local $8 get_local $3 get_local $6 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i64.load32_u offset=8 end - set_local $8 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i64) + set_local $9 + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i64) + i32.const 0 + set_local $8 get_local $3 get_local $7 i32.const 2 i32.shl i32.add + get_local $8 + i32.add i64.load32_u offset=8 end - set_local $9 + set_local $10 get_local $2 i32.const 4 i32.sub @@ -4758,8 +4787,8 @@ i32.const 1 i32.shl i32.add - get_local $8 get_local $9 + get_local $10 i64.const 32 i64.shl i64.or @@ -4787,12 +4816,16 @@ i32.const 2 i32.sub set_local $2 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) + i32.const 0 + set_local $5 get_local $3 get_local $6 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end set_local $5 @@ -4812,12 +4845,16 @@ i32.const 2 i32.sub set_local $2 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.1 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result i32) + i32.const 0 + set_local $5 get_local $3 get_local $1 i32.const 2 i32.shl i32.add + get_local $5 + i32.add i32.load offset=8 end set_local $5 @@ -4987,8 +5024,9 @@ (local $9 i32) (local $10 i32) (local $11 i32) - (local $12 i64) + (local $12 i32) (local $13 i64) + (local $14 i64) block $~lib/internal/number/DIGITS|inlined.1 (result i32) i32.const 2512 end @@ -5038,24 +5076,32 @@ i32.const 100 i32.rem_u set_local $11 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.2 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $10 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $12 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.3 (result i64) + set_local $13 + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $11 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $13 + set_local $14 get_local $2 i32.const 4 i32.sub @@ -5065,30 +5111,38 @@ i32.const 1 i32.shl i32.add - get_local $12 get_local $13 + get_local $14 i64.const 32 i64.shl i64.or i64.store offset=4 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.4 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.4 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $8 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $12 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.5 (result i64) + set_local $13 + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result i64) + i32.const 0 + set_local $12 get_local $3 get_local $9 i32.const 2 i32.shl i32.add + get_local $12 + i32.add i64.load32_u offset=8 end - set_local $13 + set_local $14 get_local $2 i32.const 4 i32.sub @@ -5098,8 +5152,8 @@ i32.const 1 i32.shl i32.add - get_local $12 get_local $13 + get_local $14 i64.const 32 i64.shl i64.or @@ -5539,12 +5593,16 @@ get_local $14 i32.add set_global $~lib/internal/number/_K - block $~lib/internal/arraybuffer/loadUnsafe|inlined.6 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.6 (result i64) + i32.const 0 + set_local $18 get_local $16 get_local $14 i32.const 2 i32.shl i32.add + get_local $18 + i32.add i64.load32_u offset=8 end get_local $7 @@ -5689,16 +5747,20 @@ i32.add set_global $~lib/internal/number/_K get_local $10 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.7 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result i64) i32.const 0 get_local $14 i32.sub set_local $17 + i32.const 0 + set_local $21 get_local $16 get_local $17 i32.const 2 i32.shl i32.add + get_local $21 + i32.add i64.load32_u offset=8 end i64.mul @@ -5710,10 +5772,10 @@ i32.const 1 i32.shl i32.add - set_local $17 - get_local $17 - i32.load16_u offset=4 set_local $21 + get_local $21 + i32.load16_u offset=4 + set_local $17 block $break|4 loop $continue|4 get_local $13 @@ -5755,10 +5817,10 @@ end if block - get_local $21 + get_local $17 i32.const 1 i32.sub - set_local $21 + set_local $17 get_local $13 get_local $8 i64.add @@ -5768,8 +5830,8 @@ end end end - get_local $17 get_local $21 + get_local $17 i32.store16 offset=4 get_local $15 return @@ -6138,7 +6200,7 @@ (local $11 f64) (local $12 i32) (local $13 i32) - (local $14 i64) + (local $14 i32) (local $15 i64) (local $16 i64) (local $17 i64) @@ -6148,7 +6210,8 @@ (local $21 i64) (local $22 i64) (local $23 i64) - (local $24 i32) + (local $24 i64) + (local $25 i32) get_local $1 f64.const 0 f64.lt @@ -6290,21 +6353,29 @@ end i32.load set_local $13 - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i64) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i64) + i32.const 0 + set_local $14 get_local $12 get_local $8 i32.const 3 i32.shl i32.add + get_local $14 + i32.add i64.load offset=8 end set_global $~lib/internal/number/_frc_pow - block $~lib/internal/arraybuffer/loadUnsafe|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) + i32.const 0 + set_local $14 get_local $13 get_local $8 i32.const 1 i32.shl i32.add + get_local $14 + i32.add i32.load16_s offset=8 end set_global $~lib/internal/number/_exp_pow @@ -6330,60 +6401,60 @@ get_local $6 i64.const 4294967295 i64.and - set_local $14 + set_local $15 get_local $7 i64.const 4294967295 i64.and - set_local $15 + set_local $16 get_local $6 i64.const 32 i64.shr_u - set_local $16 + set_local $17 get_local $7 i64.const 32 i64.shr_u - set_local $17 - get_local $14 - get_local $15 - i64.mul set_local $18 - get_local $16 get_local $15 + get_local $16 i64.mul - get_local $18 + set_local $19 + get_local $17 + get_local $16 + i64.mul + get_local $19 i64.const 32 i64.shr_u i64.add - set_local $19 - get_local $14 - get_local $17 + set_local $20 + get_local $15 + get_local $18 i64.mul - get_local $19 + get_local $20 i64.const 4294967295 i64.and i64.add - set_local $20 - get_local $20 + set_local $21 + get_local $21 i64.const 2147483647 i64.add - set_local $20 - get_local $19 - i64.const 32 - i64.shr_u - set_local $19 + set_local $21 get_local $20 i64.const 32 i64.shr_u set_local $20 - get_local $16 + get_local $21 + i64.const 32 + i64.shr_u + set_local $21 get_local $17 + get_local $18 i64.mul - get_local $19 - i64.add get_local $20 i64.add + get_local $21 + i64.add end - set_local $20 + set_local $21 block $~lib/internal/number/umul64e|inlined.0 (result i32) get_local $4 get_local $12 @@ -6394,66 +6465,66 @@ set_local $8 block $~lib/internal/number/umul64f|inlined.1 (result i64) get_global $~lib/internal/number/_frc_plus + set_local $20 + get_local $20 + i64.const 4294967295 + i64.and set_local $19 - get_local $19 + get_local $7 i64.const 4294967295 i64.and set_local $18 - get_local $7 - i64.const 4294967295 - i64.and + get_local $20 + i64.const 32 + i64.shr_u set_local $17 - get_local $19 + get_local $7 i64.const 32 i64.shr_u set_local $16 - get_local $7 - i64.const 32 - i64.shr_u - set_local $15 + get_local $19 get_local $18 - get_local $17 i64.mul - set_local $14 - get_local $16 + set_local $15 get_local $17 + get_local $18 i64.mul - get_local $14 + get_local $15 i64.const 32 i64.shr_u i64.add - set_local $21 - get_local $18 - get_local $15 + set_local $22 + get_local $19 + get_local $16 i64.mul - get_local $21 + get_local $22 i64.const 4294967295 i64.and i64.add - set_local $22 - get_local $22 + set_local $23 + get_local $23 i64.const 2147483647 i64.add - set_local $22 - get_local $21 - i64.const 32 - i64.shr_u - set_local $21 + set_local $23 get_local $22 i64.const 32 i64.shr_u set_local $22 + get_local $23 + i64.const 32 + i64.shr_u + set_local $23 + get_local $17 get_local $16 - get_local $15 i64.mul - get_local $21 - i64.add get_local $22 i64.add + get_local $23 + i64.add end i64.const 1 i64.sub - set_local $22 + set_local $23 block $~lib/internal/number/umul64e|inlined.1 (result i32) get_global $~lib/internal/number/_exp set_local $9 @@ -6466,92 +6537,92 @@ set_local $9 block $~lib/internal/number/umul64f|inlined.2 (result i64) get_global $~lib/internal/number/_frc_minus - set_local $21 - get_local $21 - i64.const 4294967295 - i64.and - set_local $14 - get_local $7 + set_local $22 + get_local $22 i64.const 4294967295 i64.and set_local $15 - get_local $21 - i64.const 32 - i64.shr_u - set_local $16 get_local $7 + i64.const 4294967295 + i64.and + set_local $16 + get_local $22 i64.const 32 i64.shr_u set_local $17 - get_local $14 - get_local $15 - i64.mul + get_local $7 + i64.const 32 + i64.shr_u set_local $18 - get_local $16 get_local $15 + get_local $16 i64.mul - get_local $18 + set_local $19 + get_local $17 + get_local $16 + i64.mul + get_local $19 i64.const 32 i64.shr_u i64.add - set_local $19 - get_local $14 - get_local $17 + set_local $20 + get_local $15 + get_local $18 i64.mul - get_local $19 + get_local $20 i64.const 4294967295 i64.and i64.add - set_local $23 - get_local $23 + set_local $24 + get_local $24 i64.const 2147483647 i64.add - set_local $23 - get_local $19 + set_local $24 + get_local $20 i64.const 32 i64.shr_u - set_local $19 - get_local $23 + set_local $20 + get_local $24 i64.const 32 i64.shr_u - set_local $23 - get_local $16 + set_local $24 get_local $17 + get_local $18 i64.mul - get_local $19 + get_local $20 i64.add - get_local $23 + get_local $24 i64.add end i64.const 1 i64.add - set_local $23 - get_local $22 + set_local $24 get_local $23 + get_local $24 i64.sub - set_local $19 + set_local $20 get_local $0 - get_local $20 + get_local $21 get_local $8 - get_local $22 + get_local $23 get_local $9 - get_local $19 + get_local $20 get_local $2 call $~lib/internal/number/genDigits end - set_local $24 + set_local $25 get_local $0 get_local $2 i32.const 1 i32.shl i32.add - get_local $24 + get_local $25 get_local $2 i32.sub get_global $~lib/internal/number/_K call $~lib/internal/number/prettify - set_local $24 - get_local $24 + set_local $25 + get_local $25 get_local $2 i32.add ) diff --git a/tests/compiler/std/typedarray.optimized.wat b/tests/compiler/std/typedarray.optimized.wat index 1d78ea15..316abf42 100644 --- a/tests/compiler/std/typedarray.optimized.wat +++ b/tests/compiler/std/typedarray.optimized.wat @@ -55,7 +55,7 @@ (data (i32.const 608) "\02") (data (i32.const 616) "H\02\00\00\05") (table $0 24 anyfunc) - (elem (i32.const 0) $null $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceFloat32ArrayTest~anonymous|11 $std/typedarray/reduceFloat64ArrayTest~anonymous|12 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceFloat32ArrayTest~anonymous|11 $std/typedarray/reduceFloat64ArrayTest~anonymous|12) + (elem (i32.const 0) $null $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceFloat32ArrayTest~anonymous|11 $std/typedarray/reduceFloat64ArrayTest~anonymous|12 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceFloat32ArrayTest~anonymous|11 $std/typedarray/reduceFloat64ArrayTest~anonymous|12) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $std/typedarray/arr (mut i32) (i32.const 0)) @@ -397,7 +397,7 @@ end end ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) get_local $0 @@ -406,7 +406,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -441,7 +441,7 @@ i32.store offset=8 get_local $1 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) get_local $0 @@ -450,7 +450,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -488,7 +488,7 @@ i32.store offset=8 get_local $1 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) get_local $0 @@ -497,7 +497,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -535,7 +535,7 @@ i32.store offset=8 get_local $1 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) get_local $0 @@ -544,7 +544,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -585,9 +585,21 @@ (func $std/typedarray/testInstantiate (; 8 ;) (type $iv) (param $0 i32) (local $1 i32) get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 + if + i32.const 0 + i32.const 8 + i32.const 34 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $1 + i32.load offset=8 + get_local $0 + i32.ne if i32.const 0 i32.const 8 @@ -596,9 +608,9 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 - get_local $0 i32.ne if i32.const 0 @@ -609,21 +621,21 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.ne + call $~lib/internal/typedarray/TypedArray#constructor + tee_local $1 + i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 37 + i32.const 39 i32.const 2 call $~lib/env/abort unreachable end + get_local $1 + i32.load offset=8 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor - tee_local $1 - i32.load offset=4 + i32.ne if i32.const 0 i32.const 8 @@ -632,9 +644,9 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 - get_local $0 i32.ne if i32.const 0 @@ -645,21 +657,21 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.ne + call $~lib/internal/typedarray/TypedArray#constructor + tee_local $1 + i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 42 + i32.const 44 i32.const 2 call $~lib/env/abort unreachable end + get_local $1 + i32.load offset=8 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor - tee_local $1 - i32.load offset=4 + i32.ne if i32.const 0 i32.const 8 @@ -668,9 +680,9 @@ call $~lib/env/abort unreachable end + get_local $0 get_local $1 i32.load offset=8 - get_local $0 i32.ne if i32.const 0 @@ -681,25 +693,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 47 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 50 + i32.const 49 i32.const 2 call $~lib/env/abort unreachable @@ -710,6 +710,20 @@ i32.const 1 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 50 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -719,27 +733,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.const 1 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 52 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 55 + i32.const 54 i32.const 2 call $~lib/env/abort unreachable @@ -750,6 +750,20 @@ i32.const 1 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 55 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 1 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -759,27 +773,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.const 1 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 57 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 60 + i32.const 59 i32.const 2 call $~lib/env/abort unreachable @@ -790,6 +790,20 @@ i32.const 2 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 60 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -799,27 +813,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 62 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 65 + i32.const 64 i32.const 2 call $~lib/env/abort unreachable @@ -830,6 +830,20 @@ i32.const 2 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 65 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -839,27 +853,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 67 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 70 + i32.const 69 i32.const 2 call $~lib/env/abort unreachable @@ -870,6 +870,20 @@ i32.const 3 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 70 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -879,27 +893,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 72 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 75 + i32.const 74 i32.const 2 call $~lib/env/abort unreachable @@ -910,6 +910,20 @@ i32.const 3 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 75 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -919,27 +933,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 77 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 80 + i32.const 79 i32.const 2 call $~lib/env/abort unreachable @@ -950,6 +950,20 @@ i32.const 2 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 80 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 2 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -959,27 +973,13 @@ unreachable end get_local $0 - get_local $1 - i32.load offset=8 - i32.const 2 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 82 - i32.const 2 - call $~lib/env/abort - unreachable - end - get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $1 i32.load offset=4 if i32.const 0 i32.const 8 - i32.const 85 + i32.const 84 i32.const 2 call $~lib/env/abort unreachable @@ -990,6 +990,20 @@ i32.const 3 i32.shl i32.ne + if + i32.const 0 + i32.const 8 + i32.const 85 + i32.const 2 + call $~lib/env/abort + unreachable + end + get_local $0 + get_local $1 + i32.load offset=8 + i32.const 3 + i32.shr_u + i32.ne if i32.const 0 i32.const 8 @@ -998,22 +1012,8 @@ call $~lib/env/abort unreachable end - get_local $0 - get_local $1 - i32.load offset=8 - i32.const 3 - i32.shr_u - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 87 - i32.const 2 - call $~lib/env/abort - unreachable - end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) get_local $1 get_local $0 i32.load offset=8 @@ -1023,24 +1023,24 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable end get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 2 i32.shl i32.add + i32.add get_local $2 i32.store offset=8 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) get_local $1 get_local $0 i32.load offset=8 @@ -1050,20 +1050,20 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 2 i32.shl i32.add + i32.add i32.load offset=8 ) (func $~lib/typedarray/Int32Array#subarray (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) @@ -1131,7 +1131,7 @@ i32.store offset=8 get_local $2 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 12 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) + (func $~lib/internal/typedarray/TypedArray#__set (; 12 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) get_local $1 get_local $0 i32.load offset=8 @@ -1141,20 +1141,20 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable end get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 3 i32.shl i32.add + i32.add get_local $2 f64.store offset=8 ) @@ -1221,12 +1221,12 @@ get_local $2 i32.ge_s br_if $break|0 - get_local $0 - get_local $1 - i32.add get_local $4 i32.const 3 i32.shl + get_local $0 + i32.add + get_local $1 i32.add f64.load offset=8 set_local $6 @@ -1240,12 +1240,12 @@ i32.ge_s if block $break|1 - get_local $0 - get_local $1 - i32.add get_local $5 i32.const 3 i32.shl + get_local $0 + i32.add + get_local $1 i32.add f64.load offset=8 set_local $7 @@ -1263,14 +1263,14 @@ i32.const 1 i32.sub set_local $5 - get_local $0 - get_local $1 - i32.add get_local $8 i32.const 1 i32.add i32.const 3 i32.shl + get_local $0 + i32.add + get_local $1 i32.add get_local $7 f64.store offset=8 @@ -1278,14 +1278,14 @@ end end end - get_local $0 - get_local $1 - i32.add get_local $5 i32.const 1 i32.add i32.const 3 i32.shl + get_local $0 + i32.add + get_local $1 i32.add get_local $6 f64.store offset=8 @@ -1306,7 +1306,6 @@ (local $7 f64) (local $8 f64) (local $9 i32) - (local $10 i32) get_local $2 i32.const 31 i32.add @@ -1314,28 +1313,28 @@ i32.shr_s i32.const 2 i32.shl - tee_local $4 + tee_local $6 call $~lib/allocator/arena/__memory_allocate tee_local $9 i32.const 0 - get_local $4 + get_local $6 call $~lib/internal/memory/memset get_local $2 i32.const 1 i32.sub - set_local $5 + set_local $4 loop $repeat|0 - get_local $5 + get_local $4 i32.const 0 i32.gt_s if - get_local $5 - set_local $4 + get_local $4 + set_local $6 loop $continue|1 - get_local $4 + get_local $6 i32.const 1 i32.and - get_local $4 + get_local $6 i32.const 6 i32.shr_s i32.const 2 @@ -1343,7 +1342,7 @@ get_local $9 i32.add i32.load - get_local $4 + get_local $6 i32.const 1 i32.shr_s i32.const 31 @@ -1353,30 +1352,31 @@ i32.and i32.eq if - get_local $4 + get_local $6 i32.const 1 i32.shr_s - set_local $4 + set_local $6 br $continue|1 end end - get_local $0 - get_local $1 - i32.add - tee_local $10 - get_local $4 + get_local $6 i32.const 1 i32.shr_s - tee_local $6 + tee_local $5 i32.const 3 i32.shl + get_local $0 + i32.add + get_local $1 i32.add f64.load offset=8 set_local $8 - get_local $5 + get_local $4 i32.const 3 i32.shl - get_local $10 + get_local $0 + i32.add + get_local $1 i32.add f64.load offset=8 set_local $7 @@ -1389,54 +1389,55 @@ i32.const 0 i32.lt_s if - get_local $5 + get_local $4 i32.const 5 i32.shr_s i32.const 2 i32.shl get_local $9 i32.add - tee_local $4 - get_local $4 + tee_local $6 + get_local $6 i32.load i32.const 1 - get_local $5 + get_local $4 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $1 - i32.add - tee_local $4 - get_local $5 + get_local $4 i32.const 3 i32.shl + get_local $0 + i32.add + get_local $1 i32.add get_local $8 f64.store offset=8 - get_local $6 + get_local $5 i32.const 3 i32.shl - get_local $4 + get_local $0 + i32.add + get_local $1 i32.add get_local $7 f64.store offset=8 end - get_local $5 + get_local $4 i32.const 1 i32.sub - set_local $5 + set_local $4 br $repeat|0 end end get_local $2 i32.const 1 i32.sub - set_local $5 + set_local $4 loop $repeat|2 - get_local $5 + get_local $4 i32.const 2 i32.ge_s if @@ -1447,23 +1448,23 @@ f64.load offset=8 set_local $7 get_local $2 - get_local $5 + get_local $4 i32.const 3 i32.shl - tee_local $4 - get_local $2 + get_local $0 i32.add + get_local $1 + i32.add + tee_local $2 f64.load offset=8 f64.store offset=8 get_local $2 - get_local $4 - i32.add get_local $7 f64.store offset=8 i32.const 1 - set_local $6 + set_local $5 loop $continue|3 - get_local $6 + get_local $5 i32.const 5 i32.shr_s i32.const 2 @@ -1471,40 +1472,41 @@ get_local $9 i32.add i32.load - get_local $6 + get_local $5 i32.const 31 i32.and i32.shr_u i32.const 1 i32.and - get_local $6 + get_local $5 i32.const 1 i32.shl i32.add - tee_local $4 - get_local $5 + tee_local $6 + get_local $4 i32.lt_s if - get_local $4 - set_local $6 + get_local $6 + set_local $5 br $continue|3 end end loop $continue|4 - get_local $6 + get_local $5 i32.const 0 i32.gt_s if get_local $0 get_local $1 i32.add - tee_local $2 f64.load offset=8 set_local $7 - get_local $6 + get_local $5 i32.const 3 i32.shl - get_local $2 + get_local $0 + i32.add + get_local $1 i32.add f64.load offset=8 set_local $8 @@ -1517,7 +1519,7 @@ i32.const 0 i32.lt_s if - get_local $6 + get_local $5 i32.const 5 i32.shr_s i32.const 2 @@ -1528,59 +1530,61 @@ get_local $2 i32.load i32.const 1 - get_local $6 + get_local $5 i32.const 31 i32.and i32.shl i32.xor i32.store - get_local $0 - get_local $1 - i32.add - tee_local $2 - get_local $6 + get_local $5 i32.const 3 i32.shl + get_local $0 + i32.add + get_local $1 i32.add get_local $7 f64.store offset=8 - get_local $2 + get_local $0 + get_local $1 + i32.add get_local $8 f64.store offset=8 end - get_local $6 + get_local $5 i32.const 1 i32.shr_s - set_local $6 + set_local $5 br $continue|4 end end - get_local $5 + get_local $4 i32.const 1 i32.sub - set_local $5 + set_local $4 br $repeat|2 end end get_local $0 + i32.const 8 + i32.add get_local $1 i32.add tee_local $2 - i32.const 8 - i32.add f64.load offset=8 set_local $7 get_local $2 - i32.const 8 + get_local $0 + get_local $1 i32.add - get_local $2 + tee_local $0 f64.load offset=8 f64.store offset=8 - get_local $2 + get_local $0 get_local $7 f64.store offset=8 ) - (func $~lib/internal/typedarray/TypedArray#sort (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#sort (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1589,79 +1593,78 @@ get_local $0 i32.load offset=4 set_local $2 - get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - tee_local $4 - i32.const 1 - i32.le_s - if + block $~lib/internal/typedarray/SORT|inlined.0 get_local $0 - return - end - get_local $0 - i32.load - set_local $3 - get_local $4 - i32.const 2 - i32.eq - if - get_local $2 - get_local $3 - i32.add - i32.const 8 - i32.add - f64.load offset=8 - set_local $5 - get_local $2 - get_local $3 - i32.add - f64.load offset=8 - set_local $6 + i32.load offset=8 + i32.const 3 + i32.shr_u + tee_local $4 + i32.const 1 + i32.le_s + br_if $~lib/internal/typedarray/SORT|inlined.0 + get_local $0 + i32.load + set_local $3 + get_local $4 i32.const 2 - set_global $~argc - get_local $5 - get_local $6 - get_local $1 - call_indirect (type $FFi) - i32.const 0 - i32.lt_s + i32.eq if + get_local $3 + i32.const 8 + i32.add + get_local $2 + i32.add + f64.load offset=8 + set_local $5 get_local $2 get_local $3 i32.add - tee_local $1 - i32.const 8 - i32.add - get_local $6 - f64.store offset=8 - get_local $1 + f64.load offset=8 + set_local $6 + i32.const 2 + set_global $~argc get_local $5 - f64.store offset=8 + get_local $6 + get_local $1 + call_indirect (type $FFi) + i32.const 0 + i32.lt_s + if + get_local $3 + i32.const 8 + i32.add + get_local $2 + i32.add + get_local $6 + f64.store offset=8 + get_local $2 + get_local $3 + i32.add + get_local $5 + f64.store offset=8 + end + br $~lib/internal/typedarray/SORT|inlined.0 end - get_local $0 - return - end - get_local $4 - i32.const 256 - i32.lt_s - if - get_local $3 - get_local $2 get_local $4 - get_local $1 - call $~lib/internal/array/insertionSort - else - get_local $3 - get_local $2 - get_local $4 - get_local $1 - call $~lib/internal/array/weakHeapSort + i32.const 256 + i32.lt_s + if + get_local $3 + get_local $2 + get_local $4 + get_local $1 + call $~lib/internal/array/insertionSort + else + get_local $3 + get_local $2 + get_local $4 + get_local $1 + call $~lib/internal/array/weakHeapSort + end end get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1 (; 17 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 (; 17 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) get_local $0 @@ -1690,7 +1693,7 @@ i64.lt_s i32.sub ) - (func $~lib/internal/typedarray/TypedArray#__get (; 18 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/internal/typedarray/TypedArray#__get (; 18 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) get_local $1 get_local $0 i32.load offset=8 @@ -1700,23 +1703,23 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 3 i32.shl i32.add + i32.add f64.load offset=8 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 19 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 19 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) get_local $1 get_local $0 i32.load offset=8 @@ -1724,16 +1727,16 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable end + get_local $0 + i32.load offset=4 get_local $1 get_local $0 i32.load - get_local $0 - i32.load offset=4 i32.add i32.add get_local $2 @@ -1755,9 +1758,9 @@ i32.const 0 i32.gt_s select - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set ) - (func $~lib/internal/typedarray/TypedArray#__get (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) get_local $1 get_local $0 i32.load offset=8 @@ -1765,21 +1768,21 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end + get_local $0 + i32.load offset=4 get_local $1 get_local $0 i32.load - get_local $0 - i32.load offset=4 i32.add i32.add i32.load8_u offset=8 ) - (func $~lib/internal/typedarray/TypedArray#fill (; 22 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int8Array#fill (; 22 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -1856,7 +1859,7 @@ end get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) get_local $1 get_local $0 i32.load offset=8 @@ -1864,16 +1867,16 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end + get_local $0 + i32.load offset=4 get_local $1 get_local $0 i32.load - get_local $0 - i32.load offset=4 i32.add i32.add i32.load8_s offset=8 @@ -1901,7 +1904,7 @@ if get_local $0 get_local $2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and get_local $2 @@ -1937,7 +1940,7 @@ end i32.const 1 ) - (func $~lib/internal/typedarray/TypedArray#fill|trampoline (; 25 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int8Array#fill|trampoline (; 25 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) block $2of2 block $1of2 @@ -1960,7 +1963,7 @@ get_local $1 get_local $2 get_local $3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill ) (func $~lib/typedarray/Int8Array#subarray (; 26 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -2021,7 +2024,7 @@ i32.store offset=8 get_local $2 ) - (func $~lib/internal/typedarray/TypedArray#fill (; 27 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int32Array#fill (; 27 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -2089,12 +2092,12 @@ i32.ge_s i32.eqz if - get_local $6 - get_local $7 - i32.add get_local $2 i32.const 2 i32.shl + get_local $6 + i32.add + get_local $7 i32.add get_local $1 i32.store offset=8 @@ -2134,7 +2137,7 @@ if get_local $0 get_local $2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get get_local $2 get_local $1 i32.load @@ -2170,7 +2173,7 @@ end i32.const 1 ) - (func $~lib/internal/typedarray/TypedArray#fill|trampoline (; 29 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int32Array#fill|trampoline (; 29 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) block $2of2 block $1of2 @@ -2193,7 +2196,7 @@ get_local $1 get_local $2 get_local $3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill ) (func $std/typedarray/reduceInt8ArrayTest~anonymous|2 (; 30 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 @@ -2216,12 +2219,12 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.add + i32.add i32.load8_s offset=8 get_local $1 get_local $0 @@ -2240,19 +2243,19 @@ (func $std/typedarray/reduceInt8ArrayTest (; 32 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Int8Array#reduce i32.const 255 @@ -2262,7 +2265,7 @@ if i32.const 0 i32.const 8 - i32.const 252 + i32.const 251 i32.const 2 call $~lib/env/abort unreachable @@ -2284,12 +2287,12 @@ set_global $~argc get_local $3 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $2 i32.add + i32.add i32.load8_u offset=8 get_local $2 get_local $0 @@ -2308,19 +2311,19 @@ (func $std/typedarray/reduceUint8ArrayTest (; 34 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 3 call $~lib/typedarray/Uint8Array#reduce @@ -2331,7 +2334,7 @@ if i32.const 0 i32.const 8 - i32.const 267 + i32.const 266 i32.const 2 call $~lib/env/abort unreachable @@ -2340,7 +2343,7 @@ (func $std/typedarray/reduceUint8ClampedArrayTest (; 35 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 @@ -2363,13 +2366,13 @@ if i32.const 0 i32.const 8 - i32.const 282 + i32.const 281 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 36 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 36 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) get_local $1 get_local $0 i32.load offset=8 @@ -2379,20 +2382,20 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable end get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 1 i32.shl i32.add + i32.add get_local $2 i32.store16 offset=8 ) @@ -2414,14 +2417,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 1 i32.shl i32.add + i32.add i32.load16_s offset=8 get_local $1 get_local $0 @@ -2440,19 +2443,19 @@ (func $std/typedarray/reduceInt16ArrayTest (; 38 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Int16Array#reduce i32.const 65535 @@ -2462,7 +2465,7 @@ if i32.const 0 i32.const 8 - i32.const 297 + i32.const 296 i32.const 2 call $~lib/env/abort unreachable @@ -2486,14 +2489,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 1 i32.shl i32.add + i32.add i32.load16_u offset=8 get_local $1 get_local $0 @@ -2512,19 +2515,19 @@ (func $std/typedarray/reduceUint16ArrayTest (; 40 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Uint16Array#reduce i32.const 65535 @@ -2534,7 +2537,7 @@ if i32.const 0 i32.const 8 - i32.const 312 + i32.const 311 i32.const 2 call $~lib/env/abort unreachable @@ -2558,14 +2561,14 @@ set_global $~argc get_local $3 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $2 i32.const 2 i32.shl i32.add + i32.add i32.load offset=8 get_local $2 get_local $0 @@ -2584,19 +2587,19 @@ (func $std/typedarray/reduceInt32ArrayTest (; 42 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 7 call $~lib/typedarray/Int32Array#reduce @@ -2605,7 +2608,7 @@ if i32.const 0 i32.const 8 - i32.const 327 + i32.const 326 i32.const 2 call $~lib/env/abort unreachable @@ -2614,19 +2617,19 @@ (func $std/typedarray/reduceUint32ArrayTest (; 43 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 8 call $~lib/typedarray/Int32Array#reduce @@ -2635,13 +2638,13 @@ if i32.const 0 i32.const 8 - i32.const 342 + i32.const 341 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 44 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/internal/typedarray/TypedArray#__set (; 44 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) get_local $1 get_local $0 i32.load offset=8 @@ -2651,20 +2654,20 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable end get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 3 i32.shl i32.add + i32.add get_local $2 i64.store offset=8 ) @@ -2691,14 +2694,14 @@ set_global $~argc get_local $3 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $2 i32.const 3 i32.shl i32.add + i32.add i64.load offset=8 get_local $2 get_local $0 @@ -2717,19 +2720,19 @@ (func $std/typedarray/reduceInt64ArrayTest (; 47 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 9 call $~lib/typedarray/Int64Array#reduce @@ -2738,7 +2741,7 @@ if i32.const 0 i32.const 8 - i32.const 357 + i32.const 356 i32.const 2 call $~lib/env/abort unreachable @@ -2747,19 +2750,19 @@ (func $std/typedarray/reduceUint64ArrayTest (; 48 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 10 call $~lib/typedarray/Int64Array#reduce @@ -2768,13 +2771,13 @@ if i32.const 0 i32.const 8 - i32.const 372 + i32.const 371 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 49 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/internal/typedarray/TypedArray#__set (; 49 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) get_local $1 get_local $0 i32.load offset=8 @@ -2784,20 +2787,20 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable end get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 2 i32.shl i32.add + i32.add get_local $2 f32.store offset=8 ) @@ -2824,14 +2827,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 2 i32.shl i32.add + i32.add f32.load offset=8 get_local $1 get_local $0 @@ -2850,19 +2853,19 @@ (func $std/typedarray/reduceFloat32ArrayTest (; 52 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Float32Array#reduce f32.const 6 @@ -2870,7 +2873,7 @@ if i32.const 0 i32.const 8 - i32.const 387 + i32.const 386 i32.const 2 call $~lib/env/abort unreachable @@ -2899,14 +2902,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 3 i32.shl i32.add + i32.add f64.load offset=8 get_local $1 get_local $0 @@ -2925,19 +2928,19 @@ (func $std/typedarray/reduceFloat64ArrayTest (; 55 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Float64Array#reduce f64.const 6 @@ -2945,7 +2948,7 @@ if i32.const 0 i32.const 8 - i32.const 402 + i32.const 401 i32.const 2 call $~lib/env/abort unreachable @@ -2968,12 +2971,12 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.add + i32.add i32.load8_s offset=8 get_local $1 get_local $0 @@ -2992,19 +2995,19 @@ (func $std/typedarray/reduceRightInt8ArrayTest (; 57 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Int8Array#reduceRight i32.const 255 @@ -3014,7 +3017,7 @@ if i32.const 0 i32.const 8 - i32.const 440 + i32.const 439 i32.const 2 call $~lib/env/abort unreachable @@ -3037,12 +3040,12 @@ set_global $~argc get_local $3 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $2 i32.add + i32.add i32.load8_u offset=8 get_local $2 get_local $0 @@ -3061,19 +3064,19 @@ (func $std/typedarray/reduceRightUint8ArrayTest (; 59 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 14 call $~lib/typedarray/Uint8Array#reduceRight @@ -3084,7 +3087,7 @@ if i32.const 0 i32.const 8 - i32.const 455 + i32.const 454 i32.const 2 call $~lib/env/abort unreachable @@ -3093,7 +3096,7 @@ (func $std/typedarray/reduceRightUint8ClampedArrayTest (; 60 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 @@ -3116,7 +3119,7 @@ if i32.const 0 i32.const 8 - i32.const 470 + i32.const 469 i32.const 2 call $~lib/env/abort unreachable @@ -3141,14 +3144,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 1 i32.shl i32.add + i32.add i32.load16_s offset=8 get_local $1 get_local $0 @@ -3167,19 +3170,19 @@ (func $std/typedarray/reduceRightInt16ArrayTest (; 62 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Int16Array#reduceRight i32.const 65535 @@ -3189,7 +3192,7 @@ if i32.const 0 i32.const 8 - i32.const 485 + i32.const 484 i32.const 2 call $~lib/env/abort unreachable @@ -3214,14 +3217,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 1 i32.shl i32.add + i32.add i32.load16_u offset=8 get_local $1 get_local $0 @@ -3240,19 +3243,19 @@ (func $std/typedarray/reduceRightUint16ArrayTest (; 64 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Uint16Array#reduceRight i32.const 65535 @@ -3262,7 +3265,7 @@ if i32.const 0 i32.const 8 - i32.const 500 + i32.const 499 i32.const 2 call $~lib/env/abort unreachable @@ -3287,14 +3290,14 @@ set_global $~argc get_local $3 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $2 i32.const 2 i32.shl i32.add + i32.add i32.load offset=8 get_local $2 get_local $0 @@ -3313,19 +3316,19 @@ (func $std/typedarray/reduceRightInt32ArrayTest (; 66 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 18 call $~lib/typedarray/Int32Array#reduceRight @@ -3334,7 +3337,7 @@ if i32.const 0 i32.const 8 - i32.const 515 + i32.const 514 i32.const 2 call $~lib/env/abort unreachable @@ -3343,19 +3346,19 @@ (func $std/typedarray/reduceRightUint32ArrayTest (; 67 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 19 call $~lib/typedarray/Int32Array#reduceRight @@ -3364,7 +3367,7 @@ if i32.const 0 i32.const 8 - i32.const 530 + i32.const 529 i32.const 2 call $~lib/env/abort unreachable @@ -3389,14 +3392,14 @@ set_global $~argc get_local $3 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $2 i32.const 3 i32.shl i32.add + i32.add i64.load offset=8 get_local $2 get_local $0 @@ -3415,19 +3418,19 @@ (func $std/typedarray/reduceRightInt64ArrayTest (; 69 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 20 call $~lib/typedarray/Int64Array#reduceRight @@ -3436,7 +3439,7 @@ if i32.const 0 i32.const 8 - i32.const 545 + i32.const 544 i32.const 2 call $~lib/env/abort unreachable @@ -3445,19 +3448,19 @@ (func $std/typedarray/reduceRightUint64ArrayTest (; 70 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 21 call $~lib/typedarray/Int64Array#reduceRight @@ -3466,7 +3469,7 @@ if i32.const 0 i32.const 8 - i32.const 560 + i32.const 559 i32.const 2 call $~lib/env/abort unreachable @@ -3491,14 +3494,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 2 i32.shl i32.add + i32.add f32.load offset=8 get_local $1 get_local $0 @@ -3517,19 +3520,19 @@ (func $std/typedarray/reduceRightFloat32ArrayTest (; 72 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Float32Array#reduceRight f32.const 6 @@ -3537,7 +3540,7 @@ if i32.const 0 i32.const 8 - i32.const 575 + i32.const 574 i32.const 2 call $~lib/env/abort unreachable @@ -3562,14 +3565,14 @@ set_global $~argc get_local $2 get_local $0 - i32.load - get_local $0 i32.load offset=4 - i32.add + get_local $0 + i32.load get_local $1 i32.const 3 i32.shl i32.add + i32.add f64.load offset=8 get_local $1 get_local $0 @@ -3588,19 +3591,19 @@ (func $std/typedarray/reduceRightFloat64ArrayTest (; 74 ;) (type $v) (local $0 i32) i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor tee_local $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 call $~lib/typedarray/Float64Array#reduceRight f64.const 6 @@ -3608,7 +3611,7 @@ if i32.const 0 i32.const 8 - i32.const 590 + i32.const 589 i32.const 2 call $~lib/env/abort unreachable @@ -3626,20 +3629,20 @@ i32.const 5 call $std/typedarray/testInstantiate i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/arr get_global $std/typedarray/arr i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr i32.load offset=8 i32.const 2 @@ -3649,7 +3652,7 @@ if i32.const 0 i32.const 8 - i32.const 97 + i32.const 96 i32.const 0 call $~lib/env/abort unreachable @@ -3659,7 +3662,7 @@ if i32.const 0 i32.const 8 - i32.const 98 + i32.const 97 i32.const 0 call $~lib/env/abort unreachable @@ -3671,16 +3674,29 @@ if i32.const 0 i32.const 8 - i32.const 99 + i32.const 98 i32.const 0 call $~lib/env/abort unreachable end get_global $std/typedarray/arr i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 1 i32.ne + if + i32.const 0 + i32.const 8 + i32.const 99 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/arr + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 2 + i32.ne if i32.const 0 i32.const 8 @@ -3690,27 +3706,14 @@ unreachable end get_global $std/typedarray/arr - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get i32.const 2 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 101 - i32.const 0 - call $~lib/env/abort - unreachable - end - get_global $std/typedarray/arr - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 3 i32.ne if i32.const 0 i32.const 8 - i32.const 102 + i32.const 101 i32.const 0 call $~lib/env/abort unreachable @@ -3728,7 +3731,7 @@ if i32.const 0 i32.const 8 - i32.const 105 + i32.const 104 i32.const 0 call $~lib/env/abort unreachable @@ -3740,7 +3743,7 @@ if i32.const 0 i32.const 8 - i32.const 106 + i32.const 105 i32.const 0 call $~lib/env/abort unreachable @@ -3752,59 +3755,59 @@ if i32.const 0 i32.const 8 - i32.const 107 + i32.const 106 i32.const 0 call $~lib/env/abort unreachable end get_global $std/typedarray/arr i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 2 i32.ne if i32.const 0 i32.const 8 - i32.const 108 + i32.const 107 i32.const 0 call $~lib/env/abort unreachable end i32.const 8 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/af64 get_global $std/typedarray/af64 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 2 f64.const 7 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 3 f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 4 f64.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 5 f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 6 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 7 f64.const 8 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 call $~lib/typedarray/Float64Array#subarray set_global $std/typedarray/af64 @@ -3817,7 +3820,7 @@ if i32.const 0 i32.const 8 - i32.const 122 + i32.const 121 i32.const 0 call $~lib/env/abort unreachable @@ -3829,7 +3832,7 @@ if i32.const 0 i32.const 8 - i32.const 123 + i32.const 122 i32.const 0 call $~lib/env/abort unreachable @@ -3841,7 +3844,7 @@ if i32.const 0 i32.const 8 - i32.const 124 + i32.const 123 i32.const 0 call $~lib/env/abort unreachable @@ -3863,18 +3866,18 @@ end get_local $1 get_local $0 - call $~lib/internal/typedarray/TypedArray#sort + call $~lib/typedarray/Float64Array#sort drop get_global $std/typedarray/af64 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 4 f64.eq tee_local $0 if get_global $std/typedarray/af64 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 5 f64.eq set_local $0 @@ -3883,7 +3886,7 @@ if get_global $std/typedarray/af64 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 6 f64.eq set_local $0 @@ -3892,7 +3895,7 @@ if get_global $std/typedarray/af64 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 7 f64.eq set_local $0 @@ -3902,13 +3905,13 @@ if i32.const 0 i32.const 8 - i32.const 126 + i32.const 125 i32.const 0 call $~lib/env/abort unreachable end i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/clampedArr get_global $std/typedarray/clampedArr i32.const 0 @@ -3924,9 +3927,24 @@ call $~lib/typedarray/Uint8ClampedArray#__set get_global $std/typedarray/clampedArr i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and + if + i32.const 0 + i32.const 8 + i32.const 132 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/clampedArr + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 2 + i32.ne if i32.const 0 i32.const 8 @@ -3936,11 +3954,11 @@ unreachable end get_global $std/typedarray/clampedArr - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and - i32.const 2 + i32.const 255 i32.ne if i32.const 0 @@ -3950,49 +3968,34 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/clampedArr - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 255 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 135 - i32.const 0 - call $~lib/env/abort - unreachable - end i32.const 5 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/arr8 get_global $std/typedarray/arr8 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 1 i32.const 1 i32.const 3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill drop get_global $std/typedarray/arr8 i32.const 192 @@ -4001,7 +4004,7 @@ if i32.const 0 i32.const 8 - i32.const 145 + i32.const 144 i32.const 0 call $~lib/env/abort unreachable @@ -4011,7 +4014,7 @@ get_global $std/typedarray/arr8 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int8Array#fill|trampoline drop get_global $std/typedarray/arr8 i32.const 216 @@ -4020,7 +4023,7 @@ if i32.const 0 i32.const 8 - i32.const 148 + i32.const 147 i32.const 0 call $~lib/env/abort unreachable @@ -4029,7 +4032,7 @@ i32.const 1 i32.const 0 i32.const -3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill drop get_global $std/typedarray/arr8 i32.const 240 @@ -4038,7 +4041,7 @@ if i32.const 0 i32.const 8 - i32.const 151 + i32.const 150 i32.const 0 call $~lib/env/abort unreachable @@ -4048,7 +4051,7 @@ get_global $std/typedarray/arr8 i32.const 2 i32.const -2 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int8Array#fill|trampoline drop get_global $std/typedarray/arr8 i32.const 264 @@ -4057,7 +4060,7 @@ if i32.const 0 i32.const 8 - i32.const 154 + i32.const 153 i32.const 0 call $~lib/env/abort unreachable @@ -4066,7 +4069,7 @@ i32.const 0 i32.const 1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill drop get_global $std/typedarray/arr8 i32.const 288 @@ -4075,7 +4078,7 @@ if i32.const 0 i32.const 8 - i32.const 157 + i32.const 156 i32.const 0 call $~lib/env/abort unreachable @@ -4089,7 +4092,7 @@ get_global $std/typedarray/sub8 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int8Array#fill|trampoline drop get_global $std/typedarray/sub8 i32.load offset=8 @@ -4098,7 +4101,7 @@ if i32.const 0 i32.const 8 - i32.const 161 + i32.const 160 i32.const 0 call $~lib/env/abort unreachable @@ -4110,7 +4113,7 @@ if i32.const 0 i32.const 8 - i32.const 162 + i32.const 161 i32.const 0 call $~lib/env/abort unreachable @@ -4122,7 +4125,7 @@ if i32.const 0 i32.const 8 - i32.const 163 + i32.const 162 i32.const 0 call $~lib/env/abort unreachable @@ -4134,7 +4137,7 @@ if i32.const 0 i32.const 8 - i32.const 164 + i32.const 163 i32.const 0 call $~lib/env/abort unreachable @@ -4146,39 +4149,39 @@ if i32.const 0 i32.const 8 - i32.const 165 + i32.const 164 i32.const 0 call $~lib/env/abort unreachable end i32.const 5 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/arr32 get_global $std/typedarray/arr32 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 1 i32.const 1 i32.const 3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill drop get_global $std/typedarray/arr32 i32.const 376 @@ -4187,7 +4190,7 @@ if i32.const 0 i32.const 8 - i32.const 175 + i32.const 174 i32.const 0 call $~lib/env/abort unreachable @@ -4197,7 +4200,7 @@ get_global $std/typedarray/arr32 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int32Array#fill|trampoline drop get_global $std/typedarray/arr32 i32.const 416 @@ -4206,7 +4209,7 @@ if i32.const 0 i32.const 8 - i32.const 178 + i32.const 177 i32.const 0 call $~lib/env/abort unreachable @@ -4215,7 +4218,7 @@ i32.const 1 i32.const 0 i32.const -3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill drop get_global $std/typedarray/arr32 i32.const 456 @@ -4224,7 +4227,7 @@ if i32.const 0 i32.const 8 - i32.const 181 + i32.const 180 i32.const 0 call $~lib/env/abort unreachable @@ -4234,7 +4237,7 @@ get_global $std/typedarray/arr32 i32.const 2 i32.const -2 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int32Array#fill|trampoline drop get_global $std/typedarray/arr32 i32.const 496 @@ -4243,7 +4246,7 @@ if i32.const 0 i32.const 8 - i32.const 184 + i32.const 183 i32.const 0 call $~lib/env/abort unreachable @@ -4252,7 +4255,7 @@ i32.const 0 i32.const 1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill drop get_global $std/typedarray/arr32 i32.const 536 @@ -4261,7 +4264,7 @@ if i32.const 0 i32.const 8 - i32.const 187 + i32.const 186 i32.const 0 call $~lib/env/abort unreachable @@ -4275,7 +4278,7 @@ get_global $std/typedarray/sub32 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int32Array#fill|trampoline drop get_global $std/typedarray/sub32 i32.load offset=8 @@ -4286,7 +4289,7 @@ if i32.const 0 i32.const 8 - i32.const 191 + i32.const 190 i32.const 0 call $~lib/env/abort unreachable @@ -4298,7 +4301,7 @@ if i32.const 0 i32.const 8 - i32.const 192 + i32.const 191 i32.const 0 call $~lib/env/abort unreachable @@ -4310,7 +4313,7 @@ if i32.const 0 i32.const 8 - i32.const 193 + i32.const 192 i32.const 0 call $~lib/env/abort unreachable @@ -4322,7 +4325,7 @@ if i32.const 0 i32.const 8 - i32.const 194 + i32.const 193 i32.const 0 call $~lib/env/abort unreachable @@ -4334,52 +4337,64 @@ if i32.const 0 i32.const 8 - i32.const 195 + i32.const 194 i32.const 0 call $~lib/env/abort unreachable end i32.const 134217727 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor drop i32.const 6 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/multisubarr get_global $std/typedarray/multisubarr i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 5 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 6 call $~lib/typedarray/Int8Array#subarray set_global $std/typedarray/multisubarr1 get_global $std/typedarray/multisubarr1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and i32.const 2 i32.ne + if + i32.const 0 + i32.const 8 + i32.const 211 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/multisubarr1 + i32.load offset=8 + i32.const 5 + i32.ne if i32.const 0 i32.const 8 @@ -4389,8 +4404,8 @@ unreachable end get_global $std/typedarray/multisubarr1 - i32.load offset=8 - i32.const 5 + i32.load offset=4 + i32.const 1 i32.ne if i32.const 0 @@ -4401,8 +4416,8 @@ unreachable end get_global $std/typedarray/multisubarr1 - i32.load offset=4 - i32.const 1 + i32.load offset=8 + i32.const 5 i32.ne if i32.const 0 @@ -4413,24 +4428,12 @@ unreachable end get_global $std/typedarray/multisubarr1 - i32.load offset=8 - i32.const 5 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 215 - i32.const 0 - call $~lib/env/abort - unreachable - end - get_global $std/typedarray/multisubarr1 i32.const 5 call $~lib/typedarray/Int8Array#subarray set_global $std/typedarray/multisubarr2 get_global $std/typedarray/multisubarr2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and i32.const 3 @@ -4438,7 +4441,7 @@ if i32.const 0 i32.const 8 - i32.const 218 + i32.const 217 i32.const 0 call $~lib/env/abort unreachable @@ -4450,7 +4453,7 @@ if i32.const 0 i32.const 8 - i32.const 219 + i32.const 218 i32.const 0 call $~lib/env/abort unreachable @@ -4462,7 +4465,7 @@ if i32.const 0 i32.const 8 - i32.const 220 + i32.const 219 i32.const 0 call $~lib/env/abort unreachable @@ -4474,7 +4477,7 @@ if i32.const 0 i32.const 8 - i32.const 221 + i32.const 220 i32.const 0 call $~lib/env/abort unreachable @@ -4485,11 +4488,23 @@ set_global $std/typedarray/multisubarr3 get_global $std/typedarray/multisubarr3 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and i32.const 4 i32.ne + if + i32.const 0 + i32.const 8 + i32.const 223 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/multisubarr3 + i32.load offset=8 + i32.const 3 + i32.ne if i32.const 0 i32.const 8 @@ -4499,7 +4514,7 @@ unreachable end get_global $std/typedarray/multisubarr3 - i32.load offset=8 + i32.load offset=4 i32.const 3 i32.ne if @@ -4511,25 +4526,13 @@ unreachable end get_global $std/typedarray/multisubarr3 - i32.load offset=4 - i32.const 3 - i32.ne - if - i32.const 0 - i32.const 8 - i32.const 226 - i32.const 0 - call $~lib/env/abort - unreachable - end - get_global $std/typedarray/multisubarr3 i32.load offset=8 i32.const 3 i32.ne if i32.const 0 i32.const 8 - i32.const 227 + i32.const 226 i32.const 0 call $~lib/env/abort unreachable diff --git a/tests/compiler/std/typedarray.ts b/tests/compiler/std/typedarray.ts index 436da007..9187228f 100644 --- a/tests/compiler/std/typedarray.ts +++ b/tests/compiler/std/typedarray.ts @@ -10,7 +10,6 @@ assert(Uint64Array.BYTES_PER_ELEMENT == 8); assert(Float32Array.BYTES_PER_ELEMENT == 4); assert(Float64Array.BYTES_PER_ELEMENT == 8); - function isInt8ArrayEqual(a: Int8Array, b: Array): bool { if (a.length != b.length) return false; for (let i = 0, len = a.length; i < len; i++) { diff --git a/tests/compiler/std/typedarray.untouched.wat b/tests/compiler/std/typedarray.untouched.wat index 3aa03171..34529fb8 100644 --- a/tests/compiler/std/typedarray.untouched.wat +++ b/tests/compiler/std/typedarray.untouched.wat @@ -13,9 +13,11 @@ (type $iiIv (func (param i32 i32 i64))) (type $IIiiI (func (param i64 i64 i32 i32) (result i64))) (type $iiII (func (param i32 i32 i64) (result i64))) + (type $iiI (func (param i32 i32) (result i64))) (type $iifv (func (param i32 i32 f32))) (type $ffiif (func (param f32 f32 i32 i32) (result f32))) (type $iiff (func (param i32 i32 f32) (result f32))) + (type $iif (func (param i32 i32) (result f32))) (type $FFiiF (func (param f64 f64 i32 i32) (result f64))) (type $iiFF (func (param i32 i32 f64) (result f64))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) @@ -52,7 +54,7 @@ (data (i32.const 584) "\14\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00") (data (i32.const 616) "H\02\00\00\05\00\00\00") (table $0 24 anyfunc) - (elem (i32.const 0) $null $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceUint8ArrayTest~anonymous|3 $std/typedarray/reduceUint8ClampedArrayTest~anonymous|4 $std/typedarray/reduceInt16ArrayTest~anonymous|5 $std/typedarray/reduceUint16ArrayTest~anonymous|6 $std/typedarray/reduceInt32ArrayTest~anonymous|7 $std/typedarray/reduceUint32ArrayTest~anonymous|8 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceUint64ArrayTest~anonymous|10 $std/typedarray/reduceFloat32ArrayTest~anonymous|11 $std/typedarray/reduceFloat64ArrayTest~anonymous|12 $std/typedarray/reduceRightInt8ArrayTest~anonymous|13 $std/typedarray/reduceRightUint8ArrayTest~anonymous|14 $std/typedarray/reduceRightUint8ClampedArrayTest~anonymous|15 $std/typedarray/reduceRightInt16ArrayTest~anonymous|16 $std/typedarray/reduceRightUint16ArrayTest~anonymous|17 $std/typedarray/reduceRightInt32ArrayTest~anonymous|18 $std/typedarray/reduceRightUint32ArrayTest~anonymous|19 $std/typedarray/reduceRightInt64ArrayTest~anonymous|20 $std/typedarray/reduceRightUint64ArrayTest~anonymous|21 $std/typedarray/reduceRightFloat32ArrayTest~anonymous|22 $std/typedarray/reduceRightFloat64ArrayTest~anonymous|23) + (elem (i32.const 0) $null $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 $std/typedarray/reduceInt8ArrayTest~anonymous|2 $std/typedarray/reduceUint8ArrayTest~anonymous|3 $std/typedarray/reduceUint8ClampedArrayTest~anonymous|4 $std/typedarray/reduceInt16ArrayTest~anonymous|5 $std/typedarray/reduceUint16ArrayTest~anonymous|6 $std/typedarray/reduceInt32ArrayTest~anonymous|7 $std/typedarray/reduceUint32ArrayTest~anonymous|8 $std/typedarray/reduceInt64ArrayTest~anonymous|9 $std/typedarray/reduceUint64ArrayTest~anonymous|10 $std/typedarray/reduceFloat32ArrayTest~anonymous|11 $std/typedarray/reduceFloat64ArrayTest~anonymous|12 $std/typedarray/reduceRightInt8ArrayTest~anonymous|13 $std/typedarray/reduceRightUint8ArrayTest~anonymous|14 $std/typedarray/reduceRightUint8ClampedArrayTest~anonymous|15 $std/typedarray/reduceRightInt16ArrayTest~anonymous|16 $std/typedarray/reduceRightUint16ArrayTest~anonymous|17 $std/typedarray/reduceRightInt32ArrayTest~anonymous|18 $std/typedarray/reduceRightUint32ArrayTest~anonymous|19 $std/typedarray/reduceRightInt64ArrayTest~anonymous|20 $std/typedarray/reduceRightUint64ArrayTest~anonymous|21 $std/typedarray/reduceRightFloat32ArrayTest~anonymous|22 $std/typedarray/reduceRightFloat64ArrayTest~anonymous|23) (global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8Array.BYTES_PER_ELEMENT i32 (i32.const 1)) (global $~lib/typedarray/Uint8ClampedArray.BYTES_PER_ELEMENT i32 (i32.const 1)) @@ -469,7 +471,7 @@ call $~lib/allocator/arena/__memory_allocate return ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -480,7 +482,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -534,7 +536,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -545,7 +547,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -599,7 +601,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -610,7 +612,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -664,7 +666,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -675,7 +677,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -729,7 +731,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -740,7 +742,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -794,7 +796,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -805,7 +807,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -859,7 +861,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 12 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -870,7 +872,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -924,7 +926,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -935,7 +937,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -989,7 +991,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 14 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1000,7 +1002,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -1054,7 +1056,7 @@ i32.store offset=8 get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#constructor (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#constructor (; 15 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) @@ -1065,7 +1067,7 @@ if i32.const 0 i32.const 48 - i32.const 27 + i32.const 24 i32.const 34 call $~lib/env/abort unreachable @@ -1133,7 +1135,7 @@ (local $11 i32) i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $1 get_local $1 i32.load offset=4 @@ -1143,7 +1145,7 @@ if i32.const 0 i32.const 8 - i32.const 35 + i32.const 34 i32.const 2 call $~lib/env/abort unreachable @@ -1158,12 +1160,12 @@ if i32.const 0 i32.const 8 - i32.const 36 + i32.const 35 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $1 i32.load offset=8 i32.const 0 @@ -1175,14 +1177,14 @@ if i32.const 0 i32.const 8 - i32.const 37 + i32.const 36 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $2 get_local $2 i32.load offset=4 @@ -1192,7 +1194,7 @@ if i32.const 0 i32.const 8 - i32.const 40 + i32.const 39 i32.const 2 call $~lib/env/abort unreachable @@ -1207,12 +1209,12 @@ if i32.const 0 i32.const 8 - i32.const 41 + i32.const 40 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $2 i32.load offset=8 i32.const 0 @@ -1224,14 +1226,14 @@ if i32.const 0 i32.const 8 - i32.const 42 + i32.const 41 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $3 get_local $3 i32.load offset=4 @@ -1241,7 +1243,7 @@ if i32.const 0 i32.const 8 - i32.const 45 + i32.const 44 i32.const 2 call $~lib/env/abort unreachable @@ -1256,12 +1258,12 @@ if i32.const 0 i32.const 8 - i32.const 46 + i32.const 45 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $3 i32.load offset=8 i32.const 0 @@ -1273,14 +1275,14 @@ if i32.const 0 i32.const 8 - i32.const 47 + i32.const 46 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $4 get_local $4 i32.load offset=4 @@ -1290,7 +1292,7 @@ if i32.const 0 i32.const 8 - i32.const 50 + i32.const 49 i32.const 2 call $~lib/env/abort unreachable @@ -1305,12 +1307,12 @@ if i32.const 0 i32.const 8 - i32.const 51 + i32.const 50 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $4 i32.load offset=8 i32.const 1 @@ -1322,14 +1324,14 @@ if i32.const 0 i32.const 8 - i32.const 52 + i32.const 51 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $5 get_local $5 i32.load offset=4 @@ -1339,7 +1341,7 @@ if i32.const 0 i32.const 8 - i32.const 55 + i32.const 54 i32.const 2 call $~lib/env/abort unreachable @@ -1354,12 +1356,12 @@ if i32.const 0 i32.const 8 - i32.const 56 + i32.const 55 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $5 i32.load offset=8 i32.const 1 @@ -1371,14 +1373,14 @@ if i32.const 0 i32.const 8 - i32.const 57 + i32.const 56 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $6 get_local $6 i32.load offset=4 @@ -1388,7 +1390,7 @@ if i32.const 0 i32.const 8 - i32.const 60 + i32.const 59 i32.const 2 call $~lib/env/abort unreachable @@ -1403,12 +1405,12 @@ if i32.const 0 i32.const 8 - i32.const 61 + i32.const 60 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $6 i32.load offset=8 i32.const 2 @@ -1420,14 +1422,14 @@ if i32.const 0 i32.const 8 - i32.const 62 + i32.const 61 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $7 get_local $7 i32.load offset=4 @@ -1437,7 +1439,7 @@ if i32.const 0 i32.const 8 - i32.const 65 + i32.const 64 i32.const 2 call $~lib/env/abort unreachable @@ -1452,12 +1454,12 @@ if i32.const 0 i32.const 8 - i32.const 66 + i32.const 65 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $7 i32.load offset=8 i32.const 2 @@ -1469,14 +1471,14 @@ if i32.const 0 i32.const 8 - i32.const 67 + i32.const 66 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $8 get_local $8 i32.load offset=4 @@ -1486,7 +1488,7 @@ if i32.const 0 i32.const 8 - i32.const 70 + i32.const 69 i32.const 2 call $~lib/env/abort unreachable @@ -1501,12 +1503,12 @@ if i32.const 0 i32.const 8 - i32.const 71 + i32.const 70 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $8 i32.load offset=8 i32.const 3 @@ -1518,14 +1520,14 @@ if i32.const 0 i32.const 8 - i32.const 72 + i32.const 71 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $9 get_local $9 i32.load offset=4 @@ -1535,7 +1537,7 @@ if i32.const 0 i32.const 8 - i32.const 75 + i32.const 74 i32.const 2 call $~lib/env/abort unreachable @@ -1550,12 +1552,12 @@ if i32.const 0 i32.const 8 - i32.const 76 + i32.const 75 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $9 i32.load offset=8 i32.const 3 @@ -1567,14 +1569,14 @@ if i32.const 0 i32.const 8 - i32.const 77 + i32.const 76 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $10 get_local $10 i32.load offset=4 @@ -1584,7 +1586,7 @@ if i32.const 0 i32.const 8 - i32.const 80 + i32.const 79 i32.const 2 call $~lib/env/abort unreachable @@ -1599,12 +1601,12 @@ if i32.const 0 i32.const 8 - i32.const 81 + i32.const 80 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $10 i32.load offset=8 i32.const 2 @@ -1616,14 +1618,14 @@ if i32.const 0 i32.const 8 - i32.const 82 + i32.const 81 i32.const 2 call $~lib/env/abort unreachable end i32.const 0 get_local $0 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $11 get_local $11 i32.load offset=4 @@ -1633,7 +1635,7 @@ if i32.const 0 i32.const 8 - i32.const 85 + i32.const 84 i32.const 2 call $~lib/env/abort unreachable @@ -1648,12 +1650,12 @@ if i32.const 0 i32.const 8 - i32.const 86 + i32.const 85 i32.const 2 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.0 (result i32) get_local $11 i32.load offset=8 i32.const 3 @@ -1665,13 +1667,13 @@ if i32.const 0 i32.const 8 - i32.const 87 + i32.const 86 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 17 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 17 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) get_local $1 @@ -1683,7 +1685,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -1695,16 +1697,16 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store offset=8 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) get_local $1 @@ -1716,12 +1718,12 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) get_local $0 i32.load set_local $2 @@ -1729,12 +1731,12 @@ i32.load offset=4 set_local $3 get_local $2 - get_local $3 - i32.add get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 end ) @@ -1742,7 +1744,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 2 @@ -1837,7 +1839,7 @@ i32.store offset=8 get_local $4 ) - (func $~lib/internal/typedarray/TypedArray#__set (; 20 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) + (func $~lib/internal/typedarray/TypedArray#__set (; 20 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) (local $4 i32) get_local $1 @@ -1849,7 +1851,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -1861,12 +1863,12 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 3 i32.shl i32.add + get_local $4 + i32.add get_local $2 f64.store offset=8 ) @@ -1874,7 +1876,7 @@ (local $3 i32) (local $4 i32) (local $5 i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 3 @@ -1985,14 +1987,14 @@ i32.eqz br_if $break|0 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.2 (result f64) get_local $0 - get_local $1 - i32.add get_local $4 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $5 @@ -2007,14 +2009,14 @@ i32.ge_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.3 (result f64) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $7 @@ -2041,12 +2043,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $7 f64.store offset=8 else @@ -2062,12 +2064,12 @@ i32.add set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $5 f64.store offset=8 end @@ -2163,25 +2165,25 @@ i32.const 1 i32.shr_s set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.4 (result f64) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $9 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.5 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.5 (result f64) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 @@ -2219,21 +2221,21 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $9 f64.store offset=8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 end @@ -2259,48 +2261,48 @@ i32.eqz br_if $break|2 block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.6 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.6 (result f64) i32.const 0 set_local $8 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 i32.const 0 set_local $8 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.7 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.7 (result f64) get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $9 get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $9 f64.store offset=8 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 i32.const 1 @@ -2342,27 +2344,27 @@ i32.gt_s if block - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.8 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.8 (result f64) i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.9 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.9 (result f64) get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $9 @@ -2400,23 +2402,23 @@ i32.xor i32.store get_local $0 - get_local $1 - i32.add get_local $8 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 i32.const 0 set_local $11 get_local $0 - get_local $1 - i32.add get_local $11 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $9 f64.store offset=8 end @@ -2448,169 +2450,175 @@ end unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.10 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.10 (result f64) i32.const 1 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $12 i32.const 1 set_local $6 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.11 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.11 (result f64) i32.const 0 set_local $7 get_local $0 - get_local $1 - i32.add get_local $7 i32.const 3 i32.shl i32.add + get_local $1 + i32.add f64.load offset=8 end set_local $10 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $10 f64.store offset=8 i32.const 0 set_local $6 get_local $0 - get_local $1 - i32.add get_local $6 i32.const 3 i32.shl i32.add + get_local $1 + i32.add get_local $12 f64.store offset=8 ) - (func $~lib/internal/typedarray/TypedArray#sort (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#sort (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 f64) (local $7 f64) - get_local $0 - i32.load offset=4 - set_local $2 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) + block $~lib/internal/typedarray/SORT|inlined.0 (result i32) get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - set_local $3 - get_local $3 - i32.const 1 - i32.le_s - if - get_local $0 - return - end - get_local $0 - i32.load - set_local $4 - get_local $3 - i32.const 2 - i32.eq - if - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result f64) - i32.const 1 - set_local $5 - get_local $4 - get_local $2 - i32.add - get_local $5 + i32.load offset=4 + set_local $2 + block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) + get_local $0 + i32.load offset=8 i32.const 3 - i32.shl - i32.add - f64.load offset=8 + i32.shr_u end - set_local $6 - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result f64) - i32.const 0 - set_local $5 - get_local $4 - get_local $2 - i32.add - get_local $5 - i32.const 3 - i32.shl - i32.add - f64.load offset=8 - end - set_local $7 - block (result i32) - i32.const 2 - set_global $~argc - get_local $6 - get_local $7 - get_local $1 - call_indirect (type $FFi) - end - i32.const 0 - i32.lt_s + set_local $3 + get_local $3 + i32.const 1 + i32.le_s if - i32.const 1 - set_local $5 - get_local $4 - get_local $2 - i32.add - get_local $5 - i32.const 3 - i32.shl - i32.add - get_local $7 - f64.store offset=8 - i32.const 0 - set_local $5 - get_local $4 - get_local $2 - i32.add - get_local $5 - i32.const 3 - i32.shl - i32.add - get_local $6 - f64.store offset=8 + get_local $0 + br $~lib/internal/typedarray/SORT|inlined.0 end get_local $0 - return - end - get_local $3 - i32.const 256 - i32.lt_s - if - get_local $4 - get_local $2 + i32.load + set_local $4 get_local $3 - get_local $1 - call $~lib/internal/array/insertionSort - else - get_local $4 - get_local $2 - get_local $3 - get_local $1 - call $~lib/internal/array/weakHeapSort + i32.const 2 + i32.eq + if + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result f64) + i32.const 1 + set_local $5 + get_local $4 + get_local $5 + i32.const 3 + i32.shl + i32.add + get_local $2 + i32.add + f64.load offset=8 + end + set_local $6 + block $~lib/internal/arraybuffer/LOAD|inlined.1 (result f64) + i32.const 0 + set_local $5 + get_local $4 + get_local $5 + i32.const 3 + i32.shl + i32.add + get_local $2 + i32.add + f64.load offset=8 + end + set_local $7 + block (result i32) + i32.const 2 + set_global $~argc + get_local $6 + get_local $7 + get_local $1 + call_indirect (type $FFi) + end + i32.const 0 + i32.lt_s + if + i32.const 1 + set_local $5 + get_local $4 + get_local $5 + i32.const 3 + i32.shl + i32.add + get_local $2 + i32.add + get_local $7 + f64.store offset=8 + i32.const 0 + set_local $5 + get_local $4 + get_local $5 + i32.const 3 + i32.shl + i32.add + get_local $2 + i32.add + get_local $6 + f64.store offset=8 + end + get_local $0 + br $~lib/internal/typedarray/SORT|inlined.0 + end + block + get_local $3 + i32.const 256 + i32.lt_s + if + get_local $4 + get_local $2 + get_local $3 + get_local $1 + call $~lib/internal/array/insertionSort + else + get_local $4 + get_local $2 + get_local $3 + get_local $1 + call $~lib/internal/array/weakHeapSort + end + get_local $0 + br $~lib/internal/typedarray/SORT|inlined.0 + unreachable + end + unreachable end - get_local $0 - return ) - (func $~lib/internal/typedarray/TypedArray#sort|trampoline~anonymous|1 (; 26 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) + (func $~lib/typedarray/Float64Array#sort|trampoline~anonymous|1 (; 26 ;) (type $FFi) (param $0 f64) (param $1 f64) (result i32) (local $2 i64) (local $3 i64) get_local $0 @@ -2643,7 +2651,7 @@ i64.lt_s i32.sub ) - (func $~lib/internal/typedarray/TypedArray#sort|trampoline (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/typedarray/Float64Array#sort|trampoline (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) block $1of1 block $0of1 block $outOfRange @@ -2660,9 +2668,9 @@ end get_local $0 get_local $1 - call $~lib/internal/typedarray/TypedArray#sort + call $~lib/typedarray/Float64Array#sort ) - (func $~lib/internal/typedarray/TypedArray#__get (; 28 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (func $~lib/internal/typedarray/TypedArray#__get (; 28 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (local $2 i32) (local $3 i32) get_local $1 @@ -2674,12 +2682,12 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.12 (result f64) + block $~lib/internal/arraybuffer/LOAD|inlined.12 (result f64) get_local $0 i32.load set_local $2 @@ -2687,16 +2695,16 @@ i32.load offset=4 set_local $3 get_local $2 - get_local $3 - i32.add get_local $1 i32.const 3 i32.shl i32.add + get_local $3 + i32.add f64.load offset=8 end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 29 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 29 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) get_local $1 @@ -2708,7 +2716,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -2720,12 +2728,12 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 0 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store8 offset=8 ) @@ -2749,9 +2757,9 @@ get_local $4 i32.gt_s select - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set ) - (func $~lib/internal/typedarray/TypedArray#__get (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 31 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) get_local $1 @@ -2763,12 +2771,12 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) get_local $0 i32.load set_local $2 @@ -2776,16 +2784,16 @@ i32.load offset=4 set_local $3 get_local $2 - get_local $3 - i32.add get_local $1 i32.const 0 i32.shl i32.add + get_local $3 + i32.add i32.load8_u offset=8 end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 32 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 32 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) get_local $1 @@ -2797,7 +2805,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -2809,16 +2817,16 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 0 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store8 offset=8 ) - (func $~lib/internal/typedarray/TypedArray#fill (; 33 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int8Array#fill (; 33 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -2830,7 +2838,7 @@ get_local $0 i32.load offset=4 set_local $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 0 @@ -2910,7 +2918,7 @@ end get_local $0 ) - (func $~lib/internal/typedarray/TypedArray#__get (; 34 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__get (; 34 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) get_local $1 @@ -2922,12 +2930,12 @@ if i32.const 0 i32.const 48 - i32.const 43 + i32.const 40 i32.const 63 call $~lib/env/abort unreachable end - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) + block $~lib/internal/arraybuffer/LOAD|inlined.0 (result i32) get_local $0 i32.load set_local $2 @@ -2935,17 +2943,18 @@ i32.load offset=4 set_local $3 get_local $2 - get_local $3 - i32.add get_local $1 i32.const 0 i32.shl i32.add + get_local $3 + i32.add i32.load8_s offset=8 end ) (func $~lib/array/Array#__get (; 35 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -2956,11 +2965,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 0 i32.shl i32.add + get_local $3 + i32.add i32.load8_s offset=8 else unreachable @@ -2969,7 +2982,7 @@ (func $std/typedarray/isInt8ArrayEqual (; 36 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) get_local $0 i32.load offset=8 i32.const 0 @@ -2988,7 +3001,7 @@ block i32.const 0 set_local $2 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) get_local $0 i32.load offset=8 i32.const 0 @@ -3004,7 +3017,7 @@ br_if $break|0 get_local $0 get_local $2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 24 i32.shl i32.const 24 @@ -3032,7 +3045,7 @@ end i32.const 1 ) - (func $~lib/internal/typedarray/TypedArray#fill|trampoline (; 37 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int8Array#fill|trampoline (; 37 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) block $2of2 block $1of2 block $0of2 @@ -3054,13 +3067,13 @@ get_local $1 get_local $2 get_local $3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill ) (func $~lib/typedarray/Int8Array#subarray (; 38 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) get_local $0 i32.load offset=8 i32.const 0 @@ -3155,7 +3168,7 @@ i32.store offset=8 get_local $4 ) - (func $~lib/internal/typedarray/TypedArray#fill (; 39 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int32Array#fill (; 39 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) (local $4 i32) (local $5 i32) (local $6 i32) @@ -3167,7 +3180,7 @@ get_local $0 i32.load offset=4 set_local $5 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) get_local $0 i32.load offset=8 i32.const 2 @@ -3232,12 +3245,12 @@ i32.eqz br_if $break|0 get_local $4 - get_local $5 - i32.add get_local $2 i32.const 2 i32.shl i32.add + get_local $5 + i32.add get_local $1 i32.store offset=8 get_local $2 @@ -3253,6 +3266,7 @@ ) (func $~lib/array/Array#__get (; 40 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) + (local $3 i32) get_local $0 i32.load set_local $2 @@ -3263,11 +3277,15 @@ i32.shr_u i32.lt_u if (result i32) + i32.const 0 + set_local $3 get_local $2 get_local $1 i32.const 2 i32.shl i32.add + get_local $3 + i32.add i32.load offset=8 else unreachable @@ -3276,7 +3294,7 @@ (func $std/typedarray/isInt32ArrayEqual (; 41 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) get_local $0 i32.load offset=8 i32.const 2 @@ -3295,7 +3313,7 @@ block i32.const 0 set_local $2 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) get_local $0 i32.load offset=8 i32.const 2 @@ -3311,7 +3329,7 @@ br_if $break|0 get_local $0 get_local $2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get get_local $1 get_local $2 call $~lib/array/Array#__get @@ -3331,7 +3349,7 @@ end i32.const 1 ) - (func $~lib/internal/typedarray/TypedArray#fill|trampoline (; 42 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $~lib/typedarray/Int32Array#fill|trampoline (; 42 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) block $2of2 block $1of2 block $0of2 @@ -3353,49 +3371,47 @@ get_local $1 get_local $2 get_local $3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill ) (func $std/typedarray/reduceInt8ArrayTest~anonymous|2 (; 43 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Int8Array#reduce (; 44 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 44 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 0 + i32.shl + i32.add + get_local $3 + i32.add + i32.load8_s offset=8 + ) + (func $~lib/typedarray/Int8Array#reduce (; 45 ;) (type $iiii) (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) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) get_local $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -3403,41 +3419,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 0 - i32.shl - i32.add - i32.load8_s offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -3445,25 +3439,25 @@ end get_local $2 ) - (func $std/typedarray/reduceInt8ArrayTest (; 45 ;) (type $v) + (func $std/typedarray/reduceInt8ArrayTest (; 46 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 0 @@ -3480,53 +3474,51 @@ if i32.const 0 i32.const 8 - i32.const 252 + i32.const 251 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceUint8ArrayTest~anonymous|3 (; 46 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceUint8ArrayTest~anonymous|3 (; 47 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint8Array#reduce (; 47 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 48 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 0 + i32.shl + i32.add + get_local $3 + i32.add + i32.load8_u offset=8 + ) + (func $~lib/typedarray/Uint8Array#reduce (; 49 ;) (type $iiii) (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) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -3534,41 +3526,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 0 - i32.shl - i32.add - i32.load8_u offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -3576,25 +3546,25 @@ end get_local $2 ) - (func $std/typedarray/reduceUint8ArrayTest (; 48 ;) (type $v) + (func $std/typedarray/reduceUint8ArrayTest (; 50 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 3 i32.const 0 @@ -3609,108 +3579,23 @@ if i32.const 0 i32.const 8 - i32.const 267 + i32.const 266 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceUint8ClampedArrayTest~anonymous|4 (; 49 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceUint8ClampedArrayTest~anonymous|4 (; 51 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint8ClampedArray#reduce (; 50 ;) (type $iiii) (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) - i32.const 0 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - set_local $5 - block $break|0 - loop $continue|0 - get_local $4 - get_local $5 - i32.ne - if - block - block (result i32) - i32.const 4 - set_global $~argc - get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 0 - i32.shl - i32.add - i32.load8_u offset=8 - end - end - get_local $4 - get_local $0 - get_local $1 - call_indirect (type $iiiii) - end - set_local $2 - get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 - end - br $continue|0 - end - end - end - get_local $2 - ) - (func $std/typedarray/reduceUint8ClampedArrayTest (; 51 ;) (type $v) + (func $std/typedarray/reduceUint8ClampedArrayTest (; 52 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 @@ -3727,7 +3612,7 @@ get_local $0 i32.const 4 i32.const 0 - call $~lib/typedarray/Uint8ClampedArray#reduce + call $~lib/typedarray/Uint8Array#reduce set_local $1 get_local $1 i32.const 255 @@ -3738,13 +3623,13 @@ if i32.const 0 i32.const 8 - i32.const 282 + i32.const 281 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 52 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 53 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) get_local $1 @@ -3756,7 +3641,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -3768,56 +3653,54 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 1 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store16 offset=8 ) - (func $std/typedarray/reduceInt16ArrayTest~anonymous|5 (; 53 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceInt16ArrayTest~anonymous|5 (; 54 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Int16Array#reduce (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 55 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 1 + i32.shl + i32.add + get_local $3 + i32.add + i32.load16_s offset=8 + ) + (func $~lib/typedarray/Int16Array#reduce (; 56 ;) (type $iiii) (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) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -3825,41 +3708,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 1 - i32.shl - i32.add - i32.load16_s offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -3867,25 +3728,25 @@ end get_local $2 ) - (func $std/typedarray/reduceInt16ArrayTest (; 55 ;) (type $v) + (func $std/typedarray/reduceInt16ArrayTest (; 57 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 5 i32.const 0 @@ -3902,13 +3763,13 @@ if i32.const 0 i32.const 8 - i32.const 297 + i32.const 296 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 56 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 58 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) get_local $1 @@ -3920,7 +3781,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -3932,56 +3793,54 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 1 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store16 offset=8 ) - (func $std/typedarray/reduceUint16ArrayTest~anonymous|6 (; 57 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceUint16ArrayTest~anonymous|6 (; 59 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint16Array#reduce (; 58 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 60 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 1 + i32.shl + i32.add + get_local $3 + i32.add + i32.load16_u offset=8 + ) + (func $~lib/typedarray/Uint16Array#reduce (; 61 ;) (type $iiii) (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) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -3989,41 +3848,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 1 - i32.shl - i32.add - i32.load16_u offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -4031,25 +3868,25 @@ end get_local $2 ) - (func $std/typedarray/reduceUint16ArrayTest (; 59 ;) (type $v) + (func $std/typedarray/reduceUint16ArrayTest (; 62 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 6 i32.const 0 @@ -4064,53 +3901,51 @@ if i32.const 0 i32.const 8 - i32.const 312 + i32.const 311 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceInt32ArrayTest~anonymous|7 (; 60 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceInt32ArrayTest~anonymous|7 (; 63 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Int32Array#reduce (; 61 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 64 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 2 + i32.shl + i32.add + get_local $3 + i32.add + i32.load offset=8 + ) + (func $~lib/typedarray/Int32Array#reduce (; 65 ;) (type $iiii) (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) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) - get_local $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) get_local $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -4118,41 +3953,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -4160,25 +3973,25 @@ end get_local $2 ) - (func $std/typedarray/reduceInt32ArrayTest (; 62 ;) (type $v) + (func $std/typedarray/reduceInt32ArrayTest (; 66 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 7 i32.const 0 @@ -4191,13 +4004,13 @@ if i32.const 0 i32.const 8 - i32.const 327 + i32.const 326 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 63 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (func $~lib/internal/typedarray/TypedArray#__set (; 67 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) get_local $1 @@ -4209,7 +4022,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -4221,56 +4034,54 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 i32.store offset=8 ) - (func $std/typedarray/reduceUint32ArrayTest~anonymous|8 (; 64 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceUint32ArrayTest~anonymous|8 (; 68 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint32Array#reduce (; 65 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 69 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 2 + i32.shl + i32.add + get_local $3 + i32.add + i32.load offset=8 + ) + (func $~lib/typedarray/Uint32Array#reduce (; 70 ;) (type $iiii) (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) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -4278,41 +4089,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -4320,25 +4109,25 @@ end get_local $2 ) - (func $std/typedarray/reduceUint32ArrayTest (; 66 ;) (type $v) + (func $std/typedarray/reduceUint32ArrayTest (; 71 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 8 i32.const 0 @@ -4351,13 +4140,13 @@ if i32.const 0 i32.const 8 - i32.const 342 + i32.const 341 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 67 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/internal/typedarray/TypedArray#__set (; 72 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) get_local $1 @@ -4369,7 +4158,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -4381,56 +4170,54 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 3 i32.shl i32.add + get_local $4 + i32.add get_local $2 i64.store offset=8 ) - (func $std/typedarray/reduceInt64ArrayTest~anonymous|9 (; 68 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/reduceInt64ArrayTest~anonymous|9 (; 73 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) get_local $0 get_local $1 i64.add ) - (func $~lib/typedarray/Int64Array#reduce (; 69 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 74 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 3 + i32.shl + i32.add + get_local $3 + i32.add + i64.load offset=8 + ) + (func $~lib/typedarray/Int64Array#reduce (; 75 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -4438,41 +4225,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i64) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i64) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $IIiiI) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -4480,25 +4245,25 @@ end get_local $2 ) - (func $std/typedarray/reduceInt64ArrayTest (; 70 ;) (type $v) + (func $std/typedarray/reduceInt64ArrayTest (; 76 ;) (type $v) (local $0 i32) (local $1 i64) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 9 i64.const 0 @@ -4511,13 +4276,13 @@ if i32.const 0 i32.const 8 - i32.const 357 + i32.const 356 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 71 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) + (func $~lib/internal/typedarray/TypedArray#__set (; 77 ;) (type $iiIv) (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) (local $4 i32) get_local $1 @@ -4529,7 +4294,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -4541,56 +4306,54 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 3 i32.shl i32.add + get_local $4 + i32.add get_local $2 i64.store offset=8 ) - (func $std/typedarray/reduceUint64ArrayTest~anonymous|10 (; 72 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/reduceUint64ArrayTest~anonymous|10 (; 78 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) get_local $0 get_local $1 i64.add ) - (func $~lib/typedarray/Uint64Array#reduce (; 73 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 79 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 3 + i32.shl + i32.add + get_local $3 + i32.add + i64.load offset=8 + ) + (func $~lib/typedarray/Uint64Array#reduce (; 80 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -4598,41 +4361,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result i64) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result i64) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $IIiiI) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -4640,25 +4381,25 @@ end get_local $2 ) - (func $std/typedarray/reduceUint64ArrayTest (; 74 ;) (type $v) + (func $std/typedarray/reduceUint64ArrayTest (; 81 ;) (type $v) (local $0 i32) (local $1 i64) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 10 i64.const 0 @@ -4671,13 +4412,13 @@ if i32.const 0 i32.const 8 - i32.const 372 + i32.const 371 i32.const 2 call $~lib/env/abort unreachable end ) - (func $~lib/internal/typedarray/TypedArray#__set (; 75 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) + (func $~lib/internal/typedarray/TypedArray#__set (; 82 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) (local $4 i32) get_local $1 @@ -4689,7 +4430,7 @@ if i32.const 0 i32.const 48 - i32.const 54 + i32.const 51 i32.const 63 call $~lib/env/abort unreachable @@ -4701,56 +4442,54 @@ i32.load offset=4 set_local $4 get_local $3 - get_local $4 - i32.add get_local $1 i32.const 2 i32.shl i32.add + get_local $4 + i32.add get_local $2 f32.store offset=8 ) - (func $std/typedarray/reduceFloat32ArrayTest~anonymous|11 (; 76 ;) (type $ffiif) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (func $std/typedarray/reduceFloat32ArrayTest~anonymous|11 (; 83 ;) (type $ffiif) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) get_local $0 get_local $1 f32.add ) - (func $~lib/typedarray/Float32Array#reduce (; 77 ;) (type $iiff) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 84 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 2 + i32.shl + i32.add + get_local $3 + i32.add + f32.load offset=8 + ) + (func $~lib/typedarray/Float32Array#reduce (; 85 ;) (type $iiff) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) - get_local $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_local $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -4758,41 +4497,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result f32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.0 (result f32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 2 - i32.shl - i32.add - f32.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $ffiif) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -4800,25 +4517,25 @@ end get_local $2 ) - (func $std/typedarray/reduceFloat32ArrayTest (; 78 ;) (type $v) + (func $std/typedarray/reduceFloat32ArrayTest (; 86 ;) (type $v) (local $0 i32) (local $1 f32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 11 f32.const 0 @@ -4831,53 +4548,51 @@ if i32.const 0 i32.const 8 - i32.const 387 + i32.const 386 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceFloat64ArrayTest~anonymous|12 (; 79 ;) (type $FFiiF) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (func $std/typedarray/reduceFloat64ArrayTest~anonymous|12 (; 87 ;) (type $FFiiF) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) get_local $0 get_local $1 f64.add ) - (func $~lib/typedarray/Float64Array#reduce (; 80 ;) (type $iiFF) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) + (func $~lib/internal/typedarray/TypedArray#__unchecked_get (; 88 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) + (local $2 i32) + (local $3 i32) + get_local $0 + i32.load + set_local $2 + get_local $0 + i32.load offset=4 + set_local $3 + get_local $2 + get_local $1 + i32.const 3 + i32.shl + i32.add + get_local $3 + i32.add + f64.load offset=8 + ) + (func $~lib/typedarray/Float64Array#reduce (; 89 ;) (type $iiFF) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) i32.const 0 set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) - get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.4 (result i32) get_local $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $5 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -4885,41 +4600,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.0 (result f64) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.13 (result f64) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 3 - i32.shl - i32.add - f64.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $FFiiF) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.add + set_local $3 end br $continue|0 end @@ -4927,25 +4620,25 @@ end get_local $2 ) - (func $std/typedarray/reduceFloat64ArrayTest (; 81 ;) (type $v) + (func $std/typedarray/reduceFloat64ArrayTest (; 90 ;) (type $v) (local $0 i32) (local $1 f64) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 12 f64.const 0 @@ -4958,53 +4651,35 @@ if i32.const 0 i32.const 8 - i32.const 402 + i32.const 401 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightInt8ArrayTest~anonymous|13 (; 82 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceRightInt8ArrayTest~anonymous|13 (; 91 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Int8Array#reduceRight (; 83 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int8Array#reduceRight (; 92 ;) (type $iiii) (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) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.12 (result i32) - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) get_local $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -5012,41 +4687,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 0 - i32.shl - i32.add - i32.load8_s offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -5054,25 +4707,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightInt8ArrayTest (; 84 ;) (type $v) + (func $std/typedarray/reduceRightInt8ArrayTest (; 93 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 13 i32.const 0 @@ -5089,53 +4742,35 @@ if i32.const 0 i32.const 8 - i32.const 440 + i32.const 439 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightUint8ArrayTest~anonymous|14 (; 85 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceRightUint8ArrayTest~anonymous|14 (; 94 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint8Array#reduceRight (; 86 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint8Array#reduceRight (; 95 ;) (type $iiii) (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) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) get_local $0 i32.load offset=8 i32.const 0 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -5143,41 +4778,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.2 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.3 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 0 - i32.shl - i32.add - i32.load8_u offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -5185,25 +4798,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightUint8ArrayTest (; 87 ;) (type $v) + (func $std/typedarray/reduceRightUint8ArrayTest (; 96 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 14 i32.const 0 @@ -5218,108 +4831,23 @@ if i32.const 0 i32.const 8 - i32.const 455 + i32.const 454 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightUint8ClampedArrayTest~anonymous|15 (; 88 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceRightUint8ClampedArrayTest~anonymous|15 (; 97 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint8ClampedArray#reduceRight (; 89 ;) (type $iiii) (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) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else - get_local $0 - i32.load offset=8 - i32.const 0 - i32.shr_u - end - set_local $5 - block $break|0 - loop $continue|0 - get_local $4 - get_local $5 - i32.ne - if - block - block (result i32) - i32.const 4 - set_global $~argc - get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.3 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.4 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 0 - i32.shl - i32.add - i32.load8_u offset=8 - end - end - get_local $4 - get_local $0 - get_local $1 - call_indirect (type $iiiii) - end - set_local $2 - get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 - end - br $continue|0 - end - end - end - get_local $2 - ) - (func $std/typedarray/reduceRightUint8ClampedArrayTest (; 90 ;) (type $v) + (func $std/typedarray/reduceRightUint8ClampedArrayTest (; 98 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 @@ -5336,7 +4864,7 @@ get_local $0 i32.const 15 i32.const 0 - call $~lib/typedarray/Uint8ClampedArray#reduceRight + call $~lib/typedarray/Uint8Array#reduceRight set_local $1 get_local $1 i32.const 255 @@ -5347,53 +4875,35 @@ if i32.const 0 i32.const 8 - i32.const 470 + i32.const 469 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightInt16ArrayTest~anonymous|16 (; 91 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceRightInt16ArrayTest~anonymous|16 (; 99 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Int16Array#reduceRight (; 92 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int16Array#reduceRight (; 100 ;) (type $iiii) (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) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -5401,41 +4911,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 1 - i32.shl - i32.add - i32.load16_s offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -5443,25 +4931,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightInt16ArrayTest (; 93 ;) (type $v) + (func $std/typedarray/reduceRightInt16ArrayTest (; 101 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 16 i32.const 0 @@ -5478,53 +4966,35 @@ if i32.const 0 i32.const 8 - i32.const 485 + i32.const 484 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightUint16ArrayTest~anonymous|17 (; 94 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceRightUint16ArrayTest~anonymous|17 (; 102 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint16Array#reduceRight (; 95 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint16Array#reduceRight (; 103 ;) (type $iiii) (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) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 - i32.load offset=8 - i32.const 1 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 1 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -5532,41 +5002,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 1 - i32.shl - i32.add - i32.load16_u offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -5574,25 +5022,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightUint16ArrayTest (; 96 ;) (type $v) + (func $std/typedarray/reduceRightUint16ArrayTest (; 104 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 17 i32.const 0 @@ -5607,53 +5055,35 @@ if i32.const 0 i32.const 8 - i32.const 500 + i32.const 499 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightInt32ArrayTest~anonymous|18 (; 97 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceRightInt32ArrayTest~anonymous|18 (; 105 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Int32Array#reduceRight (; 98 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Int32Array#reduceRight (; 106 ;) (type $iiii) (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) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.11 (result i32) - get_local $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.10 (result i32) get_local $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -5661,41 +5091,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.2 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -5703,25 +5111,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightInt32ArrayTest (; 99 ;) (type $v) + (func $std/typedarray/reduceRightInt32ArrayTest (; 107 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 18 i32.const 0 @@ -5734,53 +5142,35 @@ if i32.const 0 i32.const 8 - i32.const 515 + i32.const 514 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightUint32ArrayTest~anonymous|19 (; 100 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) + (func $std/typedarray/reduceRightUint32ArrayTest~anonymous|19 (; 108 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) get_local $0 get_local $1 i32.add ) - (func $~lib/typedarray/Uint32Array#reduceRight (; 101 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/typedarray/Uint32Array#reduceRight (; 109 ;) (type $iiii) (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) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -5788,41 +5178,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 2 - i32.shl - i32.add - i32.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $iiiii) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -5830,25 +5198,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightUint32ArrayTest (; 102 ;) (type $v) + (func $std/typedarray/reduceRightUint32ArrayTest (; 110 ;) (type $v) (local $0 i32) (local $1 i32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 19 i32.const 0 @@ -5861,53 +5229,35 @@ if i32.const 0 i32.const 8 - i32.const 530 + i32.const 529 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightInt64ArrayTest~anonymous|20 (; 103 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/reduceRightInt64ArrayTest~anonymous|20 (; 111 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) get_local $0 get_local $1 i64.add ) - (func $~lib/typedarray/Int64Array#reduceRight (; 104 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (func $~lib/typedarray/Int64Array#reduceRight (; 112 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -5915,41 +5265,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i64) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i64) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $IIiiI) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -5957,25 +5285,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightInt64ArrayTest (; 105 ;) (type $v) + (func $std/typedarray/reduceRightInt64ArrayTest (; 113 ;) (type $v) (local $0 i32) (local $1 i64) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 20 i64.const 0 @@ -5988,53 +5316,35 @@ if i32.const 0 i32.const 8 - i32.const 545 + i32.const 544 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightUint64ArrayTest~anonymous|21 (; 106 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) + (func $std/typedarray/reduceRightUint64ArrayTest~anonymous|21 (; 114 ;) (type $IIiiI) (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i32) (result i64) get_local $0 get_local $1 i64.add ) - (func $~lib/typedarray/Uint64Array#reduceRight (; 107 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) + (func $~lib/typedarray/Uint64Array#reduceRight (; 115 ;) (type $iiII) (param $0 i32) (param $1 i32) (param $2 i64) (result i64) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -6042,41 +5352,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result i64) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result i64) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 3 - i32.shl - i32.add - i64.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $IIiiI) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -6084,25 +5372,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightUint64ArrayTest (; 108 ;) (type $v) + (func $std/typedarray/reduceRightUint64ArrayTest (; 116 ;) (type $v) (local $0 i32) (local $1 i64) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 i64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 i64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 i64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 21 i64.const 0 @@ -6115,53 +5403,35 @@ if i32.const 0 i32.const 8 - i32.const 560 + i32.const 559 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightFloat32ArrayTest~anonymous|22 (; 109 ;) (type $ffiif) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) + (func $std/typedarray/reduceRightFloat32ArrayTest~anonymous|22 (; 117 ;) (type $ffiif) (param $0 f32) (param $1 f32) (param $2 i32) (param $3 i32) (result f32) get_local $0 get_local $1 f32.add ) - (func $~lib/typedarray/Float32Array#reduceRight (; 110 ;) (type $iiff) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) + (func $~lib/typedarray/Float32Array#reduceRight (; 118 ;) (type $iiff) (param $0 i32) (param $1 i32) (param $2 f32) (result f32) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) - get_local $0 - i32.load offset=8 - i32.const 2 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_local $0 i32.load offset=8 i32.const 2 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -6169,41 +5439,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result f32) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.1 (result f32) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 2 - i32.shl - i32.add - f32.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $ffiif) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -6211,25 +5459,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightFloat32ArrayTest (; 111 ;) (type $v) + (func $std/typedarray/reduceRightFloat32ArrayTest (; 119 ;) (type $v) (local $0 i32) (local $1 f32) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 f32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 22 f32.const 0 @@ -6242,53 +5490,35 @@ if i32.const 0 i32.const 8 - i32.const 575 + i32.const 574 i32.const 2 call $~lib/env/abort unreachable end ) - (func $std/typedarray/reduceRightFloat64ArrayTest~anonymous|23 (; 112 ;) (type $FFiiF) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) + (func $std/typedarray/reduceRightFloat64ArrayTest~anonymous|23 (; 120 ;) (type $FFiiF) (param $0 f64) (param $1 f64) (param $2 i32) (param $3 i32) (result f64) get_local $0 get_local $1 f64.add ) - (func $~lib/typedarray/Float64Array#reduceRight (; 113 ;) (type $iiFF) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) + (func $~lib/typedarray/Float64Array#reduceRight (; 121 ;) (type $iiFF) (param $0 i32) (param $1 i32) (param $2 f64) (result f64) (local $3 i32) (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - i32.const 1 - set_local $3 - get_local $3 - if (result i32) - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) - get_local $0 - i32.load offset=8 - i32.const 3 - i32.shr_u - end - i32.const 1 - i32.sub - else - i32.const 0 - end - set_local $4 - get_local $3 - if (result i32) - i32.const -1 - else + block $~lib/internal/typedarray/TypedArray#get:length|inlined.5 (result i32) get_local $0 i32.load offset=8 i32.const 3 i32.shr_u end - set_local $5 + i32.const 1 + i32.sub + set_local $3 + i32.const -1 + set_local $4 block $break|0 loop $continue|0 + get_local $3 get_local $4 - get_local $5 i32.ne if block @@ -6296,41 +5526,19 @@ i32.const 4 set_global $~argc get_local $2 - block $~lib/internal/typedarray/TypedArray#__unchecked_get|inlined.1 (result f64) - block $~lib/internal/arraybuffer/loadUnsafeWithOffset|inlined.14 (result f64) - get_local $0 - i32.load - set_local $6 - get_local $0 - i32.load offset=4 - set_local $7 - get_local $6 - get_local $7 - i32.add - get_local $4 - i32.const 3 - i32.shl - i32.add - f64.load offset=8 - end - end - get_local $4 + get_local $0 + get_local $3 + call $~lib/internal/typedarray/TypedArray#__unchecked_get + get_local $3 get_local $0 get_local $1 call_indirect (type $FFiiF) end set_local $2 get_local $3 - if (result i32) - get_local $4 - i32.const 1 - i32.sub - else - get_local $4 - i32.const 1 - i32.add - end - set_local $4 + i32.const 1 + i32.sub + set_local $3 end br $continue|0 end @@ -6338,25 +5546,25 @@ end get_local $2 ) - (func $std/typedarray/reduceRightFloat64ArrayTest (; 114 ;) (type $v) + (func $std/typedarray/reduceRightFloat64ArrayTest (; 122 ;) (type $v) (local $0 i32) (local $1 f64) i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_local $0 get_local $0 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 2 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_local $0 i32.const 23 f64.const 0 @@ -6369,13 +5577,13 @@ if i32.const 0 i32.const 8 - i32.const 590 + i32.const 589 i32.const 2 call $~lib/env/abort unreachable end ) - (func $start (; 115 ;) (type $v) + (func $start (; 123 ;) (type $v) (local $0 i32) get_global $~lib/typedarray/Int8Array.BYTES_PER_ELEMENT i32.const 1 @@ -6525,21 +5733,21 @@ call $std/typedarray/testInstantiate i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/arr get_global $std/typedarray/arr i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set - block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) + call $~lib/internal/typedarray/TypedArray#__set + block $~lib/internal/typedarray/TypedArray#get:length|inlined.1 (result i32) get_global $std/typedarray/arr set_local $0 get_local $0 @@ -6553,7 +5761,7 @@ if i32.const 0 i32.const 8 - i32.const 97 + i32.const 96 i32.const 0 call $~lib/env/abort unreachable @@ -6566,7 +5774,7 @@ if i32.const 0 i32.const 8 - i32.const 98 + i32.const 97 i32.const 0 call $~lib/env/abort unreachable @@ -6581,17 +5789,31 @@ if i32.const 0 i32.const 8 - i32.const 99 + i32.const 98 i32.const 0 call $~lib/env/abort unreachable end get_global $std/typedarray/arr i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 1 i32.eq i32.eqz + if + i32.const 0 + i32.const 8 + i32.const 99 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/arr + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 2 + i32.eq + i32.eqz if i32.const 0 i32.const 8 @@ -6601,9 +5823,9 @@ unreachable end get_global $std/typedarray/arr - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 3 i32.eq i32.eqz if @@ -6615,25 +5837,11 @@ unreachable end get_global $std/typedarray/arr - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 3 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 102 - i32.const 0 - call $~lib/env/abort - unreachable - end - get_global $std/typedarray/arr i32.const 1 i32.const 2 call $~lib/typedarray/Int32Array#subarray set_global $std/typedarray/arr - block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.3 (result i32) get_global $std/typedarray/arr set_local $0 get_local $0 @@ -6647,7 +5855,7 @@ if i32.const 0 i32.const 8 - i32.const 105 + i32.const 104 i32.const 0 call $~lib/env/abort unreachable @@ -6659,6 +5867,21 @@ i32.mul i32.eq i32.eqz + if + i32.const 0 + i32.const 8 + i32.const 105 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/arr + i32.load offset=8 + i32.const 1 + i32.const 4 + i32.mul + i32.eq + i32.eqz if i32.const 0 i32.const 8 @@ -6668,10 +5891,9 @@ unreachable end get_global $std/typedarray/arr - i32.load offset=8 - i32.const 1 - i32.const 4 - i32.mul + i32.const 0 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 2 i32.eq i32.eqz if @@ -6682,62 +5904,48 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/arr - i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 2 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 108 - i32.const 0 - call $~lib/env/abort - unreachable - end i32.const 0 i32.const 8 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/af64 get_global $std/typedarray/af64 i32.const 0 f64.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 1 f64.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 2 f64.const 7 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 3 f64.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 4 f64.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 5 f64.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 6 f64.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 7 f64.const 8 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/af64 i32.const 2 i32.const 6 call $~lib/typedarray/Float64Array#subarray set_global $std/typedarray/af64 - block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.2 (result i32) get_global $std/typedarray/af64 set_local $0 get_local $0 @@ -6751,7 +5959,7 @@ if i32.const 0 i32.const 8 - i32.const 122 + i32.const 121 i32.const 0 call $~lib/env/abort unreachable @@ -6766,7 +5974,7 @@ if i32.const 0 i32.const 8 - i32.const 123 + i32.const 122 i32.const 0 call $~lib/env/abort unreachable @@ -6781,7 +5989,7 @@ if i32.const 0 i32.const 8 - i32.const 124 + i32.const 123 i32.const 0 call $~lib/env/abort unreachable @@ -6791,19 +5999,19 @@ set_global $~argc get_global $std/typedarray/af64 i32.const 0 - call $~lib/internal/typedarray/TypedArray#sort|trampoline + call $~lib/typedarray/Float64Array#sort|trampoline end drop get_global $std/typedarray/af64 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 4 f64.eq tee_local $0 if (result i32) get_global $std/typedarray/af64 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 5 f64.eq else @@ -6813,7 +6021,7 @@ if (result i32) get_global $std/typedarray/af64 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 6 f64.eq else @@ -6823,7 +6031,7 @@ if (result i32) get_global $std/typedarray/af64 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get f64.const 7 f64.eq else @@ -6833,14 +6041,14 @@ if i32.const 0 i32.const 8 - i32.const 126 + i32.const 125 i32.const 0 call $~lib/env/abort unreachable end i32.const 0 i32.const 3 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/clampedArr get_global $std/typedarray/clampedArr i32.const 0 @@ -6856,12 +6064,28 @@ call $~lib/typedarray/Uint8ClampedArray#__set get_global $std/typedarray/clampedArr i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and i32.const 0 i32.eq i32.eqz + if + i32.const 0 + i32.const 8 + i32.const 132 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/clampedArr + i32.const 1 + call $~lib/internal/typedarray/TypedArray#__get + i32.const 255 + i32.and + i32.const 2 + i32.eq + i32.eqz if i32.const 0 i32.const 8 @@ -6871,11 +6095,11 @@ unreachable end get_global $std/typedarray/clampedArr - i32.const 1 - call $~lib/internal/typedarray/TypedArray#__get + i32.const 2 + call $~lib/internal/typedarray/TypedArray#__get i32.const 255 i32.and - i32.const 2 + i32.const 255 i32.eq i32.eqz if @@ -6886,51 +6110,35 @@ call $~lib/env/abort unreachable end - get_global $std/typedarray/clampedArr - i32.const 2 - call $~lib/internal/typedarray/TypedArray#__get - i32.const 255 - i32.and - i32.const 255 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 135 - i32.const 0 - call $~lib/env/abort - unreachable - end i32.const 0 i32.const 5 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/arr8 get_global $std/typedarray/arr8 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr8 i32.const 1 i32.const 1 i32.const 3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill drop get_global $std/typedarray/arr8 i32.const 192 @@ -6939,7 +6147,7 @@ if i32.const 0 i32.const 8 - i32.const 145 + i32.const 144 i32.const 0 call $~lib/env/abort unreachable @@ -6951,7 +6159,7 @@ i32.const 0 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int8Array#fill|trampoline end drop get_global $std/typedarray/arr8 @@ -6961,7 +6169,7 @@ if i32.const 0 i32.const 8 - i32.const 148 + i32.const 147 i32.const 0 call $~lib/env/abort unreachable @@ -6970,7 +6178,7 @@ i32.const 1 i32.const 0 i32.const -3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill drop get_global $std/typedarray/arr8 i32.const 240 @@ -6979,7 +6187,7 @@ if i32.const 0 i32.const 8 - i32.const 151 + i32.const 150 i32.const 0 call $~lib/env/abort unreachable @@ -6991,7 +6199,7 @@ i32.const 2 i32.const -2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int8Array#fill|trampoline end drop get_global $std/typedarray/arr8 @@ -7001,7 +6209,7 @@ if i32.const 0 i32.const 8 - i32.const 154 + i32.const 153 i32.const 0 call $~lib/env/abort unreachable @@ -7010,7 +6218,7 @@ i32.const 0 i32.const 1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int8Array#fill drop get_global $std/typedarray/arr8 i32.const 288 @@ -7019,7 +6227,7 @@ if i32.const 0 i32.const 8 - i32.const 157 + i32.const 156 i32.const 0 call $~lib/env/abort unreachable @@ -7036,10 +6244,10 @@ i32.const 0 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int8Array#fill|trampoline end drop - block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.6 (result i32) get_global $std/typedarray/sub8 set_local $0 get_local $0 @@ -7053,7 +6261,7 @@ if i32.const 0 i32.const 8 - i32.const 161 + i32.const 160 i32.const 0 call $~lib/env/abort unreachable @@ -7066,7 +6274,7 @@ if i32.const 0 i32.const 8 - i32.const 162 + i32.const 161 i32.const 0 call $~lib/env/abort unreachable @@ -7079,7 +6287,7 @@ if i32.const 0 i32.const 8 - i32.const 163 + i32.const 162 i32.const 0 call $~lib/env/abort unreachable @@ -7091,7 +6299,7 @@ if i32.const 0 i32.const 8 - i32.const 164 + i32.const 163 i32.const 0 call $~lib/env/abort unreachable @@ -7103,40 +6311,40 @@ if i32.const 0 i32.const 8 - i32.const 165 + i32.const 164 i32.const 0 call $~lib/env/abort unreachable end i32.const 0 i32.const 5 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/arr32 get_global $std/typedarray/arr32 i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/arr32 i32.const 1 i32.const 1 i32.const 3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill drop get_global $std/typedarray/arr32 i32.const 376 @@ -7145,7 +6353,7 @@ if i32.const 0 i32.const 8 - i32.const 175 + i32.const 174 i32.const 0 call $~lib/env/abort unreachable @@ -7157,7 +6365,7 @@ i32.const 0 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int32Array#fill|trampoline end drop get_global $std/typedarray/arr32 @@ -7167,7 +6375,7 @@ if i32.const 0 i32.const 8 - i32.const 178 + i32.const 177 i32.const 0 call $~lib/env/abort unreachable @@ -7176,7 +6384,7 @@ i32.const 1 i32.const 0 i32.const -3 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill drop get_global $std/typedarray/arr32 i32.const 456 @@ -7185,7 +6393,7 @@ if i32.const 0 i32.const 8 - i32.const 181 + i32.const 180 i32.const 0 call $~lib/env/abort unreachable @@ -7197,7 +6405,7 @@ i32.const 2 i32.const -2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int32Array#fill|trampoline end drop get_global $std/typedarray/arr32 @@ -7207,7 +6415,7 @@ if i32.const 0 i32.const 8 - i32.const 184 + i32.const 183 i32.const 0 call $~lib/env/abort unreachable @@ -7216,7 +6424,7 @@ i32.const 0 i32.const 1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill + call $~lib/typedarray/Int32Array#fill drop get_global $std/typedarray/arr32 i32.const 536 @@ -7225,7 +6433,7 @@ if i32.const 0 i32.const 8 - i32.const 187 + i32.const 186 i32.const 0 call $~lib/env/abort unreachable @@ -7242,10 +6450,10 @@ i32.const 0 i32.const 0 i32.const 0 - call $~lib/internal/typedarray/TypedArray#fill|trampoline + call $~lib/typedarray/Int32Array#fill|trampoline end drop - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) get_global $std/typedarray/sub32 set_local $0 get_local $0 @@ -7259,7 +6467,7 @@ if i32.const 0 i32.const 8 - i32.const 191 + i32.const 190 i32.const 0 call $~lib/env/abort unreachable @@ -7271,6 +6479,21 @@ i32.mul i32.eq i32.eqz + if + i32.const 0 + i32.const 8 + i32.const 191 + i32.const 0 + call $~lib/env/abort + unreachable + end + get_global $std/typedarray/sub32 + i32.load offset=8 + i32.const 3 + i32.const 4 + i32.mul + i32.eq + i32.eqz if i32.const 0 i32.const 8 @@ -7280,28 +6503,13 @@ unreachable end get_global $std/typedarray/sub32 - i32.load offset=8 - i32.const 3 - i32.const 4 - i32.mul - i32.eq - i32.eqz - if - i32.const 0 - i32.const 8 - i32.const 193 - i32.const 0 - call $~lib/env/abort - unreachable - end - get_global $std/typedarray/sub32 i32.const 576 call $std/typedarray/isInt32ArrayEqual i32.eqz if i32.const 0 i32.const 8 - i32.const 194 + i32.const 193 i32.const 0 call $~lib/env/abort unreachable @@ -7313,43 +6521,43 @@ if i32.const 0 i32.const 8 - i32.const 195 + i32.const 194 i32.const 0 call $~lib/env/abort unreachable end i32.const 0 get_global $std/typedarray/MAX_F64LENGTH - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor drop i32.const 0 i32.const 6 - call $~lib/internal/typedarray/TypedArray#constructor + call $~lib/internal/typedarray/TypedArray#constructor set_global $std/typedarray/multisubarr get_global $std/typedarray/multisubarr i32.const 0 i32.const 1 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 1 i32.const 2 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 2 i32.const 3 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 3 i32.const 4 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 4 i32.const 5 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 5 i32.const 6 - call $~lib/internal/typedarray/TypedArray#__set + call $~lib/internal/typedarray/TypedArray#__set get_global $std/typedarray/multisubarr i32.const 1 i32.const 6 @@ -7357,7 +6565,7 @@ set_global $std/typedarray/multisubarr1 get_global $std/typedarray/multisubarr1 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 24 i32.shl i32.const 24 @@ -7368,12 +6576,12 @@ if i32.const 0 i32.const 8 - i32.const 212 + i32.const 211 i32.const 0 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.7 (result i32) get_global $std/typedarray/multisubarr1 set_local $0 get_local $0 @@ -7387,7 +6595,7 @@ if i32.const 0 i32.const 8 - i32.const 213 + i32.const 212 i32.const 0 call $~lib/env/abort unreachable @@ -7400,7 +6608,7 @@ if i32.const 0 i32.const 8 - i32.const 214 + i32.const 213 i32.const 0 call $~lib/env/abort unreachable @@ -7413,7 +6621,7 @@ if i32.const 0 i32.const 8 - i32.const 215 + i32.const 214 i32.const 0 call $~lib/env/abort unreachable @@ -7425,7 +6633,7 @@ set_global $std/typedarray/multisubarr2 get_global $std/typedarray/multisubarr2 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 24 i32.shl i32.const 24 @@ -7436,12 +6644,12 @@ if i32.const 0 i32.const 8 - i32.const 218 + i32.const 217 i32.const 0 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.8 (result i32) get_global $std/typedarray/multisubarr2 set_local $0 get_local $0 @@ -7455,7 +6663,7 @@ if i32.const 0 i32.const 8 - i32.const 219 + i32.const 218 i32.const 0 call $~lib/env/abort unreachable @@ -7468,7 +6676,7 @@ if i32.const 0 i32.const 8 - i32.const 220 + i32.const 219 i32.const 0 call $~lib/env/abort unreachable @@ -7481,7 +6689,7 @@ if i32.const 0 i32.const 8 - i32.const 221 + i32.const 220 i32.const 0 call $~lib/env/abort unreachable @@ -7493,7 +6701,7 @@ set_global $std/typedarray/multisubarr3 get_global $std/typedarray/multisubarr3 i32.const 0 - call $~lib/internal/typedarray/TypedArray#__get + call $~lib/internal/typedarray/TypedArray#__get i32.const 24 i32.shl i32.const 24 @@ -7504,12 +6712,12 @@ if i32.const 0 i32.const 8 - i32.const 224 + i32.const 223 i32.const 0 call $~lib/env/abort unreachable end - block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) + block $~lib/internal/typedarray/TypedArray#get:length|inlined.9 (result i32) get_global $std/typedarray/multisubarr3 set_local $0 get_local $0 @@ -7523,7 +6731,7 @@ if i32.const 0 i32.const 8 - i32.const 225 + i32.const 224 i32.const 0 call $~lib/env/abort unreachable @@ -7536,7 +6744,7 @@ if i32.const 0 i32.const 8 - i32.const 226 + i32.const 225 i32.const 0 call $~lib/env/abort unreachable @@ -7549,7 +6757,7 @@ if i32.const 0 i32.const 8 - i32.const 227 + i32.const 226 i32.const 0 call $~lib/env/abort unreachable @@ -7577,6 +6785,6 @@ call $std/typedarray/reduceRightFloat32ArrayTest call $std/typedarray/reduceRightFloat64ArrayTest ) - (func $null (; 116 ;) (type $v) + (func $null (; 124 ;) (type $v) ) ) diff --git a/tests/parser/index-declaration.ts b/tests/parser/index-declaration.ts new file mode 100644 index 00000000..e9374e8e --- /dev/null +++ b/tests/parser/index-declaration.ts @@ -0,0 +1,3 @@ +class A { + [key: i32]: f64; +} diff --git a/tests/parser/index-declaration.ts.fixture.ts b/tests/parser/index-declaration.ts.fixture.ts new file mode 100644 index 00000000..e9374e8e --- /dev/null +++ b/tests/parser/index-declaration.ts.fixture.ts @@ -0,0 +1,3 @@ +class A { + [key: i32]: f64; +} diff --git a/tests/parser/optional-typeparameters.ts b/tests/parser/optional-typeparameters.ts new file mode 100644 index 00000000..fd9ac6dc --- /dev/null +++ b/tests/parser/optional-typeparameters.ts @@ -0,0 +1,3 @@ +function a(): T { return 0; } +function a(): T { return 0; } +function a(): T { return 0; } // ERROR 2706 diff --git a/tests/parser/optional-typeparameters.ts.fixture.ts b/tests/parser/optional-typeparameters.ts.fixture.ts new file mode 100644 index 00000000..29d5e771 --- /dev/null +++ b/tests/parser/optional-typeparameters.ts.fixture.ts @@ -0,0 +1,10 @@ +function a(): T { + return 0; +} +function a(): T { + return 0; +} +function a(): T { + return 0; +} +// ERROR 2706: "Required type parameters may not follow optional type parameters." in optional-typeparameters.ts:3:19